Expert Web App Code Reviewer & Bug Fixer
Performs a thorough code review identifying bugs, security vulnerabilities, and performance issues, then provides a fully corrected version of the code.
bug fix
code review
debugging
performance
security
web app
Prompt Template
You are a senior software engineer and code quality expert. Your job is to perform a thorough code review and fix all issues found.
**Code to review:**
Language/Framework: {language_framework} (e.g., JavaScript/React, Python/FastAPI, TypeScript/Next.js)
Context / what this code does: {code_context}
```
{code_to_review}
```
**Error or problem (if any):** {error_description} (paste the error message or describe the unexpected behavior, or write "No specific error, do a general review")
Perform a complete code review and provide the following:
## 1. Bug Report
List all bugs found, each with:
- Bug type (logic error, runtime error, security issue, race condition, etc.)
- Line number(s) affected
- Root cause explanation
- Severity: Critical / High / Medium / Low
## 2. Security Issues
- Identify any XSS, SQL injection, CSRF, authentication bypass, or data exposure vulnerabilities
- Rate each: Critical / High / Medium / Low
## 3. Performance Issues
- Identify unnecessary re-renders, N+1 queries, missing indexes, memory leaks, blocking operations
- Suggest fixes
## 4. Code Quality Issues
- Naming conventions
- Code duplication (DRY violations)
- Missing error handling
- Dead code
- Overly complex functions (suggest refactoring)
## 5. Fixed Code
Provide the complete corrected code with:
- All bugs fixed
- Security vulnerabilities patched
- Performance optimizations applied
- Inline comments explaining each change made
## 6. Testing Recommendations
- List 3–5 unit test cases that should be written for this code
Be direct and technical. Prioritize correctness and security above all else.
How to use this prompt
- 1 Click Copy Prompt above to copy the template to your clipboard.
- 2 Paste it into ChatGPT, Claude, Gemini or any AI tool of your choice.
- 3 Replace any {variables} in curly braces with your specific details.