Skip to content
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.mdApplied

    Repository-wide · ** · Always included for every chat request in this repository.

  • .github/instructions/typescript.instructions.mdApplied

    Path-specific · **/*.{ts,tsx} · Uses an applyTo glob in its frontmatter.

  • .github/instructions/tests.instructions.mdNot applied

    Path-specific · **/*.test.{ts,tsx} · Rules only for test files.

  • .github/instructions/sql.instructions.mdNot applied

    Path-specific · db/**/*.sql · Only when working on SQL under db/.

  • AGENTS.mdApplied

    Agent 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
Customisation file types
TypeWhen it loadsBest for
InstructionsAlways, or by file globCoding standards and project facts
Prompt fileWhen you run itA prompt you repeat
Custom agentWhen you pick itA role with limited tools
SkillWhen relevant to the taskRepeatable 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.