Code Review Prompt — the Review Contract
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
Mentoring-style maintainability review: what makes the next change expensive, explained with corrected examples — teach, don't just judge.
Legacy code review has a different goal: not gatekeeping a merge, but building a map for gradual cleanup — and teaching the developer doing it. This setup runs the maintainability focus (duplication that drifts, intent-hiding names, cohesion, coupling, dead code, test coverage of what changes) under Mentoring style: every finding explains WHY it matters, CRITICAL and MAJOR findings come with short corrected examples, and the review ends with the three most important things to learn — not a verdict to fear.
Review before you change anything
The maintainability map tells you where changes will be expensive — before you're mid-change and finding out.
Use the corrected examples as patterns
Mentoring style shows the fix shape for major findings — apply the pattern, not just the instance.
Hand the top-three learnings to the team
The closing learnings generalize beyond this module — that's the compounding value.
It reviews only. The REVIEW OBJECTIVE states "Review only — report findings; do not rewrite the code," so the generated prompt asks your assistant for maintainability findings and, for CRITICAL or MAJOR items, a short corrected example to learn from — not an applied refactor. You still run the prompt and act on the findings yourself.
By design the FINAL VERDICT asks for "the three most important things to learn from this review" rather than a gate. The Mentoring framing treats old code as a cleanup map, so it deliberately doesn't block a merge — every finding explains why it matters instead of issuing a verdict to fear.
Every finding gets exactly one of [CRITICAL], [MAJOR], [MINOR], or [NIT], and the SEVERITY RULES state severity reflects impact, not effort to fix. Findings group by severity with CRITICAL first, giving a defensible priority order — but the tags are the model's judgment in the prompt output, which you confirm against the actual code.
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
Twelve security checks — injection, auth, secrets, SSRF, privilege escalation — reviewed the way an attacker would read the code.
Architecture review for the public surface: abstractions that earn their place, dependency direction, seams, and the patterns the codebase already has.
"Refactor this code" invites silent behavior changes. The refactoring contract preserves business rules, outputs, and side effects — and flags uncertainty instead of deciding it.
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
A side-by-side way to decide between two ChatGPT prompt drafts — scored on clarity, specificity, output control, and risk instead of gut feeling.
Generate code review prompts for any scope — snippet, file, diff, or full pull request — with focused review rules.
Update old, risky code you didn't write — safely — by understanding and pinning its behavior in tests before you change a single line.