Strict code review of a diff
A review prompt that reports only what would break in production, gives the smallest fix for each finding, and is allowed to say the diff is fine.
Review the diff below as a senior engineer on this codebase.
Only report issues that would break behaviour, leak data or fail in production. Skip style opinions.
For each issue give: the file and line, what breaks, and the smallest edit that fixes it.
If the diff is fine, reply with one line saying so.
--- diff ---
{{diff}}Fill these in
Type your values and Copy gives you the finished prompt, not the template.
Nothing filled in yet - Copy will give you the template with placeholders.
Notes from the author
Keep the last rule. Without a sanctioned way to report nothing, models make up findings to fill the answer. On a small local model, drop that rule and review one file per call, because four constraints at once are too many for it.
For information only, not professional advice. You use it at your own risk and we are not liable for any loss or damage. See the disclaimer.
Worked example
A twelve-line diff adding a user lookup without checking the session owner.
auth/session.php:41 - the lookup uses the id from the request instead of the session, so any logged-in user can read another account. Smallest fix: replace $_GET['id'] with $_SESSION['user_id'].
Tagged