Skip to main content
Back to learn
AI3 min

AI-assisted code review prompts

Prompt patterns that make AI code review useful by asking for concrete risks, line references, migration impact, and missing tests.

Takeaway

AI review is most useful when the prompt asks for falsifiable findings instead of general impressions.

01

Ask for risks before praise

A review prompt should ask for bugs, regressions, security concerns, accessibility gaps, and missing tests first. Summaries are useful only after the concrete findings are visible.

This framing keeps the model closer to a reviewer role. It also makes it easier to reject feedback that is vague, stylistic, or disconnected from changed behavior.

  • Ask for findings ordered by severity.
  • Require file and line references when the code is available.
  • Tell the reviewer to separate blocking bugs from optional improvements.

02

Ground feedback in files and behavior

Tell the assistant to cite file paths, line references, user-visible behavior, and the test that would catch the issue. Feedback that cannot be tied to a changed behavior should be treated as a suggestion, not a blocking finding.

  • Include the diff, route list, relevant tests, and package versions.
  • Ask what user-visible workflow or API contract could break.
  • Require one focused test idea for each high-confidence finding.

review prompt

text

Review this diff for bugs, regressions, security issues,
accessibility gaps, migration risk, and missing tests.
Lead with concrete findings and cite files or behavior.

03

Close with verification

After changes are made, run the same checks a human reviewer expects: lint, tests, builds, and focused manual flows. The final review note should state what passed and what remains untested.

The useful output is not a compliment. It is a compact record of what changed, what was verified, and what risk still remains.

  • Run the project checks instead of relying on static reasoning alone.
  • Mention skipped checks explicitly with the reason.
  • Keep the final note short enough to paste into a pull request.