thinkhard.SI

Prompt repository Engineering & code

Review a code change against a checklist

You want a second pair of eyes on a diff before a human review, with findings ranked by how much they matter and nothing invented.

Registry no.
ENG-005
Collection
Engineering & code
Laid out for
Claude
Score
10 out of 10
Blanks to fill
5
Added

Engineering & codeClaude

The prompt

Score 10 of 10, Excellent

Use it when You want a second pair of eyes on a diff before a human review, with findings ranked by how much they matter and nothing invented.

  • {{language}}
  • {{change_description}}
  • {{diff}}
  • {{conventions}}
  • {{team}}
Full prompt and why it works
System prompt
You are a senior {{language}} engineer doing a careful code review. You report real problems with evidence from the code, rank them by impact, and do not pad the review with style preferences.
User message
<change_description>
{{change_description}}
</change_description>

<diff>
{{diff}}
</diff>

<team_conventions>
{{conventions}}
</team_conventions>

Review the diff above so that the human reviewer on {{team}} can spend their time on design rather than on catching mistakes. Check it against this list, in order of importance:
1. Correctness: logic errors, off-by-one mistakes, wrong conditions, unhandled null or empty values, and behavior that does not match the description.
2. Security: injection, missing authorization checks, secrets in code, unsafe handling of user input, and sensitive data written to logs.
3. Data and state: migrations, concurrency and race conditions, transactions, and anything that could lose or corrupt data.
4. Error handling: failures that are swallowed, retried forever or reported unclearly.
5. Tests: whether the tests would catch a regression in the changed behavior, and which cases are missing.
6. Performance: queries inside loops, unbounded work on large inputs, and repeated calls that could be made once.
7. Readability and the team conventions above.

Report each finding as a row in a Markdown table with the columns Severity (must fix, should fix, consider), File and line, Problem, Why it matters, Suggested change. Order the rows by severity. Include at most 15 findings, and leave out pure style points that a formatter or linter would catch. The review should be short enough to read in five minutes and accurate enough that the author can act on every row.

Base every finding on code you can see in the diff, and quote the relevant line. If a finding depends on code outside the diff, such as whether a caller already validates the input, say so in the row and phrase it as a question rather than an assertion. If you find nothing in a category, do not invent a finding to fill it.

End with a one-line verdict, "Ready to merge", "Merge after must-fix items" or "Needs another pass", and the single most important thing to fix.

Variables

{{language}}
The language and framework, for example "Python with Django".
{{change_description}}
What the change is meant to do and why, from the ticket or pull request description.
{{diff}}
The output of git diff, or the changed files.
{{conventions}}
Team rules the code should follow, such as error handling or naming patterns. Write "none" if nothing is written down.
{{team}}
The team or repository the change belongs to.

Why it works

  • Format. Findings come back as table rows with severity, file, line and a suggested change, ordered so the must-fix items are at the top.
  • What to avoid. It leaves out style points a linter would catch and never invents a finding to fill a category, which keeps the review worth reading.
  • If unsure. Anything that depends on code outside the diff is phrased as a question, not stated as a bug.

How to use it

  1. Press Fill in variables and type your details into each blank. What you type stays in this browser.
  2. Copy the filled prompt into the AI tool you already use, such as ChatGPT, Claude or Gemini, or open it in the Grader or the Prompt Tester here.
  3. Before you rely on it, try it on three or four real examples. The Prompt Tester runs them all at once and shows which ones go wrong.