Code Review Assistant
Purpose
Automated comprehensive code review using specialized multi-agent swarm for PRs.
Specialist Agent
I am a code review coordinator managing specialized review agents.
Methodology (Multi-Agent Swarm Review Pattern):
- Initialize review swarm with specialized agents
- Parallel comprehensive review (security, performance, style, tests, docs)
- Run complete quality audit pipeline
- Aggregate findings with severity ranking
- Generate fix suggestions with Codex
- Assess merge readiness with quality gates
- Create detailed review comment
Review Agents (5 specialists):
- Security Reviewer: Vulnerabilities, unsafe patterns, secrets
- Performance Analyst: Bottlenecks, optimization opportunities
- Style Reviewer: Code style, best practices, maintainability
- Test Specialist: Test coverage, quality, edge cases
- Documentation Reviewer: Comments, API docs, README updates
Input Contract
input:
pr_number: number (required) or
changed_files: array[string] (file paths)
focus_areas: array[enum] (default: all)
- security
- performance
- style
- tests
- documentation
suggest_fixes: boolean (default: true)
auto_merge_if_passing: boolean (default: false)
Output Contract
output:
review_summary:
overall_score: number (0-100)
merge_ready: boolean
blocking_issues: number
warnings: number
suggestions: number
detailed_reviews:
security: object
performance: object
style: object
tests: object
documentation: object
fix_suggestions: array[code_change]
merge_decision: enum[approve, request_changes, needs_work]
Execution Flow
#!/bin/bash
set -e
PR_NUMBER="$1"
FOCUS_AREAS="${2:-security,performance,style,tests,documentation}"
SUGGEST_FIXES="${3:-true}"
REVIEW_DIR="pr-review-$PR_NUMBER"
mkdir -p "$REVIEW_DIR"
echo "================================================================"
echo "Code Review Assistant: PR #$PR_NUMBER"
echo "================================================================"
# PHASE 1: PR Information Gathering
echo "[1/8] Gathering PR information..."
gh pr view "$PR_NUMBER" --json title,body,files,additions,deletions > "$REVIEW_DIR/pr-info.json"
PR_TITLE=$(cat "$REVIEW_DIR/pr-info.json" | jq -r '.title')
CHANGED_FILES=$(cat "$REVIEW_DIR/pr-info.json" | jq -r '.files[].path' | tr '\n' ' ')
echo "PR: $PR_TITLE"
echo "Files changed: $(echo $CHANGED_FILES | wc -w)"
# Checkout PR branch
gh pr checkout "$PR_NUMBER"
# PHASE 2: Initialize Review Swarm
echo "[2/8] Initializing multi-agent review swarm..."
npx claude-flow coordination swarm-init \
--topology mesh \
--max-agents 5 \
--strategy specialized
# Spawn specialized review agents
npx claude-flow automation auto-agent \
--task "Comprehensive code review of PR#$PR_NUMBER focusing on: $FOCUS_AREAS" \
--strategy optimal \
--max-agents 5
# PHASE 3: Parallel Specialized Reviews
echo "[3/8] Executing specialized reviews in parallel..."
# Security Review
if [[ "$FOCUS_AREAS" == *"security"* ]]; then
echo " → Security Specialist reviewing..."
npx claude-flow security-scan . \
--deep true \
--check-secrets true \
--output "$REVIEW_DIR/security-review.json" &
SEC_PID=$!
fi
# Performance Review
if [[ "$FOCUS_AREAS" == *"performance"* ]]; then
echo " → Performance Analyst reviewing..."
npx claude-flow analysis bottleneck-detect \
--threshold 10 \
--output "$REVIEW_DIR/performance-review.json" &
PERF_PID=$!
fi
# Style Review
if [[ "$FOCUS_AREAS" == *"style"* ]]; then
echo " → Style Reviewer checking..."
npx claude-flow style-audit . \
--fix false \
--output "$REVIEW_DIR/style-review.json" &
STYLE_PID=$!
fi
# Test Review
if [[ "$FOCUS_AREAS" == *"tests"* ]]; then
echo " → Test Specialist analyzing..."
npx claude-flow test-coverage . \
--detailed true \
--output "$REVIEW_DIR/test-review.json" &
TEST_PID=$!
fi
# Documentation Review
if [[ "$FOCUS_AREAS" == *"documentation"* ]]; then
echo " → Documentation Reviewer checking..."
# Check for README updates, JSDoc comments, etc.
npx claude-flow docs-checker . \
--output "$REVIEW_DIR/docs-review.json" &
DOCS_PID=$!
fi
# Wait for all reviews to complete
wait $SEC_PID $PERF_PID $STYLE_PID $TEST_PID $DOCS_PID 2>/dev/null || true
# PHASE 4: Complete Quality Audit
echo "[4/8] Running complete quality audit..."
npx claude-flow audit-pipeline . \
--phase all \
--model codex-auto \
--output "$REVIEW_DIR/quality-audit.json"
# PHASE 5: Aggregate Review Findings
echo "[5/8] Aggregating review findings..."
cat > "$REVIEW_DIR/aggregated-review.json" <<EOF
{
"pr_number": $PR_NUMBER,
"pr_title": "$PR_TITLE",
"reviews": {
"security": $(cat "$REVIEW_DIR/security-review.json" 2>/dev/null || echo "{}"),
"performance": $(cat "$REVIEW_DIR/performance-review.json" 2>/dev/null || echo "{}"),
"style": $(cat "$REVIEW_DIR/style-review.json" 2>/dev/null || echo "{}"),
"tests": $(cat "$REVIEW_DIR/test-review.json" 2>/dev/null || echo "{}"),
"documentation": $(cat "$REVIEW_DIR/docs-review.json" 2>/dev/null || echo "{}"),
"quality_audit": $(cat "$REVIEW_DIR/quality-audit.json")
}
}
EOF
# Calculate scores
SECURITY_SCORE=$(cat "$REVIEW_DIR/security-review.json" 2>/dev/null | jq '.score // 100')
PERF_SCORE=$(cat "$REVIEW_DIR/performance-review.json" 2>/dev/null | jq '.score // 100')
STYLE_SCORE=$(cat "$REVIEW_DIR/style-review.json" 2>/dev/null | jq '.quality_score // 100')
TEST_SCORE=$(cat "$REVIEW_DIR/test-review.json" 2>/dev/null | jq '.coverage_percent // 100')
QUALITY_SCORE=$(cat "$REVIEW_DIR/quality-audit.json" | jq '.overall_score // 100')
OVERALL_SCORE=$(echo "($SECURITY_SCORE + $PERF_SCORE + $STYLE_SCORE + $TEST_SCORE + $QUALITY_SCORE) / 5" | bc)
# PHASE 6: Generate Fix Suggestions
if [ "$SUGGEST_FIXES" = "true" ]; then
echo "[6/8] Generating fix suggestions with Codex..."
# Collect all issues
ISSUES=$(cat "$REVIEW_DIR/aggregated-review.json" | jq '[.reviews[] | .issues? // [] | .[]]')
if [ "$(echo $ISSUES | jq 'length')" -gt 0 ]; then
codex --reasoning-mode "Suggest fixes for code review issues" \
--context "$REVIEW_DIR/aggregated-review.json" \
--output "$REVIEW_DIR/fix-suggestions.md"
fi
fi
# PHASE 7: Assess Merge Readiness
echo "[7/8] Assessing merge readiness..."
CRITICAL_SECURITY=$(cat "$REVIEW_DIR/security-review.json" 2>/dev/null | jq '.critical_issues // 0')
TESTS_PASSING=$(cat "$REVIEW_DIR/quality-audit.json" | jq '.functionality_audit.all_passed // false')
MERGE_READY="false"
MERGE_DECISION="request_changes"
if [ "$CRITICAL_SECURITY" -eq 0 ] && [ "$TESTS_PASSING" = "true" ] && [ "$OVERALL_SCORE" -ge 80 ]; then
MERGE_READY="true"
if [ "$OVERALL_SCORE" -ge 90 ]; then
MERGE_DECISION="approve"
else
MERGE_DECISION="approve_with_suggestions"
fi
fi
# PHASE 8: Create Review Comment
echo "[8/8] Creating review comment..."
cat > "$REVIEW_DIR/review-comment.md" <<EOF
# 🤖 Automated Code Review
**Overall Score**: $OVERALL_SCORE/100
**Merge Ready**: $([ "$MERGE_READY" = "true" ] && echo "✅ Yes" || echo "⚠️ No")
## Review Summary
| Category | Score | Status |
|----------|-------|--------|
| 🔒 Security | $SECURITY_SCORE/100 | $([ "$SECURITY_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
| ⚡ Performance | $PERF_SCORE/100 | $([ "$PERF_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
| 🎨 Style | $STYLE_SCORE/100 | $([ "$STYLE_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
| 🧪 Tests | $TEST_SCORE/100 | $([ "$TEST_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
| 📊 Quality | $QUALITY_SCORE/100 | $([ "$QUALITY_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
## Detailed Findings
### 🔒 Security Review
$(cat "$REVIEW_DIR/security-review.json" 2>/dev/null | jq -r '.summary // "No issues found ✅"')
### ⚡ Performance Review
$(cat "$REVIEW_DIR/performance-review.json" 2>/dev/null | jq -r '.summary // "No bottlenecks detected ✅"')
### 🎨 Style Review
$(cat "$REVIEW_DIR/style-review.json" 2>/dev/null | jq -r '.summary // "Code style looks good ✅"')
### 🧪 Test Review
- Test Coverage: $TEST_SCORE%
- All Tests Passing: $([ "$TESTS_PASSING" = "true" ] && echo "✅ Yes" || echo "❌ No")
## Fix Suggestions
$(cat "$REVIEW_DIR/fix-suggestions.md" 2>/dev/null || echo "No suggestions needed - code looks great! 🎉")
---
🤖 Generated by Claude Code Review Assistant
EOF
# Post review comment
gh pr comment "$PR_NUMBER" --body-file "$REVIEW_DIR/review-comment.md"
# Approve or request changes
if [ "$MERGE_DECISION" = "approve" ]; then
gh pr review "$PR_NUMBER" --approve --body "Code review passed! Overall score: $OVERALL_SCORE/100 ✅"
elif [ "$MERGE_DECISION" = "approve_with_suggestions" ]; then
gh pr review "$PR_NUMBER" --approve --body "Approved with suggestions. See detailed review comment. Score: $OVERALL_SCORE/100 ✅"
else
gh pr review "$PR_NUMBER" --request-changes --body "Please address review findings before merging. Score: $OVERALL_SCORE/100"
fi
echo ""
echo "================================================================"
echo "Code Review Complete!"
echo "================================================================"
echo ""
echo "Overall Score: $OVERALL_SCORE/100"
echo "Merge Ready: $MERGE_READY"
echo "Decision: $MERGE_DECISION"
echo ""
echo "Review artifacts in: $REVIEW_DIR/"
echo "Review comment posted to PR #$PR_NUMBER"
echo ""
Integration Points
Cascades
- Part of
/github-automation-workflow cascade
- Used by
/pr-quality-gate cascade
- Invoked by
/review-pr command
Commands
- Uses:
/swarm-init, /auto-agent, /security-scan
- Uses:
/bottleneck-detect, /style-audit, /test-coverage
- Uses:
/audit-pipeline, /codex-reasoning
- Uses GitHub CLI:
gh pr view, gh pr checkout, gh pr comment, gh pr review
Other Skills
- Invokes:
quick-quality-check, smart-bug-fix (if issues)
- Output to:
merge-decision-maker, pr-enhancer
Usage Example
# Review PR with all checks
code-review-assistant 123
# Review focusing on security
code-review-assistant 123 security
# Review with auto-merge
code-review-assistant 123 "security,tests" true --auto-merge true
Failure Modes
- PR not found: Verify PR number and repository access
- Critical security issues: Block merge, escalate to security team
- Tests failing: Request changes, provide fix suggestions
- GitHub CLI not authenticated: Guide user to authenticate
1---
2name: code-review-assistant
3description: Comprehensive PR review using multi-agent swarm with specialized reviewers for security, performance, style, tests, and documentation. Provides detailed feedback with auto-fix suggestions and merge readiness assessment.
4tags: [review, pr, github, swarm, essential, tier-1]
5version: 1.0.0
6metadata:
7 source: https://skillmd.com/skills/aibot88/code-review-assistant
8---
9
10# Code Review Assistant
11
12## Purpose
13
14Automated comprehensive code review using specialized multi-agent swarm for PRs.
15
16## Specialist Agent
17
18I am a code review coordinator managing specialized review agents.
19
20**Methodology** (Multi-Agent Swarm Review Pattern):
211. Initialize review swarm with specialized agents
222. Parallel comprehensive review (security, performance, style, tests, docs)
233. Run complete quality audit pipeline
244. Aggregate findings with severity ranking
255. Generate fix suggestions with Codex
266. Assess merge readiness with quality gates
277. Create detailed review comment
28
29**Review Agents** (5 specialists):
30- **Security Reviewer**: Vulnerabilities, unsafe patterns, secrets
31- **Performance Analyst**: Bottlenecks, optimization opportunities
32- **Style Reviewer**: Code style, best practices, maintainability
33- **Test Specialist**: Test coverage, quality, edge cases
34- **Documentation Reviewer**: Comments, API docs, README updates
35
36## Input Contract
37
38```yaml
39input:
40 pr_number: number (required) or
41 changed_files: array[string] (file paths)
42 focus_areas: array[enum] (default: all)
43 - security
44 - performance
45 - style
46 - tests
47 - documentation
48 suggest_fixes: boolean (default: true)
49 auto_merge_if_passing: boolean (default: false)
50```
51
52## Output Contract
53
54```yaml
55output:
56 review_summary:
57 overall_score: number (0-100)
58 merge_ready: boolean
59 blocking_issues: number
60 warnings: number
61 suggestions: number
62 detailed_reviews:
63 security: object
64 performance: object
65 style: object
66 tests: object
67 documentation: object
68 fix_suggestions: array[code_change]
69 merge_decision: enum[approve, request_changes, needs_work]
70```
71
72## Execution Flow
73
74```bash
75#!/bin/bash
76set -e
77
78PR_NUMBER="$1"
79FOCUS_AREAS="${2:-security,performance,style,tests,documentation}"
80SUGGEST_FIXES="${3:-true}"
81
82REVIEW_DIR="pr-review-$PR_NUMBER"
83mkdir -p "$REVIEW_DIR"
84
85echo "================================================================"
86echo "Code Review Assistant: PR #$PR_NUMBER"
87echo "================================================================"
88
89# PHASE 1: PR Information Gathering
90echo "[1/8] Gathering PR information..."
91gh pr view "$PR_NUMBER" --json title,body,files,additions,deletions > "$REVIEW_DIR/pr-info.json"
92
93PR_TITLE=$(cat "$REVIEW_DIR/pr-info.json" | jq -r '.title')
94CHANGED_FILES=$(cat "$REVIEW_DIR/pr-info.json" | jq -r '.files[].path' | tr '\n' ' ')
95
96echo "PR: $PR_TITLE"
97echo "Files changed: $(echo $CHANGED_FILES | wc -w)"
98
99# Checkout PR branch
100gh pr checkout "$PR_NUMBER"
101
102# PHASE 2: Initialize Review Swarm
103echo "[2/8] Initializing multi-agent review swarm..."
104npx claude-flow coordination swarm-init \
105 --topology mesh \
106 --max-agents 5 \
107 --strategy specialized
108
109# Spawn specialized review agents
110npx claude-flow automation auto-agent \
111 --task "Comprehensive code review of PR#$PR_NUMBER focusing on: $FOCUS_AREAS" \
112 --strategy optimal \
113 --max-agents 5
114
115# PHASE 3: Parallel Specialized Reviews
116echo "[3/8] Executing specialized reviews in parallel..."
117
118# Security Review
119if [[ "$FOCUS_AREAS" == *"security"* ]]; then
120 echo " → Security Specialist reviewing..."
121 npx claude-flow security-scan . \
122 --deep true \
123 --check-secrets true \
124 --output "$REVIEW_DIR/security-review.json" &
125 SEC_PID=$!
126fi
127
128# Performance Review
129if [[ "$FOCUS_AREAS" == *"performance"* ]]; then
130 echo " → Performance Analyst reviewing..."
131 npx claude-flow analysis bottleneck-detect \
132 --threshold 10 \
133 --output "$REVIEW_DIR/performance-review.json" &
134 PERF_PID=$!
135fi
136
137# Style Review
138if [[ "$FOCUS_AREAS" == *"style"* ]]; then
139 echo " → Style Reviewer checking..."
140 npx claude-flow style-audit . \
141 --fix false \
142 --output "$REVIEW_DIR/style-review.json" &
143 STYLE_PID=$!
144fi
145
146# Test Review
147if [[ "$FOCUS_AREAS" == *"tests"* ]]; then
148 echo " → Test Specialist analyzing..."
149 npx claude-flow test-coverage . \
150 --detailed true \
151 --output "$REVIEW_DIR/test-review.json" &
152 TEST_PID=$!
153fi
154
155# Documentation Review
156if [[ "$FOCUS_AREAS" == *"documentation"* ]]; then
157 echo " → Documentation Reviewer checking..."
158 # Check for README updates, JSDoc comments, etc.
159 npx claude-flow docs-checker . \
160 --output "$REVIEW_DIR/docs-review.json" &
161 DOCS_PID=$!
162fi
163
164# Wait for all reviews to complete
165wait $SEC_PID $PERF_PID $STYLE_PID $TEST_PID $DOCS_PID 2>/dev/null || true
166
167# PHASE 4: Complete Quality Audit
168echo "[4/8] Running complete quality audit..."
169npx claude-flow audit-pipeline . \
170 --phase all \
171 --model codex-auto \
172 --output "$REVIEW_DIR/quality-audit.json"
173
174# PHASE 5: Aggregate Review Findings
175echo "[5/8] Aggregating review findings..."
176cat > "$REVIEW_DIR/aggregated-review.json" <<EOF
177{
178 "pr_number": $PR_NUMBER,
179 "pr_title": "$PR_TITLE",
180 "reviews": {
181 "security": $(cat "$REVIEW_DIR/security-review.json" 2>/dev/null || echo "{}"),
182 "performance": $(cat "$REVIEW_DIR/performance-review.json" 2>/dev/null || echo "{}"),
183 "style": $(cat "$REVIEW_DIR/style-review.json" 2>/dev/null || echo "{}"),
184 "tests": $(cat "$REVIEW_DIR/test-review.json" 2>/dev/null || echo "{}"),
185 "documentation": $(cat "$REVIEW_DIR/docs-review.json" 2>/dev/null || echo "{}"),
186 "quality_audit": $(cat "$REVIEW_DIR/quality-audit.json")
187 }
188}
189EOF
190
191# Calculate scores
192SECURITY_SCORE=$(cat "$REVIEW_DIR/security-review.json" 2>/dev/null | jq '.score // 100')
193PERF_SCORE=$(cat "$REVIEW_DIR/performance-review.json" 2>/dev/null | jq '.score // 100')
194STYLE_SCORE=$(cat "$REVIEW_DIR/style-review.json" 2>/dev/null | jq '.quality_score // 100')
195TEST_SCORE=$(cat "$REVIEW_DIR/test-review.json" 2>/dev/null | jq '.coverage_percent // 100')
196QUALITY_SCORE=$(cat "$REVIEW_DIR/quality-audit.json" | jq '.overall_score // 100')
197
198OVERALL_SCORE=$(echo "($SECURITY_SCORE + $PERF_SCORE + $STYLE_SCORE + $TEST_SCORE + $QUALITY_SCORE) / 5" | bc)
199
200# PHASE 6: Generate Fix Suggestions
201if [ "$SUGGEST_FIXES" = "true" ]; then
202 echo "[6/8] Generating fix suggestions with Codex..."
203
204 # Collect all issues
205 ISSUES=$(cat "$REVIEW_DIR/aggregated-review.json" | jq '[.reviews[] | .issues? // [] | .[]]')
206
207 if [ "$(echo $ISSUES | jq 'length')" -gt 0 ]; then
208 codex --reasoning-mode "Suggest fixes for code review issues" \
209 --context "$REVIEW_DIR/aggregated-review.json" \
210 --output "$REVIEW_DIR/fix-suggestions.md"
211 fi
212fi
213
214# PHASE 7: Assess Merge Readiness
215echo "[7/8] Assessing merge readiness..."
216
217CRITICAL_SECURITY=$(cat "$REVIEW_DIR/security-review.json" 2>/dev/null | jq '.critical_issues // 0')
218TESTS_PASSING=$(cat "$REVIEW_DIR/quality-audit.json" | jq '.functionality_audit.all_passed // false')
219
220MERGE_READY="false"
221MERGE_DECISION="request_changes"
222
223if [ "$CRITICAL_SECURITY" -eq 0 ] && [ "$TESTS_PASSING" = "true" ] && [ "$OVERALL_SCORE" -ge 80 ]; then
224 MERGE_READY="true"
225 if [ "$OVERALL_SCORE" -ge 90 ]; then
226 MERGE_DECISION="approve"
227 else
228 MERGE_DECISION="approve_with_suggestions"
229 fi
230fi
231
232# PHASE 8: Create Review Comment
233echo "[8/8] Creating review comment..."
234
235cat > "$REVIEW_DIR/review-comment.md" <<EOF
236# 🤖 Automated Code Review
237
238**Overall Score**: $OVERALL_SCORE/100
239**Merge Ready**: $([ "$MERGE_READY" = "true" ] && echo "✅ Yes" || echo "⚠️ No")
240
241## Review Summary
242
243| Category | Score | Status |
244|----------|-------|--------|
245| 🔒 Security | $SECURITY_SCORE/100 | $([ "$SECURITY_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
246| ⚡ Performance | $PERF_SCORE/100 | $([ "$PERF_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
247| 🎨 Style | $STYLE_SCORE/100 | $([ "$STYLE_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
248| 🧪 Tests | $TEST_SCORE/100 | $([ "$TEST_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
249| 📊 Quality | $QUALITY_SCORE/100 | $([ "$QUALITY_SCORE" -ge 80 ] && echo "✅" || echo "⚠️") |
250
251## Detailed Findings
252
253### 🔒 Security Review
254$(cat "$REVIEW_DIR/security-review.json" 2>/dev/null | jq -r '.summary // "No issues found ✅"')
255
256### ⚡ Performance Review
257$(cat "$REVIEW_DIR/performance-review.json" 2>/dev/null | jq -r '.summary // "No bottlenecks detected ✅"')
258
259### 🎨 Style Review
260$(cat "$REVIEW_DIR/style-review.json" 2>/dev/null | jq -r '.summary // "Code style looks good ✅"')
261
262### 🧪 Test Review
263- Test Coverage: $TEST_SCORE%
264- All Tests Passing: $([ "$TESTS_PASSING" = "true" ] && echo "✅ Yes" || echo "❌ No")
265
266## Fix Suggestions
267
268$(cat "$REVIEW_DIR/fix-suggestions.md" 2>/dev/null || echo "No suggestions needed - code looks great! 🎉")
269
270---
271
272🤖 Generated by Claude Code Review Assistant
273EOF
274
275# Post review comment
276gh pr comment "$PR_NUMBER" --body-file "$REVIEW_DIR/review-comment.md"
277
278# Approve or request changes
279if [ "$MERGE_DECISION" = "approve" ]; then
280 gh pr review "$PR_NUMBER" --approve --body "Code review passed! Overall score: $OVERALL_SCORE/100 ✅"
281elif [ "$MERGE_DECISION" = "approve_with_suggestions" ]; then
282 gh pr review "$PR_NUMBER" --approve --body "Approved with suggestions. See detailed review comment. Score: $OVERALL_SCORE/100 ✅"
283else
284 gh pr review "$PR_NUMBER" --request-changes --body "Please address review findings before merging. Score: $OVERALL_SCORE/100"
285fi
286
287echo ""
288echo "================================================================"
289echo "Code Review Complete!"
290echo "================================================================"
291echo ""
292echo "Overall Score: $OVERALL_SCORE/100"
293echo "Merge Ready: $MERGE_READY"
294echo "Decision: $MERGE_DECISION"
295echo ""
296echo "Review artifacts in: $REVIEW_DIR/"
297echo "Review comment posted to PR #$PR_NUMBER"
298echo ""
299```
300
301## Integration Points
302
303### Cascades
304- Part of `/github-automation-workflow` cascade
305- Used by `/pr-quality-gate` cascade
306- Invoked by `/review-pr` command
307
308### Commands
309- Uses: `/swarm-init`, `/auto-agent`, `/security-scan`
310- Uses: `/bottleneck-detect`, `/style-audit`, `/test-coverage`
311- Uses: `/audit-pipeline`, `/codex-reasoning`
312- Uses GitHub CLI: `gh pr view`, `gh pr checkout`, `gh pr comment`, `gh pr review`
313
314### Other Skills
315- Invokes: `quick-quality-check`, `smart-bug-fix` (if issues)
316- Output to: `merge-decision-maker`, `pr-enhancer`
317
318## Usage Example
319
320```bash
321# Review PR with all checks
322code-review-assistant 123
323
324# Review focusing on security
325code-review-assistant 123 security
326
327# Review with auto-merge
328code-review-assistant 123 "security,tests" true --auto-merge true
329```
330
331## Failure Modes
332
333- **PR not found**: Verify PR number and repository access
334- **Critical security issues**: Block merge, escalate to security team
335- **Tests failing**: Request changes, provide fix suggestions
336- **GitHub CLI not authenticated**: Guide user to authenticate