Give Copilot repository instructions that can be checked
Describe the project’s real commands and constraints, keep instructions concise and confirm the feature actually reads the supported file.
In brief
Repository instructions help a coding assistant understand the project’s conventions. Write the commands and constraints that are true for the repository, not an aspirational architecture or a list of praise.
This can reduce repeated corrections about tests, generated files and supported patterns.
Document useful facts
List the real build and relevant validation commands, source-of-truth directories and patterns that should be preserved. Say where generated output comes from and how to recreate it. Do not include secrets or private credentials in the instruction file.
Use supported scope
GitHub supports repository-wide instructions through its documented file and feature-specific mechanisms. Read the current path and applicability rules; do not assume a similarly named file is read by every assistant. Keep conflicting instructions out of overlapping scopes.
Check compliance in the result
Use a small legitimate change and inspect whether the assistant used the stated source and checks. Correct stale instructions when commands or architecture change. Keep CI and review checks authoritative; a claim that instructions were followed does not prove a test ran.
Before you act
Instruction support differs across Copilot features and environments. Instructions are guidance, not a substitute for code checks or a security permission boundary.
What to do next
- Read the current supported repository-instruction format for the Copilot feature you use.
- Add concise true build, test, style and generated-file guidance.
- Confirm the feature receives the instructions and review a small result against them.