Skip to main content
GitHub Copilot’s coding agent is a GitHub Actions-based agent that can autonomously open pull requests, write code, run tests, and iterate on feedback. It reads 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 reads AGENTS.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
# AGENTS.md

## Build and test
- Clean install: `npm ci`
- Compile: `npm run build`
- Run test suite: `npm test`
- Lint: `npm run lint`
- TypeScript compiler check: `npm run typecheck`

## Code style
- TypeScript throughout; no JavaScript files in `src/`
- Prettier handles formatting — do not adjust whitespace manually
- Import order: external packages first, then internal modules, then relative imports
- No `console.log` in production code; use the logger at `src/lib/logger.ts`

## Pull requests
- Branch names: `feat/<short-description>`, `fix/<issue-number>-<short-description>`
- PR title: Conventional Commits format — `feat: ...`, `fix: ...`, `chore: ...`
- PR description must include:
  - A summary of what changed and why
  - A "Testing" section describing how the change was verified
  - A reference to the related issue: `Closes #<number>`

## Do not modify without human review
- `.github/workflows/` — CI/CD pipeline configuration
- `src/auth/` — authentication and authorization logic
- `prisma/migrations/` — database migration files

Build docs developers (and LLMs) love