agent-swarm-pr

Coordinates multi-agent swarms for GitHub pull request review, validation, and merge workflows.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill agent-swarm-pr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-swarm-pr
Source: https://github.com/ruvnet/claude-flow/tree/main/.agents/skills/agent-swarm-pr
Command: npx skills add https://github.com/ruvnet/claude-flow --skill agent-swarm-pr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing pull request reviews across large or complex changes requires coordinating multiple reviewers, tests, and validations manually. This Skill automates PR lifecycle management by spawning AI agent swarms that analyze diffs, run reviews, and coordinate merge decisions directly from GitHub pull requests.

Core Features & Use Cases

  • PR-Based Swarm Creation: Initialize agent swarms from PR metadata, diffs, and labels using the gh CLI and ruv-swarm commands, with topology selected by PR size.
  • Automated Code Review: Spawn security, performance, and style review agents that post comments and progress updates back to the PR.
  • Label-Driven Agent Assignment: Map PR labels like bug, feature, or refactor to appropriate agent types for targeted review.
  • Use Case: A large feature PR over 500 lines is opened; the Skill initializes a hierarchical swarm with architect, coder, tester, and security agents, posts review comments via gh CLI, and enables auto-merge once swarm validation passes.

Quick Start

Ask the agent to initialize a swarm for pull request 123, analyze its diff, run a multi-agent review, and post the results as PR comments.

Frequently Asked Questions about agent-swarm-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an AI agent swarm from a GitHub pull request?

Use gh pr view to fetch PR metadata and pipe it into npx ruv-swarm swarm create-from-pr, or run npx ruv-swarm github pr-init with the PR number. The swarm initializes with the PR diff, labels, and files as context.

How do I run swarm commands from PR comments?

Post comments starting with $swarm followed by commands like init, spawn, or status in the PR. A GitHub Actions workflow or webhook handler detects these comments and executes them via npx ruv-swarm github handle-comment.

Can PR labels automatically assign review agents?

Yes, a label-mapping configuration maps labels to agent types, such as bug to debugger and tester, or feature to architect, coder, and tester. Agents spawn automatically when matching labels are applied to the PR.

How does the swarm choose a topology for different PR sizes?

Topology is selected by change size: ring for PRs under 100 lines, mesh for 100-500 lines, and hierarchical for PRs over 500 lines. Run npx ruv-swarm github pr-topology with the PR number to apply this automatically.

Can the swarm auto-merge a pull request after review?

Yes, once swarm status reports complete and the required number of reviews is met, the workflow runs gh pr merge with the --auto --squash flags. Required status checks can enforce swarm completion before merging.

What permissions are needed for PR swarm automation?

GitHub tokens need scopes for reading and writing pull requests, comments, and reviews. The documentation also recommends validating PR comment commands, applying rate limits, and logging swarm operations for audit purposes.