GitHub Copilot: .github/copilot-instructions.md location, format and template
Where GitHub Copilot reads project instructions, whether it reads AGENTS.md, and what the format allows. From the official documentation, checked Oct 7, 2026. See also GitHub Copilot: pricing, popularity and alternatives.
Project files
.github/copilot-instructions.mdfor the whole repository.github/instructions/*.instructions.mdwith anapplyToglob for specific filesAGENTS.md(the nearest one wins) for the Copilot coding agent; VS Code reads it too
Global (all projects)
- Personal and organization instructions on GitHub.com; in VS Code, instruction files in your profile
AGENTS.md
✓ Yes. In VS Code it is the chat.useAgentsMdFile setting; nested AGENTS.md files are experimental and off by default.
Format and limits
- Front matter of
.instructions.md:applyTo(comma-separated globs), and in VS Codedescriptionandname. - On GitHub.com,
excludeAgent: "code-review"or"cloud-agent"keeps a file from one of them. - Code review reads the instructions from the pull request's head branch.
Sources: docs.github.com/en/copilot/how-tos/configure-custom-instruc… · code.visualstudio.com/docs/copilot/customization/custom-ins…
Templates
Repository instructions for GitHub Copilot
.github/copilot-instructions.mdThis is a Next.js app written in TypeScript.
- Build with `pnpm build`; test with `pnpm test`.
- Put shared logic in `src/lib/`, never in components.
- Prefer server components; add "use client" only when needed.
- In pull requests, explain the why, and list anything that still needs a human check.
Copilot instructions for test files only
.github/instructions/tests.instructions.md---
applyTo: "**/*.test.ts,**/*.spec.ts"
---
- Use Vitest's `describe` and `it`.
- One behaviour per test, named after the behaviour.
- Mock network calls; never call real APIs from tests.
AGENTS.md for a TypeScript project
AGENTS.md# AGENTS.md
## Project
One paragraph: what this repository does and who uses it.
## Commands
- Install: `pnpm install`
- Dev server: `pnpm dev`
- Tests: `pnpm test` (run before you finish)
- Lint and types: `pnpm lint && pnpm typecheck`
## Layout
- `src/app/`: routes and pages
- `src/lib/`: shared logic, no UI code
- `tests/`: mirrors `src/`
## Conventions
- TypeScript strict mode; avoid `any`.
- Follow the patterns already in `src/` before adding new ones.
- Small, focused functions; name things for what they do.
## Boundaries
- Never read or edit `.env*` files or commit secrets.
- Ask before adding a dependency or changing a public API.
## Done means
Tests pass, lint is clean, and the change is explained in the PR description.
Written by AgentGid as a starting point; swap in your own commands and folders.
Other agents
Claude Code CLAUDE.mdOpenAI Codex AGENTS.mdCursor .cursor/rules/*.mdcGemini CLI GEMINI.mdWindsurf (Devin Desktop) .windsurf/rules/*.mdCline .clinerules/Roo Code .roo/rules/Aider CONVENTIONS.mdZed .rulesJetBrains Junie .junie/AGENTS.mdKiro .kiro/steering/*.mdAmp AGENTS.mdContinue .continue/rules/goose AGENTS.md / .goosehintsOpenCode AGENTS.mdKilo Code AGENTS.mdAugment Code .augment/rules/Factory Droid AGENTS.mdQwen Code QWEN.mdWarp AGENTS.mdDevin AGENTS.mdJules AGENTS.mdReplit Agent replit.mdCrush CRUSH.md / AGENTS.md