- Notifications
You must be signed in to change notification settings - Fork3k
Add copilot instructions#1376
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 ourterms of service andprivacy 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
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
SamMorrowDrums commentedNov 10, 2025
@copilot IMPORTANT: this repository mentions documentation for the remote server (which is behind a URL), and shares much of the code with this repository. Ignore instructions that mention the remote server when makeing code changes, unless specifically asked to make changes to remote documentation etc. the only thing you should ensure in changes to accomodate the remote server is that tools and other utilities can be called by as a package by another repository, as we use this repository as a library for the remote server, and so functions that would need to be called to add functionality to another repo should be exported, even though they are often not required to be exported in the repo itself. You can see this pattern in the codebase already. Preserve it. |
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Updated copilot instructions in commit5ce2753 to clarify:
Changes are in the Project Overview (Key Details + Code Quality Standards section), Code Patterns, and Important Reminders#2. |
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 GitHub Copilot instructions for the GitHub MCP Server project. The document serves as a detailed guide for AI-assisted development, covering project structure, build processes, testing guidelines, and development workflows.
Key Changes
- Added
.github/copilot-instructions.mdwith 292 lines of comprehensive project documentation - Documented project overview, build commands, directory structure, and development workflows
- Included critical information about testing, linting, CI/CD, and code quality standards
💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.
| All workflows run on push/PR unless noted. Located in`.github/workflows/`: | ||
| 1.**go.yml** - Build and test on ubuntu/windows/macos. Runs`script/test` and builds binary | ||
| 2.**lint.yml** - Runs golangci-lint v2.5 with actions/setup-go stable |
CopilotAINov 10, 2025
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 reference to "golangci-lint v2.5" is ambiguous. Based on.github/workflows/lint.yml, "v2.5" refers to thegolangci-lint-action GitHub Action version, not the golangci-lint tool version itself. Consider clarifying this as "golangci-lint-action v2.5" or specifying the actual golangci-lint tool version to avoid confusion.
| 2.**lint.yml** - Runs golangci-lint v2.5 with actions/setup-go stable | |
| 2.**lint.yml** - Runs golangci-lint-action v2.5 (GitHub Action) with actions/setup-go stable |
| ###Go Code Requirements | ||
| -**gofmt with simplify flag (-s)** - Automatically run by`script/lint` | ||
| -**golangci-lint v2.5.0** with these linters enabled: |
CopilotAINov 10, 2025
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 reference to "golangci-lint v2.5.0" is misleading. The "v2" in.golangci.yml refers to the configuration file format version, not the golangci-lint tool version. Consider clarifying what specific version of the golangci-lint tool is being used, or removing the version number if it's not relevant to the instructions.
| -**golangci-lint v2.5.0** with these linters enabled: | |
| -**golangci-lint** with these linters enabled: |
| **ALWAYS run these commands in this exact order before using report_progress or finishing work:** | ||
| 1.**Format Code:**`script/lint` (this runs`gofmt -s -w .` then`golangci-lint`) |
CopilotAINov 10, 2025
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.
Minor grammar issue: "this runs" can be simplified to "runs" for consistency with the pattern used in line 30.
| 1.**Format Code:**`script/lint` (thisruns`gofmt -s -w .` then`golangci-lint`) | |
| 1.**Format Code:**`script/lint` (runs`gofmt -s -w .` then`golangci-lint`) |
Uh oh!
There was an error while loading.Please reload this page.
Coding agents waste time exploring codebases and make preventable mistakes that fail CI. This adds
.github/copilot-instructions.mdto eliminate that friction.Content structure:
script/lint→script/test→script/generate-docs(when tools change). All ~1s.UPDATE_TOOLSNAPS=trueto update), e2e tests require PATCritical rules codified:
script/tag-releaseor push tags.snapfiles - they document API surface290 lines, information-dense, eliminates exploration overhead for common tasks while preserving library usage patterns.
Original 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 togenerating code that fails the continuous integration build, fails a validation pipeline, orhaving 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 instruction...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 our2 minute survey.