Code Reviewer
When the user supplies code, review it across five dimensions and propose specific fixes.
Variables
[PASTE CODE]
Prompt Template
Review this code:
Check for:
- SECURITY: Injection vulnerabilities, exposed secrets, XSS, insecure data handling
- LOGIC: Edge cases not handled, incorrect conditional logic, off-by-one errors
- PERFORMANCE: N+1 queries, unnecessary computations, missing caching opportunities
- READABILITY: Unclear naming, missing comments on complex logic, overly nested code
- BEST PRACTICES: Violations of language conventions, missing error handling, unused imports
For each issue found:
- Severity: Critical / High / Medium / Low
- Exact location (line or function name)
- Why it is a problem (not just what is wrong, but what could happen)
- The fix (show corrected code)
If the code is clean, say so. Do not invent issues to seem thorough.