AGENTS.md to understand your project’s conventions before making any changes.
GitHub Copilot coding agent documentation
GitHub Copilot coding agent — official documentation.
How Copilot uses AGENTS.md
When you assign an issue or task to the GitHub Copilot coding agent, it readsAGENTS.md as part of its initial context-gathering step. The instructions in the file guide the agent’s decisions about how to write code, which commands to run, and how to format its pull request.
Copilot follows the standard AGENTS.md precedence rule: in a monorepo, the closest AGENTS.md to the files being edited takes precedence over the root file. User instructions provided in the issue or task description override everything.
Agents will attempt to execute testing commands found in AGENTS.md automatically. List your test commands so Copilot can verify its changes before opening a pull request.
What to include for GitHub repositories
For repositories where GitHub Copilot is the primary agent, focus on:- Test commands — Copilot runs these to validate its work before submitting a PR
- PR conventions — title format, required sections in the PR description, label usage
- Branch naming — pattern Copilot should follow when creating branches
- Code style — language-specific rules and any formatter or linter configuration
- Sensitive areas — files or directories that should not be modified without human review
Example AGENTS.md for GitHub repositories
AGENTS.md
