Security Code Review Prompt
Twelve security checks — injection, auth, secrets, SSRF, privilege escalation — reviewed the way an attacker would read the code.
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
The difference between a useless AI review and a useful one is the contract: what to look for, how to report it, and what verdict to end with. This setup loads the baseline contract — a correctness review of a complete file with the twelve-check correctness checklist, the four-level severity standard ([CRITICAL] through [NIT], severity reflecting impact not effort), findings-only output with exact locations, and a verdict rule. It's the template every other review on this site specializes from.
Generate once, reuse per review
The contract is the standard; paste each file or diff into the code slot and every review comes back in the same shape.
Read findings by severity
CRITICAL first — the grouping rule means the things that block merge are always at the top.
Hold the AI to the verdict rule
"Base the verdict only on the findings listed" — no vibes-based approvals.
Each finding gets exactly one tag, [CRITICAL], [MAJOR], [MINOR], or [NIT], and the SEVERITY RULES specify that severity reflects impact, not effort to fix: CRITICAL means bugs, vulnerabilities, or data loss that must be fixed before merge. Findings group CRITICAL-first. The code-review-prompt-generator produces this contract; you paste it into your own assistant and still validate each finding yourself.
Review only. The REVIEW OBJECTIVE states "report findings; do not rewrite the code", and the output is findings-only with an exact line, function, or symbol cited for each. It ends with a FINAL VERDICT (APPROVED, APPROVED WITH COMMENTS, or CHANGES REQUIRED) based only on the listed findings. The notFor routes actual rewrites to the Refactor Prompt Builder.
It walks twelve concrete items: boundary input validation, edge cases (empty, zero, negative, maximum), off-by-one errors, null handling before dereference, propagated vs swallowed errors, awaited async, race conditions, checked return values, intentional coercions, comparison boundaries (< vs <=), dead code, and whether the code does what its name claims. The generator writes it; only failing items get reported, and you confirm each against your file.
Twelve security checks — injection, auth, secrets, SSRF, privilege escalation — reviewed the way an attacker would read the code.
Architecture review for the public surface: abstractions that earn their place, dependency direction, seams, and the patterns the codebase already has.
Hunt the broken-access-control bug — review code for missing per-resource checks, IDOR, and 'logged in' mistaken for 'allowed', the vulnerability class that tops the OWASP list.
"Refactor this code" invites silent behavior changes. The refactoring contract preserves business rules, outputs, and side effects — and flags uncertainty instead of deciding it.
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
A side-by-side way to decide between two ChatGPT prompt drafts — scored on clarity, specificity, output control, and risk instead of gut feeling.
Generate code review prompts for any scope — snippet, file, diff, or full pull request — with focused review rules.
The full path from idea to a shipped SaaS MVP — define and scope the requirements, design the architecture, API, and data model, then build it reviewed, tested, secured, cost-controlled, and deployed.
The full path to a backend you can put clients on — define the requirements, design the architecture, API contract, data model, and access control, then build it reviewed, tested, secured, and shipped.
The full path to taming an inherited codebase — understand it, document its architecture, pin its behavior with tests, then refactor, modernize, review, speed up, and ship it without breaking what works.
A complete AI-assisted review pass — not one prompt — that ends with ranked findings, tests guarding behavior, and a refactor plan when one is warranted.
Restructure code you own without breaking it — change only what's worth changing, and prove with tests and a diff that behavior held.
Build a test suite that fails for real reasons, not green decoration — coverage across unit, integration, and edge cases, then a review for the gaps.
Structure a UI so it stays consistent as it grows — inventory the screens, break them into reusable components, specify the component system and its rules, then review the structure for drift.