At a Glance
Instructions are rule files you give Copilot in advance to define development rules it should always follow.
They are loaded at the Repository / Organization / Personal scope, applying team conventions automatically without writing them into every prompt.
3 Scopes
| Scope | ๐ Location | ๐ก Purpose |
|---|---|---|
| ๐ค Personal | CLI: ~/.copilot/copilot-instructions.mdVS Code: User Settings ( github.copilot.chat.*.instructions)GitHub.com: Copilot Chat โ profile picture โ Personal Instructions | Style preferences, response language, personal writing habits |
| ๐ฆ Repository | .github/copilot-instructions.md (single file)or .github/instructions/*.instructions.md (with applyTo) | Project conventions, framework-specific rules, โalways use library Xโ |
| ๐ข Org / Enterprise | GitHub.com โ Organization Settings โ Copilot โ Custom instructions | Compliance, security requirements, company-wide policies |
๐ฏ Merge order: Org โ Repository โ Personal, stacked in that order. Org rules are strongest and cannot be overridden by users.
๐ฆ Repository Level
Rules that apply to every teammate. The moment someone runs git clone, the projectโs Copilot conventions are in place. Two file formats are available:
.github/copilot-instructions.md
๐ Global
Scope: Entire repository
Loaded: Always active
Purpose: Tech stack, naming conventions, libraries to use/avoid, review standards
.github/instructions/*.instructions.md
๐ฏ Per-file (Path Instructions)
Scope: Only files matching the applyTo glob
Loaded: Auto-injected only when touching those targets
Purpose: Test-specific, language-specific, or area-specific rules (frontend / API / DB, etc.)
---
applyTo: "server/tests/test_*.py"
---
This file uses pytest functional tests.
- Load fixtures from `conftest.py`
- One assert per function
- Always mock LLM calls