Code Review Simulator
Simulates a thorough senior engineer code review, flagging bugs, edge cases, readability issues, and security concerns with specific, actionable comments.
Developers who want a rigorous second opinion on their code before opening a pull request, or solo developers who don't have a teammate available for review.
You are a senior engineer conducting a thorough code review. Be direct and specific, the way a good reviewer would be on a real pull request.
Language/framework: {{language_framework}}
Code to review:
{{code_block}}
Context (what this code is supposed to do): {{code_purpose}}
Do the following:
1. Review the code for: correctness bugs, unhandled edge cases, security concerns (e.g., injection risks, unvalidated input, exposed secrets), performance issues, and readability/maintainability problems.
2. Write your feedback as specific, line-referenced comments (the way real PR comments look), not a generic summary. For each comment, state the issue and suggest the fix.
3. Separate your comments into 'Must fix before merge' and 'Nice to have / style suggestion' so I know what's blocking versus optional.
4. End with one sentence on whether you'd approve this code as-is, approve with the must-fix items addressed, or request a larger rework, and why.How to use
- Paste the code block along with the language/framework and a short description of what it's supposed to do.
- Address every 'Must fix before merge' comment before considering the code ready.
- Use the 'Nice to have' comments at your discretion based on time constraints.
- Re-run the review after making changes to confirm the flagged issues are resolved.
Example input
Language: Python/Flask. Code: [an API endpoint handling user file uploads]. Context: Endpoint that lets logged-in users upload profile pictures.
Example output
Line-referenced comments flagging missing file type validation as a must-fix security concern, no file size limit as a must-fix (potential DoS risk), a nice-to-have suggestion to extract the validation logic into a reusable function, a must-fix note about the uploaded filename not being sanitized (path traversal risk), and a final verdict of 'request changes' due to the security issues needing resolution before merge.
Customization tips
- — For security-sensitive code (auth, payments, user data), explicitly ask for extra scrutiny on that dimension.
- — If you're following a specific style guide (e.g., Airbnb, PEP 8, Google style), mention it so style comments are calibrated to that standard.
- — For performance-critical code, ask for Big-O complexity analysis on any loops or recursive logic.
Tags
FAQ
What is this prompt for?
How should I customize it?
Are there any limitations?
How is it different from a basic prompt?
Related Prompts
All Coding & Debugging prompts →Root Cause Bug Investigator
Guides a systematic investigation of a bug from symptom to root cause, avoiding quick patches that mask the real problem, and produces a targeted fix.
Legacy Code Explainer & Refactor Planner
Explains what an unfamiliar or legacy piece of code actually does, then proposes a safe, incremental refactor plan instead of a risky full rewrite.
Edge Case & Test Case Generator
Analyzes a function or feature and generates a comprehensive list of edge cases and corresponding test cases, catching scenarios developers commonly miss.
Related Skills
Code Refactor Advisor
Reviews a code snippet and returns a prioritized refactor plan — readability, structure, and performance issues, each with a concrete fix.
Code Review & Refactor Assistant
Reviews a pasted code snippet for bugs, readability, and performance issues, then delivers a prioritized refactor with explanations for each change.
Debugging and Root Cause Analyst
Investigate software defects systematically using evidence, hypotheses, reproduction, instrumentation, isolation, and verification.
Related Articles
How to Test AI-Generated Code Before You Trust It
Learn how to review and test AI-generated code before using it in production, including functionality, security, edge cases, permissions, and regression checks.
Coding Agent Benchmarks Are Moving Toward Task Types
AI coding agents are becoming measurable in real repositories and workplaces, making review practices and task-specific evaluation essential.