Quality assurance before you commit
Quick Start
/review
What happens:
- code-reviewer agent analyzes recent changes
- Checks security vulnerabilities
- Evaluates performance
- Validates architecture patterns
- Verifies YAGNI/KISS/DRY principles
Output: Review report with severity-ranked issues
Syntax
/review [files or scope]
Example Output
ā code-reviewer: Analyzing changes...
Files reviewed: 8
Lines changed: +247, -89
CRITICAL ISSUES (Fix Immediately): 0
HIGH PRIORITY (Fix Before Commit): 1
MEDIUM PRIORITY (Fix This Week): 3
LOW PRIORITY (Consider): 2
---
HIGH PRIORITY:
š Potential SQL injection in campaign query
File: lib/campaign/manager.ts:45
Fix: Use parameterized queries
Impact: Security vulnerability
MEDIUM PRIORITY:
š” Missing error handling in API route
File: app/api/campaigns/route.ts:23
Fix: Add try/catch block
š” Large component file (450 lines)
File: components/CampaignBuilder.tsx
Fix: Split into smaller components
š” Unused import in 3 files
Fix: Remove unused imports
LOW PRIORITY:
āŖ Consider memoization for expensive calculation
File: lib/analytics/metrics.ts:67
āŖ Magic number should be constant
File: lib/email/scheduler.ts:12
---
STRENGTHS:
ā
Good test coverage (87%)
ā
Type-safe throughout
ā
Clear naming conventions
ā
Proper error messages
Summary: Fix 1 high-priority issue before commit
Next: /fix SQL injection in campaign query
When to Use
Before Commits
/review # Check code quality
# Fix issues
/git cm # Commit
After Implementation
/cook plans/feature.md
/review # Quality check
Periodic Reviews
/review lib/ # Review specific directory
/review components/CampaignBuilder.tsx # Single file
Review Criteria
- Security: SQL injection, XSS, auth issues
- Performance: N+1 queries, memory leaks
- Architecture: SOLID principles, patterns
- Code quality: Naming, structure, duplication
- Testing: Coverage, test quality
- Principles: YAGNI, KISS, DRY
Related Commands
Quality gates. Catch issues before they reach production.