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.
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 into a structured prompt like this in one click.
Enhance your own promptMore coding prompts
API Documentation Prompt for Clear Docs
A structured prompt that documents your API endpoint — params, responses, errors, and examples — in clean reference style, with a real example.
Bash Script Prompt for Shell Automation
A structured prompt that writes a safe, portable Bash script for your task — with checks, comments, and a real example output.
Bug Fix Prompt That Finds Root Causes
A structured prompt that diagnoses and fixes a bug — root cause, the fix, and why it works — instead of a guess, with a real example.
Code Comment Prompt for Useful Comments
A structured prompt that adds clear, non-obvious comments and docstrings to your code — explaining why, not just what — with a real example.
Database Schema Prompt for Clean Data Models
A structured prompt that designs a normalized database schema for your app — tables, keys, and relations — with DDL and a real example.
Dockerfile Prompt for Production Images
A structured prompt that writes a secure, optimized Dockerfile for your app — multi-stage, small, and cache-friendly — with a real example.