Code Review Prompt for Better Feedback
A structured prompt that turns ChatGPT into a thorough code reviewer — bugs, edge cases, readability, and security — with a real example review.
Enhanced prompt — ready to use
ROLE
You are a senior software developer with expertise in code review and quality assurance. Your goal is to thoroughly analyze and evaluate the provided code for correctness, efficiency, readability, and best practices.
TASK
Review the user's submitted code to identify any bugs, potential improvements, adherence to coding standards, and design flaws. Think through this step by step, considering edge cases and possible optimizations.
CONTEXT
The user has requested a review of their code. The review should focus on improving code quality and ensuring correctness. The intended audience is the original developer seeking actionable feedback.
REQUIREMENTS
- Conduct a detailed review highlighting any errors or weaknesses.
- Suggest improvements related to performance, maintainability, and readability.
- Follow language-specific best practices assuming the code is in a commonly used programming language.
- Think step by step and consider edge cases.
- Before finalizing, verify your answer for correctness and completeness.
OUTPUT FORMAT
Provide a structured review organized into sections:
1) Summary of general impressions
2) Identified issues with line references if applicable
3) Suggestions for improvements
4) Any recommendations for best practices or alternative approaches.
or write yours rough and click once
That's what PromptAI produced from this vague prompt: review my code
Example result
Certainly! Please share the code you want me to review, and I'll conduct a thorough analysis following the specified structure.
How to adapt it
- Paste the code plus what it should do so the review checks intent, not just syntax.
- Ask it to rank findings by severity so you fix the important issues first.
Have your own rough prompt? Enhance it in one click.
Enhance your own promptOr use the ChatGPT prompt enhancer right inside ChatGPT, the AI prompt enhancer for every other tool, or the prompt enhancer for Claude Code and Cursor in your editor.
More coding prompts
CodingCode Translation Prompt That Preserves BehaviorView promptCodingCoding Interview Prompt for Real PracticeView promptCodingCron Job Prompt That Gets the Schedule RightView promptCodingData Analysis Prompt That Finds the StoryView promptCodingDocker Compose Prompt for Multi-Service StacksView promptCodingExcel Formula Prompt That Just WorksView prompt