All 5 AI packs for $39 →
← ToolTier Library
Copilot instructions · Free

Copilot code review instructions (what to flag, what to skip)

A free .github/instructions/code-review.instructions.md for GitHub Copilot code review: what to flag, what to skip, how to word comments with a severity, and your own project rules, kept out of the cloud agent's context.

Install
.github/instructions/code-review.instructions.md
Last tested
GitHub Copilot code review · 2026-11-05

Out of the box, an AI reviewer tends to comment on everything. This file tells Copilot code review what actually matters in your repo (bugs, security, missing tests, breaking changes), what to ignore (anything your linter or CI already enforces) and how to write a comment you can act on, with a severity on each.

It uses two frontmatter keys from GitHub's docs, checked on November 5, 2026: applyTo, a glob that says which files the instructions cover, and excludeAgent, which accepts "code-review" or "cloud-agent". Here applyTo is "**" and excludeAgent is "cloud-agent", so only Copilot code review reads the file. Path-specific instructions on GitHub.com are supported by those two features only.

Old advice said Copilot code review stops reading an instruction file after 4,000 characters. GitHub's changelog for June 12, 2026 says that limit has been removed, but shorter files with the most important rules first are still easier to follow. When it reviews a pull request, Copilot reads instructions from the head branch, so you can test edits to this file in the same PR that adds it. For the repo-wide file, start with our free copilot-instructions.md for Next.js.

code-review.instructions.md
---
applyTo: "**"
excludeAgent: "cloud-agent"
---

# Code review instructions

These instructions are read only by Copilot code review (the cloud agent skips this file).

## What to flag
- Bugs: wrong conditions, off-by-one errors, unhandled null or undefined, missing `await`, swallowed errors, race conditions.
- Security: secrets or tokens in code, SQL or shell built from user input, missing authorization checks, unvalidated request data, logging of personal data.
- Missing tests: new logic or a bug fix with no test that would have failed before the change.
- Breaking changes: renamed or removed public APIs, config keys, environment variables or database columns without a migration or a note in the PR description.

## What to skip
- Formatting, import order and naming handled by the linter or formatter ([eslint | ruff | prettier | gofmt]). Don't comment on anything CI already enforces.
- Personal style preferences and nitpicks. If a comment wouldn't change whether the PR should merge, don't write it.
- Files under `[dist/, generated/, **/*.lock, **/__snapshots__/]`.

## How to comment
- Start each comment with a severity: **Blocker**, **Should fix** or **Question**.
- Say what is wrong, why it matters in one sentence, and show a concrete fix when it's short.
- Group repeated problems into one comment instead of commenting on every occurrence.
- If the PR looks good, say so in one sentence. Don't invent issues to seem thorough.

## Project rules to check
- [Every API route validates input with zod before using it.]
- [Database access goes through src/db/, never directly from route handlers.]
- [User-facing strings go through the i18n helper.]
Works with: GitHub Copilot
GitHub CopilotCode reviewCustom instructions

← More free rules, templates and prompts

+ Your logo here