The cheapest review comment is the one a human never has to write. A pre-review AI pass — run after you think the PR is done, before you request reviewers — catches the nits, the debug leftovers, the missing test, and the vague description that otherwise cost a full review round-trip.
Tier: Foundation · Workflow area: Code Review
Teams like Shopify formalized this as an automated "first reviewer" pattern; you can get most of the benefit with any assistant today.
Skip for one-line changes and mechanical bumps where review is a formality.
git diff main...HEAD (or the PR's Files Changed view).Generate the diff and self-review context.
git diff main...HEAD > /tmp/pr.diff
git log main...HEAD --oneline
Run the adversarial pass. Feed the diff with a prompt that asks for review findings, not praise:
Act as a strict senior reviewer on this diff. The intent of the change:
[1-2 sentences]. Report ONLY:
1. Bugs or behavior changes beyond the stated intent
2. Debug leftovers: prints, commented code, TODO, dead flags, stray files
3. Missing or weakened tests for changed logic (name the uncovered path)
4. Error-handling gaps: swallowed exceptions, unchecked returns, missing
timeouts on new I/O
5. Naming/API choices a reviewer would question, with the question they'd ask
Format: file:line — finding — severity (blocker/should-fix/nit).
No compliments, no summaries of what the code does.
Triage findings like review comments. Fix blockers and should-fixes; consciously reject bad nits (models over-flag style). For each rejected finding, know why — if you cannot articulate why it is wrong, it probably is not.
Attack your own tests. Second prompt, same session:
Now look only at the tests in this diff. For each changed behavior, tell me
which test would fail if I reverted that behavior. List changed behaviors
with NO such test. Flag any assertion that is weaker than it looks
(assertTrue on non-empty, broad exception catches, snapshot-everything).
This is the highest-yield step: untested changed behavior is the #1 thing human reviewers catch late.
Generate the PR description last, from the final diff.
Write a PR description from this diff: (1) what & why in 3 sentences,
(2) notable decisions and alternatives rejected, (3) how it was tested
(I will fill in evidence), (4) risks and rollout notes. Do not invent
test evidence — leave TODO markers where I must attach proof.
Attach real evidence at the TODOs (test output, screenshots, benchmark numbers) — an invented "Tested manually" line destroys reviewer trust permanently.
Request human review. In the PR, note that an AI pre-pass ran — it tells reviewers the nit layer is already handled and focuses them on design.
The pre-review pass raises the floor of your PRs; it does not replace the human who checks the design. Fix the nits so humans can spend their attention on what matters.
review my branch against main as a strict reviewer...); it can also execute the test-gap check by actually running the suite.grep -nE "console\.log|print\(|debugger|TODO" $(git diff main...HEAD --name-only) is clean or intentional).