Finishing a Development Branch
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
Parallelizes two or more independent "own PR to green" loops for a single repository using isolated git worktrees and separate headless Claude Code sessions per PR — resolving merge conflicts…
$ npx skills add Mathews-Tom/armory --skill pr-swarm -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Mathews-Tom/armory pr-swarm --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pr-swarm .claude/skills/pr-swarm && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "pr-swarm" agent skill from https://github.com/Mathews-Tom/armory/tree/main/skills/pr-swarm into .claude/skills/pr-swarm/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pr-swarm", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Mathews-Tom/armory/tree/main/skills/pr-swarmType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Mathews-Tom/armory --skill pr-swarm -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Mathews-Tom/armory pr-swarm --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/pr-swarm .agents/skills/pr-swarm && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "pr-swarm" agent skill from https://github.com/Mathews-Tom/armory/tree/main/skills/pr-swarm into .agents/skills/pr-swarm/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pr-swarm", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Mathews-Tom/armory --skill pr-swarm -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Mathews-Tom/armory pr-swarm --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/pr-swarm .cursor/skills/pr-swarm && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "pr-swarm" agent skill from https://github.com/Mathews-Tom/armory/tree/main/skills/pr-swarm into .cursor/skills/pr-swarm/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pr-swarm", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Mathews-Tom/armory.git --path skills/pr-swarm--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Mathews-Tom/armory --skill pr-swarm -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Mathews-Tom/armory pr-swarm --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/pr-swarm .gemini/skills/pr-swarm && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "pr-swarm" agent skill from https://github.com/Mathews-Tom/armory/tree/main/skills/pr-swarm into .gemini/skills/pr-swarm/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pr-swarm", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Mathews-Tom/armory pr-swarmInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Mathews-Tom/armory --skill pr-swarm -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/pr-swarm .github/skills/pr-swarm && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "pr-swarm" agent skill from https://github.com/Mathews-Tom/armory/tree/main/skills/pr-swarm into .github/skills/pr-swarm/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pr-swarm", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Mathews-Tom/armory --skill pr-swarm -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Mathews-Tom/armory pr-swarm --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/pr-swarm .opencode/skills/pr-swarm && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "pr-swarm" agent skill from https://github.com/Mathews-Tom/armory/tree/main/skills/pr-swarm into .opencode/skills/pr-swarm/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pr-swarm", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
pr-swarmParallelizes two or more independent "own PR to green" loops for a single repository using isolated git worktrees and separate headless Claude Code sessions per PR — resolving merge conflicts…
PR Swarm is an agent skill from Mathews-Tom/armory. Parallelizes two or more independent "own PR to green" loops for a single repository using isolated git worktrees and separate headless Claude Code sessions per PR — resolving merge conflicts, clearing review feedback, and watching CI to completion without one PR's diff or feedback leaking into another's context. Triggers on: "parallelize these PRs", "drive PR 123 and 456 to green in parallel", "own-PR-to-green fleet", "run these PRs concurrently", "isolated worktree loops for my PRs", "pr-swarm". Use this skill…
Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `evals/cases.yaml`, `references/lane-prompt-template.md` and `references/launch-mechanics.md`).
It sits in Development, covering Git worktrees, Pull requests and Git workflow. The repository describes itself as: Curated, production-grade skills for AI coding agents. Battle-tested workflows for developers who use AI seriously. The licence is MIT.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4594fb7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitghclaudeFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
PR Swarm loads about 3.3k tokens when it runs, and up to ~7.8k if it reads all its reference files. Until then it costs about 196 tokens; SKILL.md has 1,523 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from Mathews-Tom/armory at commit 4594fb7, republished under its MIT licence (© Mathews-Tom). 1,523 words, ~3,265 tokens.
.claude/skills/pr-swarm/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.A repository checkout can only have one branch active at a time. A user with N independent, already-open pull requests — disjoint branches, disjoint changed files, no real relationship between them — that each need conflict resolution, review-feedback triage, and CI watching wastes wall-clock time driving them one after another when nothing about them actually depends on each other.
git worktree removes the one-checkout constraint: N branches can be checked out simultaneously, each in its own directory, sharing one .git object store. Combined with N independent headless Claude Code sessions (own process, own context window, own token budget — not subagents sharing this session's budget), the PRs can be driven to green concurrently with zero cross-talk.
| File | Contents | Load When |
|---|---|---|
references/launch-mechanics.md | claude -p flags, detached background launch pattern, watchdog/liveness checks, exit-code capture | Phase 5 (Launch) |
references/verification-gates.md | GitHub API correctness pitfalls: stale mergeStateStatus, body-only bot reviews, stale statusCheckRollup entries, review-thread pagination, reacting to the first failing check instead of waiting for the full CI matrix | Phase 6 (Monitor & Verify) |
references/lane-prompt-template.md | The literal per-lane task prompt (termination conditions, orientation, conflict resolution, watch loop) | Phase 4 (Lane Prompt) |
This skill drives PRs that are already open. It does not create PRs from issues, does not decide whether unrelated PRs are safe to parallelize (that's Phase 2, and it's a hard stop on any real overlap, not a judgment call this skill makes silently), and does not resolve PRs closed by a maintainer for policy reasons — see "Mid-loop external closure" in Phase 6.
For every requested PR number N:
gh pr view N --json number,state,headRefName,baseRefName,author,url,isCrossRepositorystate != OPEN → drop this PR from the swarm and report why; do not silently skip it.isCrossRepository == true (PR from an unrelated fork, not the user's own) → flag for confirmation before proceeding; this skill assumes the invoker's own fork/branch setup.gh api user --jq .login vs. author.login. Mismatch is a warning, not a stop — co-driving a teammate's PR is legitimate, but the invoker should see it flagged.Do this before creating any worktree. A user asserting "these are unrelated" is not proof — verify the actual changed files:
for N in "${PRS[@]}"; do
base="$(gh pr view "$N" --json baseRefName -q .baseRefName)"
head="$(gh pr view "$N" --json headRefName -q .headRefName)"
git fetch origin "$head:refs/remotes/origin/$head" --quiet
merge_base="$(git merge-base "origin/$base" "origin/$head")"
files["$N"]="$(git diff --name-only "$merge_base" "origin/$head")"
donePairwise-intersect files[N] against files[M] for every pair in the requested set. Any non-empty intersection → stop, report exactly which files and which two PRs collide, and ask before proceeding — running two lanes that touch the same file concurrently is exactly the failure mode this skill exists to prevent, not something to wave through because the user said it was fine.
Short name derivation from each headRefName:
raw="$head" # e.g. feat/status-line-token-count
short="${raw#*/}" # strip one leading "<type>/" segment if present
short="$(echo "$short" | tr '[:upper:]_' '[:lower:]-' | tr -s '/' '-')"
[[ -n "${used[$short]:-}" ]] && short="${short}-${N}" # disambiguate collisions with the PR number
used["$short"]=1Worktree directory convention: check bunfig.toml / lockfile config / .gitignore for an existing .worktrees/** or .wt/** pattern first — that is the project's own sanctioned convention if present. Default to .worktrees/<short>/ when nothing is declared. Free the main checkout first if it currently holds one of the target branches (git switch main or another branch outside the set — a branch can be checked out in only one worktree).
git worktree add ".worktrees/$short" "$head"Per-worktree install is mandatory under a hoisted linker (check bunfig.toml for linker = "hoisted", or npm/yarn without workspaces hoisting): node_modules is not shareable across worktrees since each can have a different lockfile state. Run installs for all lanes in parallel, not serially.
Gitignored build artifacts don't come back with a fresh worktree checkout — native addons, generated code, compiled binaries. If the repo has any (check for *.node, .wasm, generated protobuf/codegen output, or a documented build step), rebuild or relink them per worktree before running tests; a lane that skips this fails with a confusing "module not found" that looks unrelated to its actual task.
Render references/lane-prompt-template.md per PR, substituting {PR_NUMBER}, {REPO} (owner/name), {WORKTREE_PATH}, and {OTHER_PR_NUMBERS} (the rest of the swarm, so the lane's own COI instruction is concrete, not abstract). Write each rendered prompt to a file in the worktree ($WORKTREE/.pr-swarm-prompt.md) rather than passing it inline — a multi-hundred-word prompt through shell quoting is a real failure mode, a file path is not.
See references/launch-mechanics.md for the exact claude -p invocation, detachment pattern, and liveness-check mechanics. One lane per PR, launched independently — never chain multiple launches in a single tool call (each launch needs its own call so a launch failure for lane 2 doesn't silently ride on lane 1's success).
Poll every ~60-120s with jitter: tail each lane's log, check liveness (see references/launch-mechanics.md for the zombie-PID trap). Never treat a lane's own self-reported completion as the gate. After a lane's process exits, independently re-verify via the checks in references/verification-gates.md — merge state, CI conclusion, unresolved review threads (including body-only bot reviews), and current state (a maintainer-closed PR looks identical to a healthy one on every other field).
A lane inheriting a PR that already has red CI or open feedback at launch is normal input, not a swarm-level stop condition — the independence check (Phase 2) governs whether the swarm proceeds, not the target PR's current health. Each lane's own orientation and watch loop react to that starting state directly (see references/lane-prompt-template.md): fix what's already visible first, and react to the first individually-failing check rather than waiting for every check in a CI run to finish, or for an admin-gated gh run rerun that a non-admin lane can't invoke anyway (see "React to the first failing check, not the full matrix" in references/verification-gates.md).
Per PR: final state/mergeStateStatus, CI conclusion, unresolved-thread count (including the body-only-review scan), worktree clean/dirty, lane process exit code. A lane that exited non-zero, or whose PR isn't independently confirmed clean by the checks above, is reported unresolved — a lane's own "done" message is never sufficient on its own.
Only after every lane is externally confirmed clean:
git worktree remove ".worktrees/$short"Leave any unresolved PR's worktree in place for continued work. Removing a worktree just because the batch finished, while that one PR is still dirty, destroys debugging context for no benefit.
Report structure, filled in per swarm run:
## Resolution
#{N}: {short-name} — {state}, author={login}{, author mismatch flagged if applicable}
...
## Independence check
PASS — no changed-file overlap across {PRS}
(or)
STOP — #{N} and #{M} both touch {path}; resolve before proceeding
## Worktrees
#{N} → .worktrees/{short-name} (branch {headRefName})
...
## Fleet status
| PR | state | mergeStateStatus | CI | unresolved threads | worktree | exit code |
|---|---|---|---|---|---|---|
## Teardown
#{N}: removed / left in place (reason)A PR missing from the "Fleet status" table (dropped in resolution or blocked by the independence check) must still appear in "Resolution" with the reason — never silently omitted from the report.
pr-swarm with exactly one PR still runs the full worktree-and-own-session path — no fast path that skips isolation. The value being delivered (own session, own context/budget, no shared state with the invoking conversation) doesn't depend on fan-out width; collapsing back to inline execution for N=1 would silently drop the one guarantee that was asked for.
bun/npm/test-suite runs is the real resource cost, not git or the GitHub API. Confirm core/RAM headroom before fanning out wide; on constrained machines, have lanes run targeted tests per iteration and reserve full suites for the final gate.node_modules (or equivalent) under a hoisted linker. Budget accordingly — this is the correct tradeoff for true isolation, not a shortcut to avoid.| Problem | Resolution |
|---|---|
| PR number not found / no read access | Drop from swarm, report, continue with the rest |
PR state != OPEN | Drop from swarm, report why, do not attempt to reopen |
| Two or more PRs share a changed file (Phase 2) | Stop before creating any worktree; report the exact overlap and ask |
| Branch already checked out in the main worktree | git switch it away before git worktree add |
| Worktree directory already exists from a prior run | Reuse it if the branch matches; otherwise stop and ask (don't silently overwrite) |
| Hoisted-linker install fails in one lane | That lane's setup fails independently; other lanes proceed unaffected |
| PR already has failing CI checks or unresolved feedback when the swarm launches | Not a stop condition — the lane starts by fixing what's already visible instead of waiting on a clean baseline (see references/verification-gates.md) |
gh not authenticated, or missing repo/workflow scopes | Stop before Phase 1 — nothing downstream can function without it |
state, not a cached read from earlier in the runreferences/verification-gates.md), not just reviewThreadsgh pr view re-checkreviewThreads.isResolved == false as the complete unresolved-feedback signal without also scanning review bodiesgh run rerun, before reacting to a check that already failed or feedback that already landed© Mathews-Tom, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (references) in skills/pr-swarm of Mathews-Tom/armory.
Open the folder on GitHubat commit 4594fb7
PR Swarm next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| PR Swarm this skillMathews-Tom/armory | 329 | — | ~3.3k | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 297k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Codewhale Landing Workflowcodewhale-hq/Codewhale | 41k | — | ~1.6k | Automated safety check: Pass | MIT | |
| Clean Complete Branchesjtenniswood/espcontrol | 1.1k | — | ~820 | Automated safety check: Pass | Custom licence | |
| Cleanup Complete Branchesjtenniswood/esphome-media-player | 234 | — | ~670 | Automated safety check: Pass | Custom licence | |
| Squad Git Branching Workflowmicrosoft/waza | 1.4k | 4 repos | ~1.5k | Automated safety check: Pass | MIT |
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
codewhale-hq/Codewhale
Decides how verified work should reach main, directly, in a worktree or on an integration branch, while keeping contributor credit and respecting merge gates.
jtenniswood/espcontrol
Clean up completed Git branches and worktrees for this repository both locally and on GitHub.
jtenniswood/esphome-media-player
Clean up completed Git branches and worktrees for this repository, both locally and on GitHub.
microsoft/waza
Dev-first branching model for the Squad project: feature work branches from dev, issue branches follow a naming rule and parallel issues use git worktrees.
EliasOulkadi/shokunin
Automate the complete Git development workflow — create feature branches with conventional naming, atomic commits with conventional commit messages, interactive rebase, squash merges, PR body…
Mathews-Tom/armory
Architecture reviews across 7 dimensions (structural, scalability, enterprise readiness, performance, security, ops, data) with scored reports.
Mathews-Tom/armory
Turn concepts into static HTML visuals exported as PNG or SVG files via HTML/CSS/SVG.
Mathews-Tom/armory
A skill your agent uses when analyzing an existing video URL or local recording: "watch this video", "analyze youtube video", "summarize this video", "youtube transcript", "find this moment", "what…
Mathews-Tom/armory
Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.
Mathews-Tom/armory
Turn concepts into animated explainer videos using Manim (Python) with MP4/GIF output, audio overlay, multi-scene composition.
Mathews-Tom/armory
Maps the unresolved architecture, policy, and scope decisions that must be answered before planning can start: one durable decision ticket per question on the issue tracker, typed and blocker-linked…
Categories
Parallelizes two or more independent "own PR to green" loops for a single repository using isolated git worktrees and separate headless Claude Code sessions per PR — resolving merge conflicts…. PR Swarm is an agent skill from Mathews-Tom/armory. Parallelizes two or more independent "own PR to green" loops for a single repository using isolated git worktrees and separate headless Claude Code sessions per PR — resolving merge conflicts, clearing review feedback, and watching CI to completion without one PR's diff or feedback leaking into another's context.
PR Swarm fits situations like: : parallelize these PRs; drive PR 123 and 456 to green in parallel; own-PR-to-green fleet; run these PRs concurrently.
Run `npx skills add Mathews-Tom/armory --skill pr-swarm -a claude-code`. Or copy the skill folder (skills/pr-swarm in Mathews-Tom/armory) into .claude/skills/pr-swarm in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Mathews-Tom/armory --skill pr-swarm -a codex`. Or copy the skill folder (skills/pr-swarm in Mathews-Tom/armory) into .agents/skills/pr-swarm in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Mathews-Tom/armory --skill pr-swarm -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pr-swarm, .gemini/skills/pr-swarm, .github/skills/pr-swarm and .opencode/skills/pr-swarm in your project.
Going by SKILL.md and its folder, PR Swarm needs the command-line tools its instructions call (git, gh and claude).
SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
PR Swarm is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.5k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with PR Swarm: Finishing a Development Branch (obra/superpowers, 297k stars), Codewhale Landing Workflow (codewhale-hq/Codewhale, 41k stars), Clean Complete Branches (jtenniswood/espcontrol, 1.1k stars) and Cleanup Complete Branches (jtenniswood/esphome-media-player, 234 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Mathews-Tom (a GitHub user) maintains it in Mathews-Tom/armory, which has 329 GitHub stars. The repository holds 80 skills in this directory. The repository was last updated on October 6, 2026.
Source: Mathews-Tom/armory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.