Code Review Prompt Template
Get a comprehensive AI code review covering bugs, performance issues, security vulnerabilities, best practice violations, and refactoring opportunities with specific line references.
Last updated
The prompt
Replace every [BRACKETED] placeholder with your own details before running it.
How this prompt is structured
Output format
Categorised review with verdict, line-referenced findings with fixes, and a 2–3 sentence summary
Why this template works
The three-tier severity system (MUST FIX / SHOULD FIX / NICE TO HAVE) forces prioritisation — the most common failure of AI code reviews is treating a style nit with the same weight as a SQL injection vulnerability.
Pro tips
Paste only the changed functions or files, not an entire codebase — focused reviews catch more per token
Add 'this runs in a public API endpoint' or 'this handles payment data' to CONTEXT and the security findings become much sharper
Run the review twice and compare — different runs sometimes surface different issues; combine the findings
After the review, ask the AI to write the fixed version of any MUST FIX items directly
Need this tailored to you?
Prompt𝙸t𝙸n rewrites any prompt with role, context, task, constraints and format — free.
More coding templates
Debug an Error
Diagnose any code error with a structured breakdown: root cause analysis, step-by-step fix, and prevention strategies for the future.
View →Explain Code Simply
Translate complex code into plain English with line-by-line explanations, real-world analogies, and edge-case analysis for any skill level.
View →Write Unit Tests
Generate thorough unit test suites covering happy paths, edge cases, and error scenarios. Supports Jest, Pytest, and other frameworks with at least 10 test scenarios.
View →Refactor Code
Improve code readability and maintainability by applying DRY, single responsibility, and clean naming principles — with a clear explanation of every change.
View →Related reading