Skip to main content 首页 创作者 tomevault-io skills-registry code-review-assistant
code-review-assistant 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. Use when this capability is needed.
跳到安装 Skills Marketplace 发现并探索由社区构建的 Agent Skills
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill code-review-assistant命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
下载 Zip 下载中... name code-review-assistant description 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. Use when this capability is needed. metadata {"author":"dnyoussef"}
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 "================================================================"
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) "
gh pr checkout "$PR_NUMBER "
npx claude-flow coordination swarm-init \
--topology mesh \
--max-agents 5 \
--strategy specialized
npx claude-flow automation auto-agent \
--task \
--strategy optimal \
--max-agents 5
[[ == * * ]];
npx claude-flow security-scan . \
--deep \
--check-secrets \
--output &
SEC_PID=$!
[[ == * * ]];
npx claude-flow analysis bottleneck-detect \
--threshold 10 \
--output &
PERF_PID=$!
[[ == * * ]];
npx claude-flow style-audit . \
--fix \
--output &
STYLE_PID=$!
[[ == * * ]];
npx claude-flow test-coverage . \
--detailed \
--output &
TEST_PID=$!
[[ == * * ]];
npx claude-flow docs-checker . \
--output &
DOCS_PID=$!
2>/dev/null ||
npx claude-flow audit-pipeline . \
--phase all \
--model codex-auto \
--output
> <<
SECURITY_SCORE=$( 2>/dev/null | jq )
PERF_SCORE=$( 2>/dev/null | jq )
STYLE_SCORE=$( 2>/dev/null | jq )
TEST_SCORE=$( 2>/dev/null | jq )
QUALITY_SCORE=$( | jq )
OVERALL_SCORE=$( | bc)
[ = ];
ISSUES=$( | jq )
[ -gt 0 ];
codex --reasoning-mode \
--context \
--output
CRITICAL_SECURITY=$( 2>/dev/null | jq )
TESTS_PASSING=$( | jq )
MERGE_READY=
MERGE_DECISION=
[ -eq 0 ] && [ = ] && [ -ge 80 ];
MERGE_READY=
[ -ge 90 ];
MERGE_DECISION=
MERGE_DECISION=
> <<
gh comment --body-file
[ = ];
gh review --approve --body
[ = ];
gh review --approve --body
gh review --request-changes --body
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
code-review-assistant 123
code-review-assistant 123 security
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
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
echo
"[2/8] Initializing multi-agent review swarm..."
"Comprehensive code review of PR#$PR_NUMBER focusing on: $FOCUS_AREAS "
echo
"[3/8] Executing specialized reviews in parallel..."
if
"$FOCUS_AREAS "
"security"
then
echo
" → Security Specialist reviewing..."
true
true
"$REVIEW_DIR /security-review.json"
fi
if
"$FOCUS_AREAS "
"performance"
then
echo
" → Performance Analyst reviewing..."
"$REVIEW_DIR /performance-review.json"
fi
if
"$FOCUS_AREAS "
"style"
then
echo
" → Style Reviewer checking..."
false
"$REVIEW_DIR /style-review.json"
fi
if
"$FOCUS_AREAS "
"tests"
then
echo
" → Test Specialist analyzing..."
true
"$REVIEW_DIR /test-review.json"
fi
if
"$FOCUS_AREAS "
"documentation"
then
echo
" → Documentation Reviewer checking..."
"$REVIEW_DIR /docs-review.json"
fi
wait
$SEC_PID
$PERF_PID
$STYLE_PID
$TEST_PID
$DOCS_PID
true
echo
"[4/8] Running complete quality audit..."
"$REVIEW_DIR /quality-audit.json"
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
cat
"$REVIEW_DIR /security-review.json"
'.score // 100'
cat
"$REVIEW_DIR /performance-review.json"
'.score // 100'
cat
"$REVIEW_DIR /style-review.json"
'.quality_score // 100'
cat
"$REVIEW_DIR /test-review.json"
'.coverage_percent // 100'
cat
"$REVIEW_DIR /quality-audit.json"
'.overall_score // 100'
echo
"($SECURITY_SCORE + $PERF_SCORE + $STYLE_SCORE + $TEST_SCORE + $QUALITY_SCORE ) / 5"
if
"$SUGGEST_FIXES "
"true"
then
echo
"[6/8] Generating fix suggestions with Codex..."
cat
"$REVIEW_DIR /aggregated-review.json"
'[.reviews[] | .issues? // [] | .[]]'
if
"$(echo $ISSUES | jq 'length') "
then
"Suggest fixes for code review issues"
"$REVIEW_DIR /aggregated-review.json"
"$REVIEW_DIR /fix-suggestions.md"
fi
fi
echo
"[7/8] Assessing merge readiness..."
cat
"$REVIEW_DIR /security-review.json"
'.critical_issues // 0'
cat
"$REVIEW_DIR /quality-audit.json"
'.functionality_audit.all_passed // false'
"false"
"request_changes"
if
"$CRITICAL_SECURITY "
"$TESTS_PASSING "
"true"
"$OVERALL_SCORE "
then
"true"
if
"$OVERALL_SCORE "
then
"approve"
else
"approve_with_suggestions"
fi
fi
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
pr
"$PR_NUMBER "
"$REVIEW_DIR /review-comment.md"
if
"$MERGE_DECISION "
"approve"
then
pr
"$PR_NUMBER "
"Code review passed! Overall score: $OVERALL_SCORE /100 ✅"
elif
"$MERGE_DECISION "
"approve_with_suggestions"
then
pr
"$PR_NUMBER "
"Approved with suggestions. See detailed review comment. Score: $OVERALL_SCORE /100 ✅"
else
pr
"$PR_NUMBER "
"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
""