GitHub Copilot

Verified against GitHub Copilot Chat · 2026-07-20

Write a .github/copilot-instructions.md file Copilot actually follows

A repository-wide custom-instructions file that Copilot loads automatically into every Chat request, code-review pass, coding-agent session, and commit or PR-description generation in this repo, written so each rule holds up standing alone instead of only in the context it was written in.

GitHub Copilot Chat (VS Code)GitHub Copilot code reviewGitHub Copilot coding agent6 fillable variables

The prompt

Ready to copy — highlighted parts are example details you can swap.

# Repository custom instructions for GitHub Copilot
# Save as .github/copilot-instructions.md at the repo root. Copilot loads this automatically into
# every Copilot Chat request, every automated code-review pass, every coding-agent session, and
# every commit-message and pull-request-description generation in this repository — you never
# retype any of it per conversation.

## What this project is
tools.scult.inNext.js 15 App Router, TypeScript strict mode, Tailwind CSS, Biome for lint and format

## Conventions Copilot must apply by default, unprompted
- Prefer named exports over default exports.
- Co-locate component tests next to the component, not in a separate __tests__ tree.
- Use the existing cn() helper for conditional class names, never template-literal concatenation.

## Patterns to reject outright, not just discourage
- Never use the any type without a comment justifying it.
- Never add a new npm dependency without flagging it in the PR description first.

## What matters most when Copilot is reviewing a change here
Accessibility of any new UI component, and whether new API routes validate input with a schema before touching the database.

## Generated or vendored paths these rules do not govern
.next/, coverage/, and any *.generated.ts file — build output and generated code, not hand-written source.

Copilot has no built-in way to scope this particular file to a subdirectory, so say explicitly
which paths sit outside these rules rather than letting a convention written for hand-authored
source code get silently applied to a generated lockfile, a vendored dependency, or a build
output directory where enforcing it would be actively wrong rather than merely unhelpful.

## Interaction with path-scoped instructions
If a more specific .github/instructions/*.instructions.md file elsewhere in this repo also
applies to the code Copilot is currently touching, both files are added to context together —
this file's rules and the path-scoped file's rules combine, they do not override each other. Do
not repeat a rule here that a path-scoped file already states more precisely for its own
directory; repeating the general version at the repo-wide level only means it wins the reader's
attention first, which defeats the reason the narrower file exists at all.

## How to write every rule above
Each line here gets re-checked and re-applied on every single request Copilot handles in this
repository, with no surrounding conversation available to disambiguate it — write every rule so
it holds standing alone, never only in combination with a sentence written three lines above it.
Prefer one short declarative sentence over a paragraph of context: 'Never use the any type
without a comment justifying it' is a rule Copilot can check itself against; 'we try to keep
things reasonably well typed' is not, because there is no failing case it actually rules out. If
a convention only makes sense with an example, give the example in the same bullet, not as a
separate note two sections away that a single-request read might never reach in combination.

## Maintenance
The first time Copilot suggests something that directly contradicts a rule in this file, treat
that as a signal the rule is unclear or missing a case, not a one-off mistake to wave off — add
the missing case immediately, in the same session, rather than filing it away to fix later. A
rule that has quietly stopped being true and is never removed is worse than no rule at all,
because every future session trusts it by default without re-verifying it against the current
code.

Customize

Optional — swap in your own details for the highlighted parts above.

Why this works

A .github/copilot-instructions.md file is loaded automatically into context for every Copilot Chat request, every automated code-review pass, every coding-agent session, and every commit-message and pull-request-description generation in that repository — unlike a rule typed into one chat, which is scoped to that single conversation and gone the moment it ends. This is also the file the coding agent reads before it starts working on an assigned issue, so a constraint written here bounds its autonomous behavior on a PR you never watched it write, not just its behavior in an interactive chat you are present for. GitHub's own guidance for this file is explicit that short, specific, self-contained statements apply more consistently than long prose, because Copilot has to re-derive the applicable rule from the instructions file plus the current task on every single request — a rule that only makes sense in combination with another sentence three lines up gets dropped more often than one that stands alone. The maintenance discipline matters for a related reason: because this file is trusted by default on every future session without re-verification, a stale claim does not just mislead one conversation, it silently misleads every session for as long as it stays uncorrected, which is why treating a contradicted rule as a signal to fix immediately — rather than a one-off mistake — is the only way the file stays worth trusting months later. Finally, understanding that path-scoped instructions combine with this file rather than override it changes how you should actually write repo-wide rules: a rule repeated at both levels does not get resolved by precedence, it just adds noise, so the repo-wide file should state what is true everywhere and leave the narrower exception to the file whose whole job is stating it precisely.

Verified against

GitHub Copilot Chat Copilot Chat 1.269 (VS Code) · 2026-07-20

GitHub Copilot coding agent GA release, 2026-06 · 2026-07-21

Changelog

  • 2026-07-21 Initial publish, verified against Copilot Chat 1.269 (VS Code) and the Copilot coding agent.

Need this built into your business?

If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.

EXPLORE CUSTOM SOFTWARE
Scope Copilot's instructions to one directory with an applyTo instructions fileA path-scoped .github/instructions/*.instructions.md template using the applyTo frontmatter glob, so a directory-specific rule — a different test framework, a stricter API contract, a legacy pattern that must not spread — applies only where it is actually true instead of polluting the repo-wide instructions file.GitHub Copilot Chat (VS Code)GitHub Copilot coding agent2026-07-21Define a custom Copilot Chat mode instead of re-explaining your workflow every sessionA .github/chatmodes/*.chatmode.md definition — scoped tools, a fixed model, and a narrow system prompt — that turns a repeated review-and-plan style of conversation into a mode you switch into once, instead of a persona you re-describe in the first message every time.GitHub Copilot Chat (VS Code)2026-07-22Turn a prompt you keep retyping into a Copilot prompt file instead of pasting it againA .github/prompts/*.prompt.md reusable prompt file with input placeholders, invoked as a slash command from the Chat input box, so a well-tuned multi-paragraph prompt becomes one command instead of a paste you have to keep re-finding.GitHub Copilot Chat (VS Code)2026-07-22Configure separate Copilot instructions for commit messages, PR descriptions, reviews, and testsA VS Code settings.json block wiring distinct instruction sets for commit-message generation, pull-request-description generation, code review, and test generation, so each of Copilot's task-specific generators gets rules suited to what it is actually producing instead of inheriting one general-purpose file uniformly.GitHub Copilot Chat (VS Code)GitHub Copilot (VS Code Source Control)2026-07-23
All GitHub Copilot prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY