BACK TO DIRECTORY
commandbeginner
/review
Performs an automated code review on your current changes (both staged and unstaged). Checks for bugs, security issues, performance problems, and style inconsistencies. Outputs a structured review with severity levels and specific suggestions for each issue found. Can also review specific files or compare against a branch.
623 STARS
8.9k DOWNLOADS
claude-templates
reviewqualitydifffeedbackpr
CONFIGURATION
markdown
1# /review Command23## Description4Review current code changes for quality issues.56## Process78### 1. Gather Changes9```bash10# Get staged changes11git diff --cached1213# Get unstaged changes14git diff1516# Get untracked files17git ls-files --others --exclude-standard18```1920### 2. Review Criteria21For each changed file, check:22- [ ] No hardcoded secrets or API keys23- [ ] Error handling is present24- [ ] TypeScript types are correct (no any)25- [ ] Functions have reasonable complexity26- [ ] No console.log left in production code27- [ ] Imports are clean (no unused)28- [ ] Tests exist for new functions29- [ ] Variable names are descriptive3031### 3. Output Format32```33FILE: src/utils/auth.ts34 [BUG] Line 42: Possible null dereference35 user.email could be undefined when user is null36 Fix: Add null check before accessing .email3738 [SECURITY] Line 67: Hardcoded JWT secret39 Secret should come from environment variable40 Fix: Use process.env.JWT_SECRET4142 [STYLE] Line 89: Function too long (45 lines)43 Consider extracting validation logic44 Fix: Extract validateInput() function4546SUMMARY: 1 bug, 1 security issue, 1 style suggestion47```4849## Usage50- `/review` - Review all current changes51- `/review staged` - Review only staged changes52- `/review src/auth/` - Review changes in specific directory