Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Copilot wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/add-copilot-instructions-file

Conversation

Copy link
Contributor

CopilotAI commentedNov 10, 2025
edited
Loading

Coding agents waste time exploring codebases and make preventable mistakes that fail CI. This adds.github/copilot-instructions.md to eliminate that friction.

Content structure:

  • Build validation - Exact command sequence before commits:script/lintscript/testscript/generate-docs (when tools change). All ~1s.
  • Project architecture - Directory layout, 280 LOC Go 1.24+ MCP server, primary focus on stdio server (not mcpcurl)
  • Library usage - Documents that this repo is used as a library by the remote server; functions should be exported (capitalized) if callable by other repos
  • Code quality standards - Emphasizes high bar for popular open source repo: clarity over cleverness, atomic commits, maintain/improve structure
  • CI/CD - 8 workflows documented: go.yml, lint.yml, docs-check.yml, code-scanning.yml, license-check.yml, docker-publish.yml, goreleaser.yml, registry-releaser.yml
  • Testing patterns - Unit tests with testify, toolsnaps for API schema validation (UPDATE_TOOLSNAPS=true to update), e2e tests require PAT
  • Code style - Go naming (ID/API/URL not Id/Api/Url), golangci-lint v2.5.0, minimal focused changes
  • Common workflows - Adding MCP tools, fixing bugs, updating deps with step-by-step commands
  • Troubleshooting - Doc-check failures, toolsnap mismatches, lint errors, license check failures

Critical rules codified:

  • Ignore remote server instructions when making code changes (unless specifically asked)
  • Export functions if they could be used by other repos as a library
  • Never usescript/tag-release or push tags
  • Always update toolsnaps when changing MCP tool schemas
  • Commit.snap files - they document API surface
  • Keep e2e tests updated using their specific style

290 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:

  • A summary of what the repository does.
  • High level repository information, such as the size of the repo, the type of the project, the languages, frameworks, or target runtimes in use.

Add information about how to build and validate changes so the agent does not need to search and find it each time.

  • For each of bootstrap, build, test, run, lint, and any other scripted step, document the sequence of steps to take to run it successfully as well as the versions of any runtime or build tools used.
  • Each command should be validated by running it to ensure that it works correctly as well as any preconditions and postconditions.
  • Try cleaning the repo and environment and running commands in different orders and document errors and and misbehavior observed as well as any steps used to mitigate the problem.
  • Run the tests and document the order of steps required to run the tests.
  • Make a change to the codebase. Document any unexpected build issues as well as the workarounds.
  • Document environment setup steps that seem optional but that you have validated are actually required.
  • Document the time required for commands that failed due to timing out.
  • When you find a sequence of commands that work for a particular purpose, document them in detail.
  • Use language to indicate when something should always be done. For example: "always run npm install before building".
  • Record any validation steps from documentation.

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
    of configuration files for linting, compilation, testing, and preferences.
  • 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
    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.
- 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...

💬 We'd love your input! Share your thoughts on Copilot coding agent in our2 minute survey.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
CopilotAI changed the title[WIP] Add Copilot instructions for efficient onboardingAdd copilot instructions for repository onboardingNov 10, 2025
Copilot finished work on behalf ofSamMorrowDrumsNovember 10, 2025 09:24
@SamMorrowDrums
Copy link
Collaborator

@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>
Copy link
ContributorAuthor

@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 ...

Updated copilot instructions in commit5ce2753 to clarify:

  1. Remote server guidance - Added explicit reminder to ignore remote server instructions when making code changes unless specifically asked
  2. Library usage pattern - Documented that functions should be exported (capitalized) if they could be called by other repos, even if not needed internally, to preserve the library usage pattern
  3. Code quality standards - Added section emphasizing this is a popular open source repo with high standards for clarity, atomic commits, and structure

Changes are in the Project Overview (Key Details + Code Quality Standards section), Code Patterns, and Important Reminders#2.

Copilot finished work on behalf ofSamMorrowDrumsNovember 10, 2025 09:34
@SamMorrowDrumsSamMorrowDrums changed the titleAdd copilot instructions for repository onboardingAdd copilot instructionsNov 10, 2025
@SamMorrowDrumsSamMorrowDrums marked this pull request as ready for reviewNovember 10, 2025 09:47
@SamMorrowDrumsSamMorrowDrums requested a review froma team as acode ownerNovember 10, 2025 09:47
CopilotAI review requested due to automatic review settingsNovember 10, 2025 09:47
Copy link
Contributor

CopilotAI left a 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.md with 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

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
###Go Code Requirements

-**gofmt with simplify flag (-s)** - Automatically run by`script/lint`
-**golangci-lint v2.5.0** with these linters enabled:

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.

Suggested change
-**golangci-lint v2.5.0** with these linters enabled:
-**golangci-lint** with these linters enabled:

Copilot uses AI. Check for mistakes.

**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`)

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.

Suggested change
1.**Format Code:**`script/lint` (thisruns`gofmt -s -w .` then`golangci-lint`)
1.**Format Code:**`script/lint` (runs`gofmt -s -w .` then`golangci-lint`)

Copilot uses AI. Check for mistakes.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@SamMorrowDrumsSamMorrowDrumsAwaiting requested review from SamMorrowDrums

At least 1 approving review is required to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp