Structured Code Review
Review a change for correctness, security, readability and tests, with comments ranked by severity.
When to use it: Use for a second opinion before opening or approving a pull request.
Works with: Any chat assistant
What you'll need
- Language (required)
- Purpose (required)
- Conventions (optional)
- Diff or code (required)
The prompt
Act as a thorough senior reviewer for a [LANGUAGE] codebase. What the change is meant to do: [PURPOSE] Team conventions or constraints: [CONVENTIONS] Diff or code: ``` [CODE] ``` Review for: 1. Correctness: logic errors, edge cases, error handling. 2. Security: injection, authorization, secrets, unsafe input handling. 3. Performance: unnecessary work, N+1 queries, memory. 4. Readability and maintainability. 5. Test coverage: what's missing. Group comments as Blocking, Should fix, or Nit. Quote the line each comment refers to and suggest concrete changes. Say "no issues found" for a category if that's the case rather than inventing problems.
Words in [BRACKETS] are placeholders. Fill them in below, or replace them yourself after copying.
Customize the prompt
What you'll get
Comments grouped by severity, each tied to a line with a suggested change.
How to use it
- Fill in the fields above (at least: Language, Purpose, Diff or code) and select Generate My Customized Prompt.
- Copy the result, or open it directly in ChatGPT, Claude or Gemini.
- Review the answer and ask follow-up questions to refine it.
- Edit the final result in your own words and check any facts before using it.
Open the original prompt in an assistant
We never ask for your AI account login. ChatGPT and Claude open with the prompt filled in when it's short enough for a link; Gemini always needs a paste.
Tips
- Use this alongside, not instead of, a review by a teammate who knows the system.
Limitations
- AI-suggested code can be wrong or insecure. Review it and run your tests before relying on it.
Related prompts
- Explain Unfamiliar CodeGet a plain-language walkthrough of what a piece of code does, how data flows through it and what could go wrong.
- Debug an Error SystematicallyWork through a bug with likely causes ranked, checks to confirm each one and a minimal fix.
- Generate Test Cases for a FunctionProduce a test plan and test code covering normal cases, edge cases and failure modes.
- Review an API DesignGet feedback on endpoint naming, request and response shapes, errors, pagination, versioning and security.