Code review prompt: findings by severity, with evidence
A useful code review lists the problems that matter first, points to the exact code, and does not pad the answer with praise or style quibbles. The Code review recipe asks the AI to act as a senior engineer and review your code or technical plan for bugs, regressions, security risks and missing tests. Findings come ordered by severity with concrete evidence, followed by a brief summary. Paste the code, say what it should do and what kind of review you want, and you receive a checklist you can work through. It complements human review and does not replace it.
Open this recipe in the builder
Before and after
Most people type something like this:
review my code
The AI will likely comment on style and naming and may miss problems that matter for a checkout function.
What the built prompt adds
- The context says what the function should do, apply a discount code and return the new total, and that it runs on a web server in Python.
- The AI takes the role of a senior software engineer and the action focuses on bugs, security risks and missing tests.
- The expectation asks for findings ordered by severity with concrete evidence, so you can tell which ones to fix first.
Here is the full prompt Prompertize builds from the example details below.
Copy-ready example prompt
Generated by the Prompertize builder from the example inputs below. Select the text and copy it, or open the recipe in the builder to use your own details.
## FRAMEWORK
RACE
## ROLE
Senior software engineer
## ACTION
Review the supplied code or technical plan for bugs, regressions, security risks, and missing tests.
## CONTEXT
Review the function below, which should apply a discount code at checkout and return the new total. Focus on bugs, security issues and missing tests. The language is Python and the code will run on a web server. Code: def apply_discount(total, code, codes): if code in codes: return total - total * codes[code] / 100 else: return total
## EXPECTATION
Lead with findings ordered by severity, cite concrete evidence, and keep summaries brief.
## GUARDRAILS
Do not fabricate facts. If information is missing, say what is missing.
Stay within the scope of the request and the provided context.
Respect the requested audience, style, tone, and response format.
Example inputs used
- context
- Review the function below, which should apply a discount code at checkout and return the new total. Focus on bugs, security issues and missing tests. The language is Python and the code will run on a web server. Code: def apply_discount(total, code, codes): if code in codes: return total - total * codes[code] / 100 else: return total
Saving tokens
Efficiency modes trim the generic boilerplate from a prompt, but any safety or guardrail wording you have set stays as written. The numbers below are rough estimates for this one example, counting the prompt only (not the reply). The Standard version above is about 210 tokens.
Lean: about 167 tokens (43 fewer than Standard)
Role: Senior software engineer
Action: Review the supplied code or technical plan for bugs, regressions, security risks, and missing tests.
Context: Review the function below, which should apply a discount code at checkout and return the new total. Focus on bugs, security issues and missing tests. The language is Python and the code will run on a web server. Code: def apply_discount(total, code, codes): if code in codes: return total - total * codes[code] / 100 else: return total
Expectation: Lead with findings ordered by severity, cite concrete evidence, and keep summaries brief.
Guardrails: Do not invent facts; say what is missing.
Answer first. No preamble.
Open this recipe in the builder with Lean
Ultra: about 162 tokens (48 fewer than Standard)
Role: Senior software engineer
Action: Review the supplied code or technical plan for bugs, regressions, security risks, and missing tests.
Context: Review the function below, which should apply a discount code at checkout and return the new total. Focus on bugs, security issues and missing tests. The language is Python and the code will run on a web server. Code: def apply_discount(total, code, codes): if code in codes: return total - total * codes[code] / 100 else: return total
Expectation: Lead with findings ordered by severity, cite concrete evidence, and keep summaries brief.
Rules: No invented facts; flag gaps.
Be brief: answer only.
Why this works
A senior-engineer role and a severity order bring the serious issues to the top, where you see them first.
Requiring concrete evidence means each finding points to a line or behavior you can verify.
A focus on tests and security covers areas that a quick read tends to skip.
Customize it for ChatGPT, Claude and Gemini
ChatGPT
Ask it to write the failing test for each bug it reports. This proves the finding and gives you a regression test.
Claude
Paste the surrounding code and a short description of how the function is called. Claude uses the context to avoid false alarms.
Gemini
Ask Gemini to separate confirmed bugs from risks that depend on how the code is used, so you triage them differently.
Common mistakes
- Pasting secrets, API keys or customer data. Remove them first, or use the builder's scrub tools.
- Treating the review as complete. AI can miss issues and report ones that are not real, so run your tests and tools.
- Giving no context. Say what the code should do, the language and runtime, and what kind of input it will see.
Frequently asked questions
Can it replace a human reviewer?
No. It is a useful extra pair of eyes, but a person who knows your system should still review important changes.
Is it safe to paste company code?
Check your employer's policy first. The builder runs in your browser, but anything you paste into an AI service is subject to that service's own terms.
Does it work for architecture or design plans?
Yes. Describe the plan and the constraints, and ask for risks, missing pieces and alternatives.
Related prompt recipes
- Troubleshoot a problemRISEN · Troubleshooting steps
- Project planRACE · Checklist
- Policy analysisRISEN · Markdown report