spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / plugins / pr-review-toolkit / commands / review-pr.md
189 lines · 4.9 KBPreviewCodeRaw
1---
2description: "Comprehensive PR review using specialized agents"
3argument-hint: "[review-aspects]"
4allowed-tools: ["Bash", "Glob", "Grep", "Read", "Task"]
5---
6
7# Comprehensive PR Review
8
9Run a comprehensive pull request review using multiple specialized agents, each focusing on a different aspect of code quality.
10
11**Review Aspects (optional):** "$ARGUMENTS"
12
13## Review Workflow:
14
151. **Determine Review Scope**
16 - Check git status to identify changed files
17 - Parse arguments to see if user requested specific review aspects
18 - Default: Run all applicable reviews
19
202. **Available Review Aspects:**
21
22 - **comments** - Analyze code comment accuracy and maintainability
23 - **tests** - Review test coverage quality and completeness
24 - **errors** - Check error handling for silent failures
25 - **types** - Analyze type design and invariants (if new types added)
26 - **code** - General code review for project guidelines
27 - **simplify** - Simplify code for clarity and maintainability
28 - **all** - Run all applicable reviews (default)
29
303. **Identify Changed Files**
31 - Run `git diff --name-only` to see modified files
32 - Check if PR already exists: `gh pr view`
33 - Identify file types and what reviews apply
34
354. **Determine Applicable Reviews**
36
37 Based on changes:
38 - **Always applicable**: code-reviewer (general quality)
39 - **If test files changed**: pr-test-analyzer
40 - **If comments/docs added**: comment-analyzer
41 - **If error handling changed**: silent-failure-hunter
42 - **If types added/modified**: type-design-analyzer
43 - **After passing review**: code-simplifier (polish and refine)
44
455. **Launch Review Agents**
46
47 **Sequential approach** (one at a time):
48 - Easier to understand and act on
49 - Each report is complete before next
50 - Good for interactive review
51
52 **Parallel approach** (user can request):
53 - Launch all agents simultaneously
54 - Faster for comprehensive review
55 - Results come back together
56
576. **Aggregate Results**
58
59 After agents complete, summarize:
60 - **Critical Issues** (must fix before merge)
61 - **Important Issues** (should fix)
62 - **Suggestions** (nice to have)
63 - **Positive Observations** (what's good)
64
657. **Provide Action Plan**
66
67 Organize findings:
68 ```markdown
69 # PR Review Summary
70
71 ## Critical Issues (X found)
72 - [agent-name]: Issue description [file:line]
73
74 ## Important Issues (X found)
75 - [agent-name]: Issue description [file:line]
76
77 ## Suggestions (X found)
78 - [agent-name]: Suggestion [file:line]
79
80 ## Strengths
81 - What's well-done in this PR
82
83 ## Recommended Action
84 1. Fix critical issues first
85 2. Address important issues
86 3. Consider suggestions
87 4. Re-run review after fixes
88 ```
89
90## Usage Examples:
91
92**Full review (default):**
93```
94/pr-review-toolkit:review-pr
95```
96
97**Specific aspects:**
98```
99/pr-review-toolkit:review-pr tests errors
100# Reviews only test coverage and error handling
101
102/pr-review-toolkit:review-pr comments
103# Reviews only code comments
104
105/pr-review-toolkit:review-pr simplify
106# Simplifies code after passing review
107```
108
109**Parallel review:**
110```
111/pr-review-toolkit:review-pr all parallel
112# Launches all agents in parallel
113```
114
115## Agent Descriptions:
116
117**comment-analyzer**:
118- Verifies comment accuracy vs code
119- Identifies comment rot
120- Checks documentation completeness
121
122**pr-test-analyzer**:
123- Reviews behavioral test coverage
124- Identifies critical gaps
125- Evaluates test quality
126
127**silent-failure-hunter**:
128- Finds silent failures
129- Reviews catch blocks
130- Checks error logging
131
132**type-design-analyzer**:
133- Analyzes type encapsulation
134- Reviews invariant expression
135- Rates type design quality
136
137**code-reviewer**:
138- Checks CLAUDE.md compliance
139- Detects bugs and issues
140- Reviews general code quality
141
142**code-simplifier**:
143- Simplifies complex code
144- Improves clarity and readability
145- Applies project standards
146- Preserves functionality
147
148## Tips:
149
150- **Run early**: Before creating PR, not after
151- **Focus on changes**: Agents analyze git diff by default
152- **Address critical first**: Fix high-priority issues before lower priority
153- **Re-run after fixes**: Verify issues are resolved
154- **Use specific reviews**: Target specific aspects when you know the concern
155
156## Workflow Integration:
157
158**Before committing:**
159```
1601. Write code
1612. Run: /pr-review-toolkit:review-pr code errors
1623. Fix any critical issues
1634. Commit
164```
165
166**Before creating PR:**
167```
1681. Stage all changes
1692. Run: /pr-review-toolkit:review-pr all
1703. Address all critical and important issues
1714. Run specific reviews again to verify
1725. Create PR
173```
174
175**After PR feedback:**
176```
1771. Make requested changes
1782. Run targeted reviews based on feedback
1793. Verify issues are resolved
1804. Push updates
181```
182
183## Notes:
184
185- Agents run autonomously and return detailed reports
186- Each agent focuses on its specialty for deep analysis
187- Results are actionable with specific file:line references
188- Agents use appropriate models for their complexity
189- All agents available in `/agents` list