An untuned AI reviewer is a nit firehose that teams learn to ignore within two weeks. A tuned one — loaded with your team's actual standards via instructions files — catches real violations consistently and shuts up otherwise.
Tier: Core · Workflow area: Code Review
This playbook covers writing the instructions, seeding test PRs to measure signal-vs-noise, and iterating until the bot earns its place in the pipeline.
gh pr list --state merged --limit 50 then mine comments for repeated feedback.Extract 5–8 enforceable standards. Good instructions are checkable from a diff; aspirations are not. Convert each recurring review comment into a rule with a detection condition:
except/catch must either re-raise, return an explicit error value, or log with logger.exception including context — flag bare except: pass and log-and-continue as blocking."Write the instructions file. For GitHub Copilot code review, create .github/copilot-instructions.md (as of the July 2026 changelog, instructions are read from the head branch, so PRs can ship rule updates with the code they apply to):
# Code review instructions
Review priorities, highest first:
1. FLAG (blocking): raw SQL string interpolation — all queries must use
parameterized bindings or the query builder in `app/db/`.
2. FLAG (blocking): new public API endpoints without a rate-limit decorator
and an entry in `openapi.yaml`.
3. FLAG: any `except`/`catch` that swallows errors (see error policy).
4. FLAG: new env var read without a default + entry in `config/schema.py`.
5. FLAG: tests asserting on log output or sleep()-based timing.
Do NOT comment on: formatting (black/prettier owns it), import order,
docstring style, variable naming unless misleading, anything in
`migrations/` or generated files.
The "do NOT comment on" block is as important as the rules — it is your noise valve.
Seed a calibration PR. Open a test PR containing 5 deliberate violations (one per rule) buried in ~200 lines of otherwise-clean change, plus 3 "trap" patterns that look flaggable but are explicitly excluded (e.g., a formatting quirk, a migrations file). Request AI review.
Score it like a classifier.
Iterate to threshold, then run a clean-PR control. Repeat with the second test PR (different seedings) until you hold ≥4/5 recall with ≤30% noise. Then run the reviewer on a genuinely clean PR — it should produce at most 1–2 comments. A bot that always finds something trains people to ignore it.
Ship with a feedback loop. Merge the instructions file; tell the team the rule set is a PR-reviewable artifact — anyone can propose a rule change like any code change. Re-score quarterly or when the tool ships model updates, using the same seeded-PR method.
Treat the AI reviewer as a classifier you own: seeded-PR recall and precision, measured before rollout and after every rule change. "Configured once, trusted forever" is how teams end up ignoring the bot.
.github/copilot-instructions.md plus per-path instruction files; org policy can enforce firewalled review for private code..coderabbit.yaml with path_instructions for per-directory rules and tone_instructions; free on public repos makes it good practice ground.