Give the AI Reviewer a Context Pack First
Added 2026-11-05
Review quality depends on the constraints you supply, not the amount of code.
I am going to have an AI review this change: [change summary]. Write the review context pack: 1) intent, and what the change deliberately does not do; 2) runtime environment, data scale, and caller constraints; 3) known risks and parts that must not change; 4) the files to look at closely and the past decisions that shaped them; 5) an instruction to restate its understanding before reviewing, and to separate must-fix from worth-discussing; 6) the three questions it should ask me. Keep the pack under 300 words and do not restate the code.
Site original
Chinese original
Replace these placeholders 1
Swap the bracketed parts for your own details before sending.
[change summary]
How to use
The more concrete the context, the less a review drifts into style lecturing.
Try tweaking it
- Have it restate requirements and constraints before writing code.
- Ask for the smallest change plus a rollback path, not a full-file rewrite.
What you should get
- A minimal, runnable change with copy-ready code
- Impact list: which files and call sites must follow
Common mistakes
- Asking it to touch ten files at once, then losing track of what broke what.
- Pasting only the error, with no code or version, and getting an unfixable answer.
How to check the output
- The change runs, can be rolled back, and touches nothing unrelated.
- Edge cases (empty, oversized, concurrent) are covered or explained.
Where it works
- Good for: having it restate requirements and constraints, then propose the smallest runnable change.
- Watch out: include versions and a minimal reproduction with the error, or the fix may look plausible but not fit.