Module 2 · InstructionsVerified 2 Nov 2026
Custom instructions
Write your project rules once. Copilot reads them for every request, so your prompts stay short.
See which files apply
Pick the file you are editing. Matching instruction files light up.
Which instruction files apply?
Choose a file you are editing
.github/copilot-instructions.mdAppliedRepository-wide ·
**· Always included for every chat request in this repository..github/instructions/typescript.instructions.mdAppliedPath-specific ·
**/*.{ts,tsx}· Uses an applyTo glob in its frontmatter..github/instructions/tests.instructions.mdNot appliedPath-specific ·
**/*.test.{ts,tsx}· Rules only for test files..github/instructions/sql.instructions.mdNot appliedPath-specific ·
db/**/*.sql· Only when working on SQL under db/.AGENTS.mdAppliedAgent instructions ·
**· A cross-tool convention that other coding agents also read.
.github/copilot-instructions.md
# Copilot instructions
## Stack
- Next.js App Router, TypeScript strict, Tailwind CSS.
## Rules
- Prefer server components. Add "use client" only when needed.
- Never use `any`. Use `unknown` and narrow it.
- Run `npm run check` before saying a task is done.
## Do not
- Do not add dependencies without asking.
- Do not edit generated files in /src/generated.Do
- ✓ State the stack and versions
- ✓ Give commands to run (test, lint)
- ✓ Say what to avoid, with a reason
- ✓ Keep each rule to one line
Don't
- ✗ Write essays or tutorials
- ✗ Say “write good code”
- ✗ Duplicate what a linter already enforces
- ✗ Paste secrets or credentials
| Type | When it loads | Best for |
|---|---|---|
| Instructions | Always, or by file glob | Coding standards and project facts |
| Prompt file | When you run it | A prompt you repeat |
| Custom agent | When you pick it | A role with limited tools |
| Skill | When relevant to the task | Repeatable tasks with scripts |
Instruction file builder
.github/copilot-instructions.md
.github/copilot-instructions.md
# Copilot instructions ## Stack - Next.js, TypeScript strict, Tailwind ## Conventions - Prefer small pure functions - Run `npm test` before finishing a task and report the result. ## Never - Add dependencies without asking
Precedence
When a custom agent's own instructions conflict with general instructions, the agent's take precedence. Keep them consistent.