Prompt Engineering Code Review AI Code Review

Code Review Prompt — the Review Contract

"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.

Overview

The difference between a useless AI review and a useful one is the contract: what to look for, how to report it, and what verdict to end with. This setup loads the baseline contract — a correctness review of a complete file with the twelve-check correctness checklist, the four-level severity standard ([CRITICAL] through [NIT], severity reflecting impact not effort), findings-only output with exact locations, and a verdict rule. It's the template every other review on this site specializes from.

How to use this resource

  1. Generate once, reuse per review

    The contract is the standard; paste each file or diff into the code slot and every review comes back in the same shape.

  2. Read findings by severity

    CRITICAL first — the grouping rule means the things that block merge are always at the top.

  3. Hold the AI to the verdict rule

    "Base the verdict only on the findings listed" — no vibes-based approvals.

Why This Works

  • A checklist the AI must work through beats an open-ended "look for problems"
  • Severity tagging turns prose into a triageable review
  • Findings-only output cuts the praise padding that hides real issues

Best for

  • Developers using chat AIs as a second reviewer
  • Teams that want review consistency across members and models
  • Anyone tired of "looks good, consider adding comments" reviews

Not for

  • Making the AI rewrite the code — that's the Refactor Prompt Builder (review judges, refactor changes)
  • A persistent reviewer persona — that's a System Prompt (SPG); this is a per-review task contract

Use cases

  • Getting findings with severities instead of vague observations
  • Standardizing what every AI review must check and report
  • Ending every review with a defensible verdict

FAQ

How does the AI code review prompt decide a finding's severity?

Each finding gets exactly one tag, [CRITICAL], [MAJOR], [MINOR], or [NIT], and the SEVERITY RULES specify that severity reflects impact, not effort to fix: CRITICAL means bugs, vulnerabilities, or data loss that must be fixed before merge. Findings group CRITICAL-first. The code-review-prompt-generator produces this contract; you paste it into your own assistant and still validate each finding yourself.

Will this prompt rewrite my code or just review it?

Review only. The REVIEW OBJECTIVE states "report findings; do not rewrite the code", and the output is findings-only with an exact line, function, or symbol cited for each. It ends with a FINAL VERDICT (APPROVED, APPROVED WITH COMMENTS, or CHANGES REQUIRED) based only on the listed findings. The notFor routes actual rewrites to the Refactor Prompt Builder.

What does the twelve-item checklist force the AI to actually verify?

It walks twelve concrete items: boundary input validation, edge cases (empty, zero, negative, maximum), off-by-one errors, null handling before dereference, propagated vs swallowed errors, awaited async, race conditions, checked return values, intentional coercions, comparison boundaries (< vs <=), dead code, and whether the code does what its name claims. The generator writes it; only failing items get reported, and you confirm each against your file.

More resources from Code Review Prompt Generator

Resources that pair well

Related tools

Projects that use this resource

Workflows that use this resource

Tip: Save time by exploring related resources and tools that integrate with this resource.