Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Agent skill for swarm-pr - invoke with $agent-swarm-pr
.claude/skills/agent-swarm-pr/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | — | — |
| case-19 | ✗→✓ | ▲ Improved | — | — |
| case-16 | ✗→✓ | ▲ Improved | — | — |
| case-09 | ✗→✓ | ▲ Improved | — | — |
| case-07 | ✗→✓ | ▲ Improved | — | — |
Create and manage AI swarms directly from GitHub Pull Requests, enabling seamless integration with your development workflow through intelligent multi-agent coordination.
bash# Create swarm from PR description using gh CLI gh pr view 123 --json body,title,labels,files | npx ruv-swarm swarm create-from-pr # Auto-spawn agents based on PR labels gh pr view 123 --json labels | npx ruv-swarm swarm auto-spawn # Create swarm with PR context gh pr view 123 --json body,labels,author,assignees | \ npx ruv-swarm swarm init --from-pr-data
Execute swarm commands via PR comments:
markdown<!-- In PR comment --> $swarm init mesh 6 $swarm spawn coder "Implement authentication" $swarm spawn tester "Write unit tests" $swarm status
yaml# .github$workflows$swarm-pr.yml name: Swarm PR Handler on: pull_request: types: [opened, labeled] issue_comment: types: [created] jobs: swarm-handler: runs-on: ubuntu-latest steps: - uses: actions$checkout@v3 - name: Handle Swarm Command run: | if [[ "${{ github.event.comment.body }}" == $swarm* ]]; then npx ruv-swarm github handle-comment \ --pr ${{ github.event.pull_request.number }} \ --comment "${{ github.event.comment.body }}" fi
Map PR labels to agent types:
json{ "label-mapping": { "bug": ["debugger", "tester"], "feature": ["architect", "coder", "tester"], "refactor": ["analyst", "coder"], "docs": ["researcher", "writer"], "performance": ["analyst", "optimizer"] } }
bash# Small PR (< 100 lines): ring topology # Medium PR (100-500 lines): mesh topology # Large PR (> 500 lines): hierarchical topology npx ruv-swarm github pr-topology --pr 123
bash# Create swarm with PR context using gh CLI PR_DIFF=$(gh pr diff 123) PR_INFO=$(gh pr view 123 --json title,body,labels,files,reviews) npx ruv-swarm github pr-init 123 \ --auto-agents \ --pr-data "$PR_INFO" \ --diff "$PR_DIFF" \ --analyze-impact
bash# Post swarm progress to PR using gh CLI PROGRESS=$(npx ruv-swarm github pr-progress 123 --format markdown) gh pr comment 123 --body "$PROGRESS" # Update PR labels based on progress if [[ $(echo "$PROGRESS" | grep -o '[0-9]\+%' | sed 's/%//') -gt 90 ]]; then gh pr edit 123 --add-label "ready-for-review" fi
bash# Create review agents with gh CLI integration PR_FILES=$(gh pr view 123 --json files --jq '.files[].path') # Run swarm review REVIEW_RESULTS=$(npx ruv-swarm github pr-review 123 \ --agents "security,performance,style" \ --files "$PR_FILES") # Post review comments using gh CLI echo "$REVIEW_RESULTS" | jq -r '.comments[]' | while read -r comment; do FILE=$(echo "$comment" | jq -r '.file') LINE=$(echo "$comment" | jq -r '.line') BODY=$(echo "$comment" | jq -r '.body') gh pr review 123 --comment --body "$BODY" done
bash# Coordinate swarms across related PRs npx ruv-swarm github multi-pr \ --prs "123,124,125" \ --strategy "parallel" \ --share-memory
bash# Analyze PR dependencies npx ruv-swarm github pr-deps 123 \ --spawn-agents \ --resolve-conflicts
bash# Auto-fix PR issues npx ruv-swarm github pr-fix 123 \ --issues "lint,test-failures" \ --commit-fixes
markdown<!-- .github$pull_request_template.md --> ## Swarm Configuration - Topology: [mesh$hierarchical$ring$star] - Max Agents: [number] - Auto-spawn: [yes$no] - Priority: [high$medium$low] ## Tasks for Swarm - [ ] Task 1 description - [ ] Task 2 description
yaml# Require swarm completion before merge required_status_checks: contexts: - "swarm$tasks-complete" - "swarm$tests-pass" - "swarm$review-approved"
bash# Auto-merge when swarm completes using gh CLI # Check swarm completion status SWARM_STATUS=$(npx ruv-swarm github pr-status 123) if [[ "$SWARM_STATUS" == "complete" ]]; then # Check review requirements REVIEWS=$(gh pr view 123 --json reviews --jq '.reviews | length') if [[ $REVIEWS -ge 2 ]]; then # Enable auto-merge gh pr merge 123 --auto --squash fi fi
javascript// webhook-handler.js const { createServer } = require('http'); const { execSync } = require('child_process'); createServer((req, res) => { if (req.url === '$github-webhook') { const event = JSON.parse(body); if (event.action === 'opened' && event.pull_request) { execSync(`npx ruv-swarm github pr-init ${event.pull_request.number}`); } res.writeHead(200); res.end('OK'); } }).listen(3000);
bash# PR #456: Add user authentication npx ruv-swarm github pr-init 456 \ --topology hierarchical \ --agents "architect,coder,tester,security" \ --auto-assign-tasks
bash# PR #789: Fix memory leak npx ruv-swarm github pr-init 789 \ --topology mesh \ --agents "debugger,analyst,tester" \ --priority high
bash# PR #321: Update API docs npx ruv-swarm github pr-init 321 \ --topology ring \ --agents "researcher,writer,reviewer" \ --validate-links
bash# Generate PR swarm report npx ruv-swarm github pr-report 123 \ --metrics "completion-time,agent-efficiency,token-usage" \ --format markdown
bash# Export to GitHub Insights npx ruv-swarm github export-metrics \ --pr 123 \ --to-insights
When using with Claude Code:
bash# Initialize PR-specific swarm with intelligent topology selection mcp__claude-flow__swarm_init { topology: "mesh", maxAgents: 8 } mcp__claude-flow__agent_spawn { type: "coordinator", name: "PR Coordinator" } mcp__claude-flow__agent_spawn { type: "reviewer", name: "Code Reviewer" } mcp__claude-flow__agent_spawn { type: "tester", name: "Test Engineer" } mcp__claude-flow__agent_spawn { type: "analyst", name: "Impact Analyzer" } mcp__claude-flow__agent_spawn { type: "optimizer", name: "Performance Optimizer" } # Store PR context for swarm coordination mcp__claude-flow__memory_usage { action: "store", key: "pr/#{pr_number}$analysis", value: { diff: "pr_diff_content", files_changed: ["file1.js", "file2.py"], complexity_score: 8.5, risk_assessment: "medium" } } # Orchestrate comprehensive PR workflow mcp__claude-flow__task_orchestrate { task: "Execute multi-agent PR review and validation workflow", strategy: "parallel", priority: "high", dependencies: ["diff_analysis", "test_validation", "security_review"] }
javascript// Pre-hook: PR Initialization and Swarm Setup const prPreHook = async (prData) => { // Analyze PR complexity for optimal swarm configuration const complexity = await analyzePRComplexity(prData); const topology = complexity > 7 ? "hierarchical" : "mesh"; // Initialize swarm with PR-specific configuration await mcp__claude_flow__swarm_init({ topology, maxAgents: 8 }); // Store comprehensive PR context await mcp__claude_flow__memory_usage({ action: "store", key: `pr/${prData.number}$context`, value: { pr: prData, complexity, agents_assigned: await getOptimalAgents(prData), timeline: generateTimeline(prData) } }); // Coordinate initial agent synchronization await mcp__claude_flow__coordination_sync({ swarmId: "current" }); }; // Post-hook: PR Completion and Metrics const prPostHook = async (results) => { // Generate comprehensive PR completion report const report = await generatePRReport(results); // Update PR with final swarm analysis await updatePRWithResults(report); // Store completion metrics for future optimization await mcp__claude_flow__memory_usage({ action: "store", key: `pr/${results.number}$completion`, value: { completion_time: results.duration, agent_efficiency: results.agentMetrics, quality_score: results.qualityAssessment, lessons_learned: results.insights } }); };
bash# Coordinate merge decision with swarm consensus mcp__claude-flow__coordination_sync { swarmId: "pr-review-swarm" } # Analyze merge readiness with multiple agents mcp__claude-flow__task_orchestrate { task: "Evaluate PR merge readiness with comprehensive validation", strategy: "sequential", priority: "critical" } # Store merge decision context mcp__claude-flow__memory_usage { action: "store", key: "pr$merge_decisions/#{pr_number}", value: { ready_to_merge: true, validation_passed: true, agent_consensus: "approved", final_review_score: 9.2 } }
See also: swarm-issue.md, sync-coordinator.md, workflow-automation.md
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-11 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 20 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +73 percentage points is the difference between those two pass rates over the 20 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.