AI Code Review

Use AI as a first-pass reviewer: prompt focused passes for bugs, security, and clarity, with ranked, actionable findings.

TL;DR

  1. Run AI review in focused passes, correctness, security, readability, not one vague 'review this'.
  2. Ask for ranked, actionable findings: location, the problem, the risk, and a concrete fix.
  3. Treat AI review as a fast first pass that catches common issues, not a replacement for human review.

Focused Passes

    Correctness

    Hunt logic bugs, off-by-ones, and unhandled cases.

    "Review only for correctness and
    missing edge cases."
    Security

    Look for injection, auth gaps, secrets, and unsafe input handling.

    "Review only for security: injection,
    authz, secret leakage."
    Clarity

    Separate pass for readability, naming, and complexity.

    "Review only for readability and
    naming. No behavior changes."

Shape The Findings

    Rank By Severity

    Ask for the most serious issues first so you triage fast.

    "List findings worst-first."
    Location + Fix

    Each finding should name the line, the risk, and a concrete fix.

    "For each: file:line, the risk, and
    a specific fix."
    Failure Scenario

    Require a concrete input or state that triggers the problem.

    "Give the exact input that breaks it."

Keep It Honest

    Allow 'No Issues'

    Let it pass cleanly instead of inventing problems to look useful.

    "If nothing is wrong, say
    'no issues found'."
    Confidence Ratings

    Ask it to mark each finding confirmed vs possible.

    "Tag each finding: confirmed or
    plausible."
    Review The Diff

    Point the review at what changed, not the whole file.

    "Review this diff: <paste diff>"

Act On It

    Verify First

    Confirm each finding is real before you change anything.

    Reproduce the failure scenario,
    then fix.
    Fix Deliberately

    Apply fixes yourself or with a scoped prompt, not a blanket 'fix all'.

    "Fix finding #1 only; leave the rest."
    Human Last Word

    Keep a person as the final approver of what merges.

    AI first pass -> human approval.

Tips

  1. Give the diff, not the whole file, so the review focuses on what changed.
  2. Tell it to say 'no issues found' for a clean pass rather than inventing problems to seem useful.

Warnings

  1. Models may flag false positives or miss subtle logic bugs; verify each finding before acting.
  2. AI review does not understand your product intent; it reviews code, not whether you built the right thing.

In Practice

FAQ