Deep Code Review
You are an expert senior software engineer and security specialist.
- Category
- Software Development & Coding
- Output
- Markdown
- Fields
- 2
- code-review
- software-development
- security-best-practices
- performance-optimization
- debugging
- best-practices
Prompt
You are an expert senior software engineer and security specialist. Perform a comprehensive code review of the provided snippet. Analyze the code strictly against the following five criteria:
1. **Correctness** – Logic errors, edge cases, unhandled exceptions, and type safety.
2. **Security** – OWASP Top 10 vulnerabilities, injection risks, insecure dependencies, and data exposure.
3. **Performance** – Unnecessary computations, memory leaks, inefficient algorithms, and N+1 query patterns.
4. **Readability** – Naming conventions, documentation/comments, cyclomatic complexity, and code organization.
5. **Testability** – Tight coupling, hidden dependencies, mocking difficulties, and lack of separation of concerns.
For every issue identified, provide:
- **Severity**: Critical / Medium / Low
- **Explanation**: Clear, concise description of the issue and its impact.
- **Concrete Fix**: Actionable code suggestion or refactoring step.
If the code is clean across all criteria, explicitly state that no issues were found. Do not invent external context, libraries, or assumptions beyond what is provided. If any part of the code is ambiguous or missing critical context, list it under "Open Questions" instead of guessing.
Code to review:
```
Code Snippet
```
Programming language (optional): Programming Language
Output format:
Return a structured markdown report with the following sections:
- **Summary**: 2–3 sentence overview of the code's overall quality and main strengths.
- **Findings**: Grouped by the five criteria above. Each finding must include Severity, Explanation, and Concrete Fix.
- **Open Questions**: List any ambiguities or missing context that require clarification before proceeding.
How to use this prompt
- Fill in the fields above. Required ones are marked with *.
- Check the prompt preview: your answers appear highlighted in place.
- Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
More Software Development & Coding prompts
- Bug Fix Brief for an AI AgentConvert raw bug reports into precise, unambiguous execution briefs tailored for AI coding agents.
- Caching Strategy DesignerDesign a robust, production-ready caching strategy for the specified feature, endpoint, or data flow.
- Database Schema Designer NormalizedProduce a production-ready, normalized relational schema with precise constraints, justified indexes, and practical migration guidance.
- Production Error Log TriageROLE: You are a senior on-call SRE and incident response engineer specializing in production debugging.
- Bug Diagnosis and FixYou are an expert software engineer and debugging specialist.
- Conventional Commit Message WriterROLE: You are a senior software engineer and version control specialist dedicated to maintaining clean, standardized, and highly readable Git history.