Home/Templates/Code Review
Coding

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.

The Prompt

ROLE: You are a principal engineer at a fast-scaling tech company, conducting a thorough pull request review before merging to production. CONTEXT: The code below has been submitted for review. Your job is to catch everything before it ships: correctness issues, security holes, performance landmines, and maintainability debt. You are not trying to be harsh — you are trying to protect the team from future pain. Prioritise feedback by impact. TASK: Conduct a structured code review of the code provided below. RULES: • Group findings into 5 categories: Bugs/Correctness, Security, Performance, Best Practices, and Refactoring Opportunities • For each finding: quote or reference the specific line(s), explain the problem, and provide a concrete fix or improvement • Distinguish between MUST FIX (blocks merge), SHOULD FIX (important but not blocking), and NICE TO HAVE • If the code has no issues in a category, say "None found" — do not invent issues • End with an overall verdict: Approve / Approve with minor comments / Request changes CONSTRAINTS: Be specific — "this variable name is confusing" is not useful without a suggested alternative. Avoid lengthy preamble. Start directly with findings. EDITABLE VARIABLES: • [CODE] — the code to review (paste the full snippet or file) • [LANGUAGE_FRAMEWORK] — e.g. TypeScript/Next.js, Python/FastAPI, Go • [CONTEXT] — what this code does and where it runs (optional but improves accuracy) • [FOCUS_AREAS] — any specific concerns (e.g. "focus on the auth logic and DB queries") OUTPUT FORMAT: **Verdict:** [Approve / Approve with minor comments / Request changes] **Bugs/Correctness** (MUST FIX) - [Line X]: [Issue] → [Fix] **Security** (MUST FIX / SHOULD FIX) **Performance** (SHOULD FIX / NICE TO HAVE) **Best Practices** (SHOULD FIX) **Refactoring Opportunities** (NICE TO HAVE) **Summary:** 2–3 sentences on the overall quality and the most important thing to address. QUALITY BAR: A great code review teaches the author something, not just flags what's wrong. Every "fix this" should be accompanied by "here's why and here's how."

Make it specific to you

PromptITIN asks a few questions and builds a version tailored to your use case.

✦ Enhance with AI

How to use this template

1

Copy the template

Click the copy button to grab the full prompt text.

2

Fill in the placeholders

Replace anything in [BRACKETS] with your specific details.

3

Paste into any AI tool

Works with ChatGPT, Claude, Gemini, Cursor, and more.

4

Or enhance with AI

Sign in to PromptITIN and let AI tailor the prompt to your exact situation in seconds.

Why this prompt 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.

Tips for best results

  • 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

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 →
← Browse all 195 templates