feat(skills): add pr-swarm parallel PR-loop skill + command - #84
Merged
Conversation
Drives two or more already-open, file-disjoint pull requests to merge-ready concurrently: one isolated git worktree and one independent headless Claude Code session per PR, with no cross-lane diff or feedback leakage. Owns the deep mechanics: PR resolution and author checks, a mandatory changed-file independence check that hard-stops on any overlap before touching git state, branch/worktree-name inference from headRefName, claude -p launch mechanics (references/launch-mechanics.md), verification gates covering stale mergeStateStatus, body-only bot reviews, and stale statusCheckRollup entries (references/verification-gates.md), and the per-lane task prompt template (references/lane-prompt-template.md). Includes eval cases (2 positive, 3 negative).
Thin argument surface for the pr-swarm skill: /pr-swarm <PR#> [PR# ...] parses PR numbers (with or without a leading #, space- or comma-separated), resolves each against the current repository, and delegates independence checking, worktree naming, launch mechanics, monitoring, and teardown to skills/pr-swarm. A single PR number is valid and still runs the full isolated-worktree path rather than collapsing to inline execution. Includes eval cases (4 positive, 2 negative).
Adds the pr-swarm skill and command entries via scripts/generate_manifest.py. No other packages affected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
pr-swarmskill + command pair: parallelizes two or more already-open, file-disjoint pull requests in the same repository to merge-ready at the same time, each driven by its own isolatedgit worktreeand its own independent headless Claude Code session (claude -p) — no shared context/budget, no cross-lane diff or feedback leakage.Three commits, each independently reviewable:
feat(skills): add pr-swarm parallel PR-loop skill—skills/pr-swarm/SKILL.md+references/{launch-mechanics,verification-gates,lane-prompt-template}.md+evals/cases.yaml. Owns the deep mechanics:gh pr view),state/author checksgit diff --name-onlyon each PR's merge-base) that hard-stops before creating any worktree if two requested PRs touch the same file — never a silent pass-through on the user's own assertion that they're unrelatedheadRefName(conventional-prefix stripping, kebab-case, PR-number disambiguation on collision) — never asks the user to name worktreesclaude -plaunch mechanics: verified flags (--strict-mcp-config,--permission-mode bypassPermissions,--no-session-persistence,--session-id), the lack of a CLI timeout flag (external watchdog required), the zombie-PID liveness-check trap, and an explicitly flagged unverified caveat around background-process survival across tool-call boundaries — documented as an open risk to smoke-test, not asserted as factmergeStateStatus/mergeable(verify withgit merge-treebefore trusting "conflicting"), the body-only bot-review gap (reviewThreadsalone misses findings embedded in a review's raw body with no inline comment), stalestatusCheckRollupentries from superseded reruns, and the closed-PR trap (every other field can look healthy on a closed PR)feat(commands): add pr-swarm slash-command wrapper—commands/pr-swarm/COMMAND.md+evals/cases.yaml. Thin argument surface only:/pr-swarm <PR#> [PR# ...]parses PR numbers (with or without#, space- or comma-separated), resolves each against the current repo, and delegates everything else toskills/pr-swarmvia a declaredcommand.dependenciesentry (mirrors the existingstack-pr/stacked-prsandhandoff/handoffsame-name command+skill pairing already in this repo). A single PR number is valid input and still runs the full isolated-worktree path — no inline fast path that would silently drop the session-isolation guarantee.chore: regenerate manifest for pr-swarm packages—manifest.yamlviascripts/generate_manifest.py. Adds exactly the two new entries; no other package touched.Design notes worth flagging for review
claude -pheadless mode, not any other agent CLI — matches this repo's stated Claude Code/Claude.ai scope (see prior issue Docs idea: quick-try link for agent-builder #79 precedent) and the existingagent-builderskill's own headless-mode guidance.references/launch-mechanics.mdexplicitly documents one mechanic as unverified: whether Claude Code's Bash tool preserves anohup/disown-backgrounded child across tool-call/turn boundaries. No authoritative source was found either way; the skill instructs checking liveness a minute+ after launch (not immediately) and treats unexpected mid-run death as evidence worth investigating rather than silently retrying. This should be smoke-tested against a real multi-minute run before being treated as settled.Skill Evaluator Results
skills/pr-swarm(viascripts/evaluate_package.py):commands/pr-swarm:Zero CRITICAL/HIGH findings on either package.
Checklist
SKILL.mdandCOMMAND.mdboth have valid YAML frontmatter withnameanddescriptionpr-swarm)uv run python scripts/validate_evals.pyanduv run scripts/generate_manifest.pyboth pass cleanreferences/*.md) resolve to existing files withinskills/pr-swarm/../references; the only inter-package link iscommand.dependencies: [skills/pr-swarm], matching the existingstack-pr/stacked-prsconvention