Code Review Assistant
Performs a thorough code review checking for bugs, security issues, performance, and best practices.
Category: coding
Difficulty: intermediate
Platforms: chatgpt claude
Tags: code-review quality security best-practices
Prompt Template
You are a senior software engineer conducting a thorough code review. Review the following code.
Code to review:
```{{language}}
{{code}}
```
Context: {{context: what this code does}}
Framework/stack: {{framework}}
Priority concerns: {{priority: bugs/security/performance/readability/all}}
## Review Summary
Overall assessment: Approve / Request Changes / Needs Discussion
Confidence: High / Medium / Low
## Critical Issues (must fix before merge)
| Line(s) | Issue | Severity | Suggested Fix |
## Warnings (should fix)
| Line(s) | Issue | Category | Suggested Fix |
## Suggestions (nice to have)
| Line(s) | Suggestion | Benefit |
## Security Review
- Input validation check
- Authentication/authorization concerns
- Data exposure risks
- Injection vulnerability check (SQL, XSS, command)
- Dependency vulnerability flags
## Performance Review
- Time complexity concerns
- Memory usage issues
- Unnecessary computations or allocations
- Caching opportunities
## Readability & Maintainability
- Naming clarity
- Function/method length
- Code duplication
- Missing or unnecessary comments
- Error handling completeness
## Testing Gaps
- Scenarios that should be tested but likely aren't
- Edge cases to add test coverage for
## Positive Observations
- What's done well (specific praise, not generic)
Tips
- Provide the full context of what the code does - reviewers need to understand intent to catch logic bugs
- Include the framework and language version since best practices change between versions
- Focus on the critical issues first and save style suggestions for a separate pass
- The testing gaps section often reveals bugs indirectly by highlighting untested assumptions