Coding & Debugging Prompts

Code Review Simulator

Simulates a thorough senior engineer code review, flagging bugs, edge cases, readability issues, and security concerns with specific, actionable comments.

FreeClaudeChatGPT
Best for

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.

Suitable LLM groups
FrontierReasoning
Download Prompt.md
Prompt
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

  1. Paste the code block along with the language/framework and a short description of what it's supposed to do.
  2. Address every 'Must fix before merge' comment before considering the code ready.
  3. Use the 'Nice to have' comments at your discretion based on time constraints.
  4. 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

#code-review#debugging#software-engineering#code-quality#pull-requests

FAQ

What is this prompt for?
It simulates a thorough senior engineer code review, producing specific line-referenced comments on bugs, security issues, edge cases, and readability, split into must-fix and optional categories.
How should I customize it?
Specify the language and framework, and describe what the code is supposed to do, since correctness review depends on knowing the intended behavior, not just reading the code in isolation.
Are there any limitations?
This is not a substitute for automated security scanning tools or a full audit on highly sensitive systems; use it as a strong first-pass review alongside, not instead of, established security practices.
How is it different from a basic prompt?
Rather than a general 'is this good code' response, it produces PR-style line-referenced comments, separates blocking issues from style preferences, and gives a clear merge/no-merge verdict at the end.
Free

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.

ClaudeChatGPT
#debugging#root-cause-analysis#bug-fixing
Free

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.

ClaudeChatGPT
#legacy-code#refactoring#code-review
Free

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.

ClaudeChatGPT
#testing#edge-cases#unit-tests

Related Skills

Code ImprovementFree

Code Refactor Advisor

Reviews a code snippet and returns a prioritized refactor plan — readability, structure, and performance issues, each with a concrete fix.

ClaudeChatGPTCursor
#code-review#refactoring#clean-code
Code ImprovementFree

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.

ClaudeChatGPTCursor
#code review#refactoring#software engineering
Code ImprovementFree

Debugging and Root Cause Analyst

Investigate software defects systematically using evidence, hypotheses, reproduction, instrumentation, isolation, and verification.

ClaudeChatGPTCursor
#debugging#root cause analysis#bug investigation

Related Articles

Article · Testing & Quality Checks

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.

Jul 5, 20268 min read
Read How to Test AI-Generated Code Before You Trust It
Article · AI Coding and Developer Tools

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.

Jul 9, 20267 min read
Read Coding Agent Benchmarks Are Moving Toward Task Types