PannKs
UsefulTools & notes

Library

OverviewShort links
Prompts5
  • Code Review Partner
  • Bug Report Rewriter
  • SEO Blog Outline
  • Commit Message Writer
  • UI Microcopy Rewriter
How To4
← All Prompts

Code Review Partner

Turns an AI into a senior reviewer that reports real defects with a failure scenario, instead of praising your diff.

tags
devcode-reviewquality
model
any
updated
2026-08-17
prompt.txt
You are a senior engineer reviewing a pull request. Be direct. Do not praise.

Review this diff for:
1. Correctness bugs — wrong output, crash, race, off-by-one, unhandled error path
2. Security — injection, auth bypass, leaked secrets, unsafe deserialization
3. Reuse — logic that already exists elsewhere in the codebase
4. Simplification — code that does the same job with fewer moving parts

Rules:
- Report a finding ONLY if you can state a concrete failure scenario:
  specific inputs or state, and the wrong result they produce.
- If you cannot write that scenario, drop the finding. Silence beats noise.
- Ignore formatting and naming unless they change behaviour.
- Rank findings most severe first. Max 7.

For each finding output exactly:
FILE:LINE — [severity: high|medium|low] one-sentence defect
WHY IT BREAKS: inputs/state -> wrong result
FIX: the smallest change that removes the defect

Language/stack: {{language_or_stack}}
Context the diff assumes: {{context}}

Diff:
```
{{paste_diff_here}}
```

Loading…

Older →Bug Report Rewriter
Buy Me A Coffee

v.4.0.0 | Created By Next.JS 16.3.1

Pann Kaansadich © 2026

When to use

Before you open the PR, or when a review came back with nothing but "LGTM 👍". The rule that carries the weight is the failure-scenario gate — it is what stops a model from inventing plausible-sounding issues that do not exist.

Fill in

  • {{language_or_stack}} — e.g. TypeScript / Next.js App Router
  • {{context}} — anything the diff relies on but does not show: which function is only called from a cron job, what is already validated upstream
  • {{paste_diff_here}} — output of git diff main...HEAD

Example

Input diff

function getDiscount(user, cart) {
  const rate = user.tier === "gold" ? 0.2 : 0.1;
  return cart.total * rate;
}

What comes back

cart.js:2 — [severity: medium] Discount is applied to a total that may be undefined. WHY IT BREAKS: an empty cart built by createCart() has no total key, so undefined * 0.1 returns NaN, and NaN is written to the order record instead of 0. FIX: return (cart.total ?? 0) * rate;

Two findings dropped for lack of a scenario: the tier string comparison and the missing JSDoc. That is the point.