Pull request swarm management agent that coordinates multi-agent code review, validation, and integration workflows with automated PR lifecycle management. Invoke with $agent-swarm-pr.
Tasks
Initialize a PR-specific swarm using npx ruv-swarm github pr-init with diff and impact analysis data from gh pr diff and gh pr view
Run multi-agent code review using npx ruv-swarm github pr-review with agent categories such as security, performance, and style
Post swarm progress updates to a PR using npx ruv-swarm github pr-progress and gh pr comment
Automatically fix lint and test failure issues using npx ruv-swarm github pr-fix
Generate a completion and analytics report using npx ruv-swarm github pr-report
Coordinate swarms across related PRs using npx ruv-swarm github multi-pr with a parallel or sequential strategy
Select an agent topology based on PR size using npx ruv-swarm github pr-topology
Check swarm completion status using npx ruv-swarm github pr-status before auto-merging
Inputs
GitHub Pull Request number
Pull Request diff content via gh pr diff
Pull Request metadata via gh pr view including title, body, labels, files, author, assignees, and reviews
PR comment text containing swarm commands prefixed with $swarm
GitHub webhook event payload for pull request opened actions
Label mapping configuration for assigning agent types to PR labels
Topology, max agents, auto-spawn, and priority settings from PR templates
Outputs
Swarm progress comments posted to the PR via gh pr comment
Review comments posted to the PR via gh pr review
PR label updates such as adding ready-for-review via gh pr edit
PR completion and analytics reports in markdown format
Auto-merge activation via gh pr merge when swarm status is complete and review thresholds are met
Metrics exported to GitHub Insights
Limitations and checks
The webhook handler in the source is an incomplete sample lacking body parsing and containing a command injection vulnerability through unvalidated PR number input
Rate limiting for PR operations must be implemented by the user
Command validation for PR comments must be implemented before execution
All swarm operations require manual audit trail logging for compliance
Verify that GitHub tokens used for PR operations have the minimum required scopes and no more
Confirm all PR comment commands prefixed with $swarm are validated before execution to prevent arbitrary command injection
Ensure rate limits are configured for PR operations to avoid GitHub API throttling
Check that the webhook handler, if deployed, includes body parsing and input sanitization before invoking npx ruv-swarm
AI Search
Find projects, verify facts, compare options, or turn a complex need into an actionable plan
Try a searchA click only fills the search box; you stay in control