Code review checklist prompt template
Run a focused, prioritised code review of a diff or snippet, covering correctness, edge cases, readability, and security without nitpicking style.
Free to copy3 fill-in variablesWorks with any text-based AI model
Copy the prompt
Keep the instruction intact and replace each double-braced field with your own context.
Code review checklist
Review the following {{language}} code as a senior engineer.
Context: {{context}}
```{{language}}
{{code}}
```
Work through this checklist and report findings, not just observations:
1. Correctness - logic errors, off-by-one mistakes, wrong assumptions.
2. Edge cases - empty inputs, nulls, concurrency, large or malformed data.
3. Error handling - what happens when a call fails or input is invalid.
4. Security - injection, unsafe deserialisation, leaked secrets, missing
authorisation checks.
5. Readability - naming, function length, duplication, unclear control flow.
6. Tests - what is untested and which cases I should add.
Group findings under "Must fix", "Should fix", and "Nice to have". For each,
quote the relevant line, explain the risk in one sentence, and show a concrete
fix. Skip pure style preferences a linter would catch.
Fill in the variables
Use the examples as a shape, not as required wording.
{{language}}- Programming language of the code, used for the fenced blockExample: python
{{context}}- What this code is meant to do and where it runsExample: request handler that charges a customer and emails a receipt
{{code}}- The diff or snippet to reviewExample: def charge(user, amount): stripe.charge(user.card, amount) send_receipt(user.email)
Filled-in example
This shows the template with realistic inputs before it is sent to a model.
Review the following python code as a senior engineer.
Context: request handler that charges a customer and emails a receipt
```python
def charge(user, amount):
stripe.charge(user.card, amount)
send_receipt(user.email)
```
Work through this checklist and report findings, not just observations:
1. Correctness 2. Edge cases 3. Error handling 4. Security 5. Readability 6. Tests
Group findings under "Must fix", "Should fix", and "Nice to have". For each,
quote the relevant line, explain the risk in one sentence, and show a concrete
fix. Skip pure style preferences a linter would catch.
How to use this template
Three checks keep the result useful and grounded in your actual task.
- Give it real context.Replace every variable and remove any instruction that does not apply.
- Run it in your preferred model.The template is plain text, so it works with ChatGPT, Claude, Gemini, and local models.
- Review before you rely on it.Check facts, code, claims, and sensitive information; then save the wording that performed best.