-
Notifications
You must be signed in to change notification settings - Fork 0
Add .github/copilot-instructions.md for agent onboarding #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…d steps and project structure Co-authored-by: lqdev <11130940+lqdev@users.noreply.github.com>
|
I see PR #8 reorganized the repository into Once PR #8's changes are merged into the base branch, the instructions will need updating to reflect:
Would you like me to update the instructions now to match PR #8's structure, or wait until those changes are in the base branch? |
…re from PR #8 Co-authored-by: lqdev <11130940+lqdev@users.noreply.github.com>
Updated in commit b846fa0. The instructions now reflect the new structure:
File remains under 2 pages at 218 lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive onboarding documentation for coding agents by creating a .github/copilot-instructions.md file. However, the documentation contains critical inaccuracies that would cause coding agents to fail when attempting to build or test the project.
Changes:
- Created
.github/directory (previously nonexistent) - Added
copilot-instructions.mdwith 218 lines of onboarding documentation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/copilot-instructions.md
Outdated
| ### Configuration Files | ||
| - `.editorconfig` - F# formatting rules (4 spaces, 120 char lines, LF endings) | ||
| - `.gitignore` - Standard Visual Studio/Rider/VS Code ignores | ||
| - `.devcontainer.json` - VS Code devcontainer with Ionide F# extension | ||
| - `WebmentionFs.slnx` - Solution file (XML format) | ||
| - `src/WebmentionFs/WebmentionFs.fsproj` - Library project file | ||
| - `tests/WebmentionFs.Tests/WebmentionFs.Tests.fsproj` - Test project file |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configuration files section references a non-existent WebmentionFs.slnx file and incorrect project paths. The actual configuration files are:
.editorconfig- F# formatting rules.gitignore- Standard Visual Studio/Rider/VS Code ignores.devcontainer.json- VS Code devcontainer with Ionide F# extensionWebmentionFs.fsproj- Project file (at root, not in src/WebmentionFs/)
There is no solution file (.slnx or .sln) and no tests/WebmentionFs.Tests/WebmentionFs.Tests.fsproj file.
.github/copilot-instructions.md
Outdated
| 1. Run `dotnet build WebmentionFs.slnx` - verify 0 warnings, 0 errors | ||
| 2. Run `dotnet test WebmentionFs.slnx` - all tests must pass |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Before Committing" checklist references non-existent commands. The correct commands are:
- Run
dotnet build WebmentionFs.fsproj(not WebmentionFs.slnx) - Run
dotnet fsi test.fsx(not dotnet test WebmentionFs.slnx - no XUnit test project exists)
| 1. Run `dotnet build WebmentionFs.slnx` - verify 0 warnings, 0 errors | |
| 2. Run `dotnet test WebmentionFs.slnx` - all tests must pass | |
| 1. Run `dotnet build WebmentionFs.fsproj` - verify 0 warnings, 0 errors | |
| 2. Run `dotnet fsi test.fsx` - all script tests must pass |
.github/copilot-instructions.md
Outdated
| | Feature Type | File | Pattern | | ||
| |-------------|------|---------| | ||
| | New domain type | src/WebmentionFs/Domain.fs | Add discriminated union or record | | ||
| | New constant/selector | src/WebmentionFs/Constants.fs | Add to appropriate module | | ||
| | New utility function | src/WebmentionFs/Utils.fs | Add pure function to module | | ||
| | New validation rule | src/WebmentionFs/RequestValidationService.fs | Add to validation pipeline | | ||
| | New service | src/WebmentionFs/NewService.fs | Create class, add to .fsproj AFTER all dependencies | |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table rows for feature location reference incorrect paths. All paths should be at repository root, not in src/WebmentionFs/:
- "src/WebmentionFs/Domain.fs" → "Domain.fs"
- "src/WebmentionFs/Constants.fs" → "Constants.fs"
- "src/WebmentionFs/Utils.fs" → "Utils.fs"
- "src/WebmentionFs/RequestValidationService.fs" → "RequestValidationService.fs"
- "src/WebmentionFs/NewService.fs" → "NewService.fs" and add to WebmentionFs.fsproj (at root)
.github/copilot-instructions.md
Outdated
| ### Directory Layout | ||
|
|
||
| ``` | ||
| WebmentionFs/ | ||
| ├── .github/ # GitHub configuration | ||
| ├── src/ | ||
| │ └── WebmentionFs/ # Main library project | ||
| │ ├── Domain.fs # Core types (no dependencies) | ||
| │ ├── Constants.fs # String constants, CSS selectors | ||
| │ ├── Utils.fs # Pure utility functions (module) | ||
| │ ├── UrlDiscoveryService.fs | ||
| │ ├── RequestValidationService.fs | ||
| │ ├── WebmentionValidationService.fs | ||
| │ ├── WebmentionReceiverService.fs | ||
| │ ├── WebmentionSenderService.fs | ||
| │ └── WebmentionFs.fsproj | ||
| ├── tests/ | ||
| │ └── WebmentionFs.Tests/ # XUnit test project (.NET 8.0) | ||
| │ ├── Tests.fs | ||
| │ └── WebmentionFs.Tests.fsproj | ||
| ├── WebmentionFs.slnx # Solution file | ||
| ├── test.fsx # Interactive test script | ||
| └── [docs, config files...] | ||
| ``` |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description mentions "updated for new structure" with src/WebmentionFs/ and tests/WebmentionFs.Tests/ directories, but this structure does not exist in the repository. All source files remain at the repository root level. This represents a significant discrepancy between the PR description's claims about project structure and the actual repository state.
.github/copilot-instructions.md
Outdated
| **Build from solution (recommended):** | ||
| ```bash | ||
| # 1. Restore all projects | ||
| dotnet restore WebmentionFs.slnx | ||
|
|
||
| # 2. Build all projects (library + tests) | ||
| dotnet build WebmentionFs.slnx | ||
|
|
||
| # 3. Build Release | ||
| dotnet build WebmentionFs.slnx --configuration Release | ||
|
|
||
| # 4. Create NuGet package | ||
| dotnet pack src/WebmentionFs/WebmentionFs.fsproj --configuration Release | ||
| ``` |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All build commands reference a non-existent solution file "WebmentionFs.slnx". The repository does not contain any .slnx or .sln file. The correct build commands should target the project file directly:
dotnet restore WebmentionFs.fsprojdotnet build WebmentionFs.fsprojdotnet pack WebmentionFs.fsproj --configuration Release
Additionally, the path src/WebmentionFs/WebmentionFs.fsproj is incorrect - the project file is located at the repository root as WebmentionFs.fsproj.
.github/copilot-instructions.md
Outdated
| The README mentions CI, but **no .github/workflows directory exists**. There are no automated checks to replicate. When making changes: | ||
| 1. Run `dotnet build WebmentionFs.slnx` - must succeed with 0 warnings | ||
| 2. Run `dotnet test WebmentionFs.slnx` - all tests must pass | ||
| 3. Verify XML docs are present on public APIs | ||
| 4. Follow F# conventions in CONTRIBUTING.md |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation checklist references non-existent commands. Since WebmentionFs.slnx does not exist, the commands dotnet build WebmentionFs.slnx and dotnet test WebmentionFs.slnx will fail. The correct commands are:
dotnet build WebmentionFs.fsprojfor buildingdotnet fsi test.fsxfor testing (there is no XUnit test project)
.github/copilot-instructions.md
Outdated
| → WebmentionReceiverService.fs → WebmentionSenderService.fs | ||
| ``` | ||
|
|
||
| **Never reorder files in WebmentionFs.fsproj** - it will break compilation. |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file ordering documentation references a non-existent path. The correct path is WebmentionFs.fsproj at the repository root, not src/WebmentionFs/WebmentionFs.fsproj. Additionally, the warning "Never reorder files in WebmentionFs.fsproj" is accurate as F# compilation is order-dependent.
.github/copilot-instructions.md
Outdated
| ### Key Directories | ||
| - `src/WebmentionFs/` - Main library source files (.NET Standard 2.1) | ||
| - `tests/WebmentionFs.Tests/` - XUnit test project (.NET 8.0) | ||
| - `src/WebmentionFs/bin/` - Build output (gitignored) | ||
| - `src/WebmentionFs/obj/` - Build artifacts (gitignored) | ||
| - `.github/` - GitHub configuration |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key directories list is incorrect. The actual directories are:
- Repository root - Main library source files (.NET Standard 2.1)
bin/- Build output (gitignored)obj/- Build artifacts (gitignored).github/- GitHub configuration
The src/WebmentionFs/, tests/WebmentionFs.Tests/ directories do not exist.
.github/copilot-instructions.md
Outdated
| | New constant/selector | src/WebmentionFs/Constants.fs | Add to appropriate module | | ||
| | New utility function | src/WebmentionFs/Utils.fs | Add pure function to module | | ||
| | New validation rule | src/WebmentionFs/RequestValidationService.fs | Add to validation pipeline | | ||
| | New service | src/WebmentionFs/NewService.fs | Create class, add to .fsproj AFTER all dependencies | |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table row for "New service" references a non-existent path. The correct instruction should be: "Create class, add to WebmentionFs.fsproj (at root) AFTER all dependencies". There is no src/WebmentionFs/ directory.
| | New service | src/WebmentionFs/NewService.fs | Create class, add to .fsproj AFTER all dependencies | | |
| | New service | NewService.fs | Create class, add to WebmentionFs.fsproj (at root) AFTER all dependencies | |
.github/copilot-instructions.md
Outdated
| - **File order matters** - dependencies must come before dependents in src/WebmentionFs/WebmentionFs.fsproj | ||
| - **Paths changed** - source files now in `src/WebmentionFs/`, not at root | ||
| - **Solution file** - use `WebmentionFs.slnx` to build both library and tests | ||
| - **Test project** - XUnit tests in `tests/WebmentionFs.Tests/` target .NET 8.0 | ||
| - **test.fsx path** - references `./src/WebmentionFs/bin/Debug/netstandard2.1/WebmentionFs.dll` | ||
|
|
||
| ## Key Files Quick Reference | ||
|
|
||
| **src/WebmentionFs/Domain.fs** (99 lines) - All core types: UrlData, ValidationResult, DiscoveryResult, WebmentionValidationResult, MentionTypes | ||
| **src/WebmentionFs/Constants.fs** (138 lines) - EndpointSelectors, MentionSelectors, Http constants, FormFields, ErrorMessages | ||
| **src/WebmentionFs/Utils.fs** (84 lines) - getSourceAndTargetUrlsFromFormBody, getDocumentHeadersAsync, getDocumentContentAsync, getUrlFromSourceDocument | ||
| **src/WebmentionFs/Services** (5 files, ~4-8KB each) - Complete webmention send/receive implementation | ||
| **tests/WebmentionFs.Tests/Tests.fs** - XUnit tests for core domain types and services | ||
| **WebmentionFs.slnx** - Solution file organizing library and test projects | ||
| **test.fsx** - Interactive test script (references built DLL from src/WebmentionFs/bin/) |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Common Gotchas" section contains multiple incorrect path references:
- "dependencies must come before dependents in src/WebmentionFs/WebmentionFs.fsproj" - should be just "WebmentionFs.fsproj" (at root)
- "source files now in
src/WebmentionFs/, not at root" - this is backwards; files ARE at root, there is no src/ directory - "Solution file" - there is no solution file
- "Test project" - there is no XUnit test project in tests/WebmentionFs.Tests/
- "test.fsx path" - should reference
./bin/Debug/netstandard2.1/WebmentionFs.dll, not./src/WebmentionFs/bin/...
| - **File order matters** - dependencies must come before dependents in src/WebmentionFs/WebmentionFs.fsproj | |
| - **Paths changed** - source files now in `src/WebmentionFs/`, not at root | |
| - **Solution file** - use `WebmentionFs.slnx` to build both library and tests | |
| - **Test project** - XUnit tests in `tests/WebmentionFs.Tests/` target .NET 8.0 | |
| - **test.fsx path** - references `./src/WebmentionFs/bin/Debug/netstandard2.1/WebmentionFs.dll` | |
| ## Key Files Quick Reference | |
| **src/WebmentionFs/Domain.fs** (99 lines) - All core types: UrlData, ValidationResult, DiscoveryResult, WebmentionValidationResult, MentionTypes | |
| **src/WebmentionFs/Constants.fs** (138 lines) - EndpointSelectors, MentionSelectors, Http constants, FormFields, ErrorMessages | |
| **src/WebmentionFs/Utils.fs** (84 lines) - getSourceAndTargetUrlsFromFormBody, getDocumentHeadersAsync, getDocumentContentAsync, getUrlFromSourceDocument | |
| **src/WebmentionFs/Services** (5 files, ~4-8KB each) - Complete webmention send/receive implementation | |
| **tests/WebmentionFs.Tests/Tests.fs** - XUnit tests for core domain types and services | |
| **WebmentionFs.slnx** - Solution file organizing library and test projects | |
| **test.fsx** - Interactive test script (references built DLL from src/WebmentionFs/bin/) | |
| - **File order matters** - dependencies must come before dependents in `WebmentionFs.fsproj` at the repository root | |
| - **Source file layout** - F# source files are located at the repository root (there is no `src/` directory) | |
| - **Project file** - use `WebmentionFs.fsproj` to build the library | |
| - **Test project** - there is currently no separate xUnit test project in this repository | |
| - **test.fsx path** - references `./bin/Debug/netstandard2.1/WebmentionFs.dll` | |
| ## Key Files Quick Reference | |
| **Domain.fs** (99 lines) - All core types: UrlData, ValidationResult, DiscoveryResult, WebmentionValidationResult, MentionTypes | |
| **Constants.fs** (138 lines) - EndpointSelectors, MentionSelectors, Http constants, FormFields, ErrorMessages | |
| **Utils.fs** (84 lines) - getSourceAndTargetUrlsFromFormBody, getDocumentHeadersAsync, getDocumentContentAsync, getUrlFromSourceDocument | |
| **Services/** (5 files, ~4-8KB each) - Complete webmention send/receive implementation | |
| *(No separate xUnit test project is included in this repository)* | |
| **WebmentionFs.fsproj** - Main project file for the WebmentionFs library | |
| **test.fsx** - Interactive test script (references built DLL from `./bin/Debug/netstandard2.1/WebmentionFs.dll`) |
|
@copilot apply changes based on the comments in this thread |
…nstants.fs line count Co-authored-by: lqdev <11130940+lqdev@users.noreply.github.com>
Fixed in commit 92da211. The instructions now correctly reflect the actual flat repository structure: Corrected:
My mistake: I incorrectly assumed PR #8's structural changes were merged into this branch. They are not - this branch uses the flat structure with all files at root. |
|
@copilot please fix your mess |
The instructions are now correct (commit 92da211). All references to non-existent Current state verified:
The confusion in commit b846fa0 has been fixed. The documentation now matches the actual repository structure. |
Comprehensive onboarding documentation for coding agents to reduce exploration overhead and build failures on first interaction with the repository.
Changes
.github/directory - Previously nonexistentcopilot-instructions.md(177 lines) with:WebmentionFs.fsprojdotnet fsi test.fsx)task {}async, Constants module usage.github/workflowsexists)Key Technical Details
Build sequence (tested and validated):
Project structure (flat layout):
File ordering constraint: F# compilation requires dependency-ordered files in
WebmentionFs.fsprojat repository root:Reordering breaks compilation.
Target framework: Library targets .NET Standard 2.1 (compatible with .NET Core 3.0+, .NET 5+, .NET 6+, .NET 8+, .NET 10+)
Testing: Interactive test script
test.fsx(no XUnit test project) - run withdotnet fsi test.fsxBuild output:
bin/Debug/netstandard2.1/WebmentionFs.dllat repository rootOriginal prompt
Your task is to "onboard" this repository to Copilot coding agent by adding a .github/copilot-instructions.md file in the repository that contains information describing how a coding agent seeing it for the first time can work most efficiently.
You will do this task only one time per repository and doing a good job can SIGNIFICANTLY improve the quality of the agent's work, so take your time, think carefully, and search thoroughly before writing the instructions.
- Reduce the likelihood of a coding agent pull request getting rejected by the user due to generating code that fails the continuous integration build, fails a validation pipeline, or having misbehavior. - Minimize bash command and build failures. - Allow the agent to complete its task more quickly by minimizing the need for exploration using grep, find, str_replace_editor, and code search tools. - Instructions must be no longer than 2 pages. - Instructions must not be task specific.Add the following high level details about the codebase to reduce the amount of searching the agent has to do to understand the codebase each time:
Add information about how to build and validate changes so the agent does not need to search and find it each time.
List key facts about the layout and architecture of the codebase to help the agent find where to make changes with minimal searching.
- A description of the major architectural elements of the project, including the relative paths to the main project files, the location
- A description of the checks run prior to check in, including any GitHub workflows, continuous integration builds, or other validation pipelines.
- Document the steps so that the agent can replicate these itself.
- Any explicit validation steps that the agent can consider to have further confidence in its changes.
- Dependencies that aren't obvious from the layout or file structure.
- Finally, fill in any remaining space with detailed lists of the following, in order of priority: the list of files in the repo root, the
- Perform a comprehensive inventory of the codebase. Search for and view: - README.md, CONTRIBUTING.md, and all other documentation files. - Search the codebase for build steps and indications of workarounds like 'HACK', 'TODO', etc. - All scripts, particularly those pertaining to build and repo or environment setup. - All build and actions pipelines. - All project files. - All configuration and linting files. - For each file: - think: are the contents or the existence of the file information that the coding agent will need to implement, build, test, validate, or demo a code change? - If yes: - Document the command or information in detail. - Explicitly indicate which commands work and which do not and the order in which commands should be run. - Document any errors encountered as well as the steps taken to workaround them. - Document any other steps or information that the agent can use to reduce time spent exploring or trying and failing to run bash commands. - Finally, explicitly instruct the agent to trust the instructions and only perform a search if the information in the instructions is...of configuration files for linting, compilation, testing, and preferences.
contents of the README, the contents of any key source files, the list of files in the next level down of directories, giving priority to the more structurally important and snippets of code from key source files, such as the one containing the main method.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.