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 Command
2
3## Description
4Review current code changes for quality issues.
5
6## Process
7
8### 1. Gather Changes
9```bash
10# Get staged changes
11git diff --cached
12
13# Get unstaged changes
14git diff
15
16# Get untracked files
17git ls-files --others --exclude-standard
18```
19
20### 2. Review Criteria
21For each changed file, check:
22- [ ] No hardcoded secrets or API keys
23- [ ] Error handling is present
24- [ ] TypeScript types are correct (no any)
25- [ ] Functions have reasonable complexity
26- [ ] No console.log left in production code
27- [ ] Imports are clean (no unused)
28- [ ] Tests exist for new functions
29- [ ] Variable names are descriptive
30
31### 3. Output Format
32```
33FILE: src/utils/auth.ts
34 [BUG] Line 42: Possible null dereference
35 user.email could be undefined when user is null
36 Fix: Add null check before accessing .email
37
38 [SECURITY] Line 67: Hardcoded JWT secret
39 Secret should come from environment variable
40 Fix: Use process.env.JWT_SECRET
41
42 [STYLE] Line 89: Function too long (45 lines)
43 Consider extracting validation logic
44 Fix: Extract validateInput() function
45
46SUMMARY: 1 bug, 1 security issue, 1 style suggestion
47```
48
49## Usage
50- `/review` - Review all current changes
51- `/review staged` - Review only staged changes
52- `/review src/auth/` - Review changes in specific directory