Repository custom instructions give Copilot repository-specific guidance on GitHub. Three types are supported: repository-wide, path-specific and agent instructions.
O que ela faz
Onde GitHub Copilot custom instructions roda e o que acrescenta, segundo a documentação
Repository-wide instructions in .github/copilot-instructions.md
Path-specific instructions in NAME.instructions.md under .github/instructions
Agent instructions via AGENTS.md files anywhere; nearest one wins
Alternatively a single CLAUDE.md or GEMINI.md in the repository root
Copilot cloud agent can generate a copilot-instructions.md from a prompt
Quando usar
Boa adequação
You want Copilot to follow repo build and validation steps
Different paths need different Copilot guidance
Não indicado para
Task-specific instructions: GitHub's generation prompt says instructions must not be task specific
Como instalar o GitHub Copilot custom instructions
Você precisa de: GitHub Copilot; For code review, personal custom-instructions setting enabled (default)
Create .github/copilot-instructions.md in the repository
Write repo summary, build, test and validation steps
For path rules add NAME.instructions.md files under .github/instructions
Or ask Copilot cloud agent at github.com/copilot/agents to generate the file
Commit the files to the repository
Limitações
GitHub's generation prompt asks for instructions no longer than 2 pages
Feature support varies by type; see GitHub's customization overview