◀ Playbook index
NO.05

Instructions

Updated: 2026-10-26

At a Glance

Instructions are rule files you give Copilot in advance to define development rules it should 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
👤 PersonalCLI: ~/.copilot/copilot-instructions.md
VS 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 / EnterpriseGitHub.com → Organization Settings → Copilot → Custom instructionsCompliance, security requirements, company-wide policies

🎯 Precedence: Personal → Repository → Organization, in that priority order. Personal instructions take the highest priority, so user settings override organization policy (see the official docs for details).

📦 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

What happens inside the harness?

At session start, the harness loads the always-on instructions (.github/copilot-instructions.md) into context. When the user then asks to edit a file at a specific path, the harness loads any path-specific instructions whose applyTo glob matches that path.

HARNESS PUT ALWAYS-ON INSTRUCTIONS IN CONTEXT .github/copilot-instructions.md --- # Coding rules - Use TypeScript - Use pnpm - Write tests .github/instructions/db.instructions.md --- applyTo: src/db/** --- # DB guidelines - Use prepared statements USER "TOUCH THE DB" HARNESS LOADS MATCHING PATH INSTRUCTION INTO CONTEXT edit src/db/users.ts MODELCONTEXT SYSTEM & TOOLS INSTRUCTIONS PROMPT FILE EDIT REQUEST PATH INSTRUCTION
Slides 日本語