Code Review Prompt — the Review Contract
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
Review the change as it will land: cross-file impact, deployment risk, migration safety — plus whether the PR does what its description says.
A pull request is more than its diff: it lands across files, deploys in an order, and sometimes migrates data. This setup runs PR scope — which adds eight change-specific criteria to the correctness review: breaking changes to public contracts, backward compatibility of serialized data, regression risk, hidden coupling between changed files, deployment ordering and rollback, migration compatibility windows, whether the PR is small enough to review honestly, and whether the description matches the actual change.
Paste the full diff, not file-by-file
Cross-file criteria only work when the model sees the files together.
Weigh the compatibility findings first
Breaking-change and migration findings are the ones that hurt after merge — code-style findings can wait.
Check the description-honesty finding
A PR that does more than it says is a review evasion — the contract flags it explicitly.
It adds a Cross-file impact criterion that hunts "hidden coupling between the changed files," plus deployment-ordering and migration-window criteria a per-file pass structurally can't see. Because of that, the workflow tells you to paste the full diff together, not file by file. The generated prompt runs in your own assistant, which does the actual reviewing.
Treat it as a second pair of eyes, not the approval authority. The FINAL VERDICT (APPROVED, APPROVED WITH COMMENTS, or CHANGES REQUIRED) is based only on the findings the model listed, in your own assistant, which can miss things. A human reviewer still owns the merge decision; the verdict informs it rather than replacing it.
A dedicated criterion checks "whether the description matches what the change actually does," and checklist item 12 asks whether the code does what its name and comments claim. The workflow calls a description mismatch a review evasion and flags it, so unrelated changes riding along get tagged with a severity like [MAJOR] rather than sliding through.
"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.
AI-written code usually compiles and passes a quick test while hiding the real risks — a missing auth check, a destructive update, an untested edge case. Here's a review path that surfaces them before you merge.