Your project needs rules that always apply across the repository. Where do they go?
Why D is the answer
.github/copilot-instructions.md
Repository-wide instructions live in that file and are applied automatically, so nobody has to remember them.
In detail
- .github/copilot-instructions.md applies across the repository.
- Keep it to rules that apply nearly everywhere.
Use case
An illustrative scenario, not a real incident.
A team wants all code to use its logging library. A line in .github/copilot-instructions.md applies that automatically in the whole repository.
See it in different ways
flowchart TD
A{"What do you need?"} -->|"Rules for the whole repo"| B[".github/copilot-instructions.md"]
A -->|"Rules for some paths"| C[".github/instructions/NAME.instructions.md"]
A -->|"Rules for agents"| D["AGENTS.md"]
A -->|"A task you start yourself"| E["Prompt file"]mindmap
root((Instructions))
Repository wide
copilot-instructions.md
One path
NAME.instructions.md
Agents
Nearest AGENTS.md
Chosen by hand
Prompt filesmindmap
root(("Instructions"))
n1["Repository wide"]
n2[".github/copilot-instructions.md"]
n3["Path specific"]
n4[".github/instructions"]Key point: Repository-wide rules go in copilot-instructions.md.
Why the other options are wrong
- A. A prompt file that each developer runs when they remember to
- A prompt file runs only when someone chooses it.
- B. A pinned issue at the top of the repository's issue tracker
- An issue is not read as instructions.
- C. The description field in the repository settings on GitHub
- A description field is not a rule file.

