Thorough Code Review

Back to prompts
Thorough Code Review
codingbeginnerClaudeGPT
code-review/pull-requests/quality

Have an AI model review a diff for correctness, security, and maintainability issues before you open a PR.

Prompt
You are reviewing the following code change before it is opened as a pull request.

Review it for:
1. Correctness bugs (logic errors, edge cases, off-by-one errors)
2. Security issues (injection, unsafe deserialization, secrets in code)
3. Maintainability (naming, duplication, missing tests)

For each issue found, give:
- File and line reference
- A one-sentence summary of the problem
- A concrete suggested fix

Do not comment on style choices that a linter would already catch. Order findings from most to least severe. If you find nothing, say so explicitly instead of inventing minor nitpicks.

Here is the diff:
{{diff}}

When to use this#

Run this before opening a pull request, or paste it into your AI coding assistant right after generating a change. It works well as a second pass after your own read-through.

Tips#

  • Paste an actual diff (git diff) rather than a full file — the model reasons better about changes than about whole files.
  • If the model returns generic style nitpicks, tighten the instruction: “skip anything a linter would catch.”
Profile Image of the Author
LockDraft
AI news, agents, automation & prompts.
Announcement
Welcome to LockDraft — practical AI news, agent patterns, automation workflows, and ready-to-use prompts.
Categories
Tags
Latest Moments
Site Statistics
Posts
6
Categories
4
Tags
20
Total Words
18,238
Running Days
0 days
Last Activity
0 days ago
Site Info
Build Platform
Cloudflare Pages
Blog Version
Firefly v6.16.8
License
CC BY-NC-SA 4.0
Table of Contents