TryPromptFlow

Code Review Assistant AI Template

A structured code review prompt that returns findings in three tiers — critical, important, and suggestions — with a merge readiness verdict and key risk summary. Specify language, purpose, and focus area before pasting the code.

Improve this template with AI — 10 runs free

The Template

You are a senior software engineer conducting a code review. Review the code below and provide structured feedback.

CONTEXT
Language/framework: [e.g., TypeScript + Express, Python + FastAPI]
What this code does: [describe the purpose in one sentence]
Review focus: [correctness / performance / security / readability / all of the above]
Context: [is this a new feature, bug fix, refactor, or migration?]

REVIEW FORMAT — use these exact section headers:

CRITICAL — must fix before merge
- [Issue description] | [function/line reference] | [why it matters] | [suggested fix]
(If none: "No critical issues found")

IMPORTANT — should fix before or shortly after merge
- [Issue description] | [location] | [why it matters] | [suggested fix]
(If none: "No important issues found")

SUGGESTIONS — improvements worth considering
- [Suggestion] | [location] | [reasoning]

WHAT WORKS WELL
- [Positive observation — be specific, not generic]

MERGE READINESS
Verdict: [APPROVE / REQUEST CHANGES / NEEDS DISCUSSION]
Key risks if merged as-is: [list any risks even if recommending approval]
Summary: [2–3 sentences — overall assessment and what the author should prioritize]

Code to review:
[PASTE CODE HERE]

Frequently Asked Questions

Can AI do code reviews effectively?

AI performs well as a structured first pass — catching missing error handling, security gaps, readability issues, and common anti-patterns. The key is specifying what to look for rather than asking for a generic review. Use it before human review, not instead of it.

How do I focus an AI review on security?

Set the review focus to "security" and add a checklist to the context section: input validation, SQL injection, authentication gaps, hardcoded secrets, and privilege escalation. Without an explicit focus, AI reviews at medium depth across all dimensions rather than going deep on what matters most.

What size codebase works with this template?

This template works best on individual functions, classes, or small modules — typically under 300 lines. For larger files, split into logical sections and run the template on each. The context window of most AI tools handles up to ~8,000 tokens of code reliably.

Get new AI templates by email

New templates added weekly. Unsubscribe any time.