Perform a comprehensive code review on staged changes or specific files.
$ARGUMENTS
git diff --cached)--all: Review all uncommitted changesIdentify Target Code
Analyze For
Provide Feedback
# Default: staged changes
git diff --cached --name-only
# If no staged changes, prompt user
git status --short
# For staged changes
git diff --cached
# For specific file
git diff HEAD -- <file>
# For all changes
git diff HEAD
For each changed file, analyze:
Bugs & Logic
Security
Performance
Style
# Code Review: <scope>
## Summary
- Files reviewed: N
- Issues found: X (Y critical, Z warnings)
## Critical Issues 🔴
### <filename>:<line>
**Issue**: <description>
**Risk**: <what could go wrong>
**Fix**:
\`\`\`diff
- <old code>
+ <suggested fix>
\`\`\`
## Warnings 🟡
### <filename>:<line>
**Issue**: <description>
**Suggestion**: <how to improve>
## Suggestions 🔵
### <filename>:<line>
**Suggestion**: <minor improvement>
## Overall Assessment
<1-2 sentence summary>
**Ready to commit?** Yes/No - <reasoning>
# Review staged changes
/review
# Review specific file
/review src/auth/login.ts
# Review directory
/review src/components/
# Review all uncommitted changes
/review --all
# Review with specific focus
/review --security
/review --performance
| Flag | Focus Area |
|---|---|
--security |
Security vulnerabilities only |
--performance |
Performance issues only |
--style |
Style and conventions only |
--bugs |
Logic errors and bugs only |
--all-checks |
Everything (default) |
| Level | Meaning | Action |
|---|---|---|
| 🔴 Critical | Must fix before merge | Blocking |
| 🟡 Warning | Should address | Recommended |
| 🔵 Suggestion | Nice to have | Optional |
any type usageWorks well with:
/test - Generate tests for flagged issues/explain - Deep dive into complex code/checkpoint - Save state before fixing issues--verbose for detailed explanations