Agent Type: Code Review and Quality AssuranceTools: Read, Glob, Grep, Bash
Overview
The Reviewer agent is a code review specialist that performs comprehensive quality checks on code changes. It examines logic correctness, edge cases, error handling, security vulnerabilities, performance issues, and test coverage before changes are committed or merged.When to Use
Use the Reviewer agent:Before Committing
Review changes before creating commits
Pull Request Reviews
Comprehensive PR review before merging
Security Audits
Check for security vulnerabilities and injection risks
After Major Changes
Quality check after significant refactoring or features
Configuration
Available Tools
Read files to examine code changes
Find related files that may be affected
Search for patterns, potential issues, or similar code
Run linters, tests, and other quality tools
Review Checklist
The Reviewer examines code across 6 critical dimensions:1. Logic Correctness
1. Logic Correctness
Does it do what’s intended?
- Algorithm correctness
- Business logic accuracy
- Control flow validation
- Return value correctness
- Conditional logic completeness
2. Edge Cases
2. Edge Cases
Null, empty, bounds?
- Null/undefined handling
- Empty array/string/object checks
- Array bounds checking
- Off-by-one errors
- Overflow/underflow conditions
- Unicode and special character handling
3. Error Handling
3. Error Handling
Proper handling?
- Try-catch blocks where needed
- Error messages are helpful
- Errors propagate correctly
- No swallowed errors
- Graceful degradation
- User-facing error messages are clear
4. Security
4. Security
Injection, auth, secrets?
- SQL injection prevention
- XSS protection
- CSRF token validation
- Authentication checks
- Authorization verification
- No hardcoded secrets
- Input sanitization
- Output encoding
5. Performance
5. Performance
O(n²) loops, memory?
- Time complexity reasonable
- No nested loops on large data
- Database query efficiency
- Memory leaks prevented
- Unnecessary re-renders avoided
- Lazy loading where appropriate
- Caching opportunities
6. Test Coverage
6. Test Coverage
Coverage adequate?
- Tests exist for new code
- Edge cases are tested
- Error paths are tested
- Integration tests if needed
- Test clarity and maintainability
Output Format
The Reviewer provides feedback organized by severity:Severity Levels
Critical
Must fix before mergeSecurity vulnerabilities, data corruption risks, production-breaking bugs
High
Should fixLogic errors, missing error handling, significant performance issues
Medium
Nice to fixCode quality, minor performance improvements, refactoring opportunities
Low
SuggestionsStyle improvements, documentation, best practices
Example Reviews
Rules and Constraints
Never Auto-Approve
Never Auto-Approve
The Reviewer never automatically approves code without performing a thorough review.
Never Skip Security
Never Skip Security
Security checks are mandatory. The Reviewer always examines code for vulnerabilities.
Suggest Fixes
Suggest Fixes
The Reviewer doesn’t just flag problems—it suggests specific fixes and improvements.
Best Practices
Address Critical First
Fix Critical issues immediately. They represent security risks or production bugs.
Common Issues Detected
Security Vulnerabilities
Logic Errors
Performance Issues
Integration with CI/CD
Integrate Reviewer into your development workflow:Comparison with Other Agents
| Feature | Reviewer | Planner | Debugger |
|---|---|---|---|
| Purpose | Quality checks | Task planning | Bug fixing |
| Timing | Before commit | Before implementation | When bugs occur |
| Makes changes | No | No | Yes (with approval) |
| Focus | Code quality | Architecture | Root cause |
Next Steps
Debugger
Systematic debugging for issues found by Reviewer
Orchestrator
Multi-phase development with built-in quality gates