/agents-skills:pr-cleanupfrom agents-skills
Watches for closed PRs and cleans up: deletes merged local branches, removes spent worktrees, closes linked GitHub/Jira issues, and releases claim locks. Essential when PRs merge to a non-default integration branch where GitHub doesn't auto-close issues.
Ships in agents-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
One job: tidy up after PRs close. When <integration-branch> is not the repo's default branch, GitHub does not auto-close Closes #N issues (the PR lands off the default branch), so closure is manual. Reclaim local disk, close the linked issue, release the lock. Nothing else.
This skill builds on the lock-release protocol in the issue-locking skill (gh-issue-locking for GitHub, jira-issue-locking for Jira) and the worktree/branch hygiene in dispatching-subagents. It adds the single-lane watcher loop and the merged-vs-abandoned close-out split.
Project-agnostic; the adopting project defines these in its own CLAUDE.md. Used here:
| Placeholder | Meaning |
|---|---|
<owner>/<repo> | GitHub repository slug |
<integration-branch> | Branch PRs target; if it is NOT the repo default, Closes #N does not auto-close — closure is manual |
<default-branch> | The repo's default branch (GitHub only auto-closes issues for PRs merged into this) |
<worktree-dir> | Where feature branches live on disk (see dispatching-subagents) |
<claim-lock> | The active-claim marker — a label (agent-claimed) + assignee on GitHub, the equivalent field on Jira (see the issue-locking skill) |
<tracker-key> | Linked tracker reference convention (a GitHub #N, a Jira issue key) |
A single-lane, interval-driven loop — one concern, scanned end-to-end every tick (/loop <interval> start). Distinct from the N-slot event loop in orchestrating-slots and the one-shot pr-rescuer. One watcher per lane; lanes do not cross.
This lane is light and read-mostly — cleanup is bounded shell + tracker API. Run it on the workhorse tier and delegate noisy scans (branch lists, worktree audits) to the cheap tier (caveman:cavecrew-investigator, or a fixed command parsed), keeping output compressed. It writes no application code, so there is no fix-sub-agent slot count here.
You OWN: deleting merged local branches, removing spent <worktree-dir>/* worktrees, closing linked issues on merge, releasing the <claim-lock> (removing the claim marker + clearing assignee).
You do NOT touch: dispatching issues (the dispatch lane — dispatching-subagents / orchestrating-slots), CI/conflicts/queue (the pr-checks lane), open review threads (the pr-comments lane), deploy/infra health (a deploy lane, if your fleet runs one). Act on closed PRs only (MERGED or closed-unmerged) — never on open PRs, and never force a merge.
Agent PR (shared definition across lanes): a closed PR — merged OR closed-unmerged — whose author OR assignee = your login (gh api user --jq .login). Scope to YOUR login only; never clean another operator's branches/worktrees/issues.
Closes #N) and/or transition the Jira issue to its done state, remove the <claim-lock> claim marker, clear the assignee, post a brief closing note.git worktree remove the spent worktree under <worktree-dir>, prune.dispatching-subagents). When unsure, skip and report; do not delete.GitHub auto-closes an issue from Closes #N only when the PR merges into <default-branch>. Fleets that integrate on a separate <integration-branch> never trigger that — so without this lane, merged issues stay open, claim locks go stale, and the dispatch lane re-picks zombie issues that are already done. Closing on merge is therefore mandatory here, not optional. (Same reasoning as the close-on-merge sweep in orchestrating-slots; this lane is the dedicated watcher form of it.)
This lane runs in a repetitive loop. Operate in caveman mode (load the caveman skill) for working output. Delegate noisy scans (branch lists, worktree audits) to the cheap tier and parse a fixed command's output rather than reading it whole.
Report per tick: closed N (merged M / abandoned A), issues closed: #x, locks released: #y, branches/worktrees removed: K.
Caveman compresses prose only — never machine-precise content: gh/git/tracker commands, label and field names, the <claim-lock> markers, <tracker-key> references stay byte-exact. The closing comment a human reads is the exception: write it normally, through the humanizer skill.
Nothing closed-and-uncleaned → nothing to clean and end the tick. The loop re-fires on its interval.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pr-cleanup, post-merge, worktree-cleanup, branch-cleanup, issue-closure
npx claudepluginhub skyfox675/agents-skills --plugin agents-skills32 skills in this plugin
/browser-diagnosisReproduce and root-cause a front-end bug in a real browser using whichever browser MCP is connected — Chrome (claude-in-chrome), Playwright, Cypress, or Chrome DevTools — not just one. Drive the page as the signed-in user, watch the network and console, capture the failing request/response, shim/mock to isolate the fault, and record a repro, then hand the evidence to the issue being filed. Use whenever a symptom needs live-browser evidence (the toast says failed but it saved, a column shows zero, a click 404s) and from the /…-use-browser command family (and the engine-pinned /…-use-chrome, /…-use-playwright, /…-use-cypress variants), the /…-use-aws-browser commands, and the diagnostician agent. Picks the available MCP automatically and degrades gracefully when none is connected./cavemanUltra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested./ci-flake-huntingThe authoritative method for hunting, root-causing, and fixing CI flakes so the merge queue stops ejecting correct PRs and churn drops. A flake is a test that fails then passes on retry with NO code change explaining it — every red speculative merge-queue build ejects a correct PR and disarms its auto-merge, so a live flake taxes every PR behind it. Encodes the loop — MINE CI history for real flakes → REPRODUCE harsher-than-CI → ROOT-CAUSE the real mechanism (hydration/render race, settle race, mock-order, loading-state race, click-through fragility) → FIX FORWARD (test or component, never mask) → VERIFY by re-running many times → UNSTICK the PRs the flake stranded → REPEAT. And how to tell a true code flake from transient INFRA (CDN/mirror outage, expired token mid-suite, rate-limit/WAF, external-service cap, cloud state-lock, CI-provider billing/outage, upstream bump) which must NOT be code-fixed. Use whenever chasing CI instability, "deflake this spec", "CI keeps ejecting my PR", "is this a flake or real", a shard that intermittently reds the queue, or running the ci-flake-hunter lane. Distinct from ci-speed-hunting (which owns slow-but-green jobs — flake never touches timing/sharding)./ci-speed-huntingThe authoritative method for hunting, diagnosing, and fixing CI SLOWNESS so the merge queue drains faster and throughput rises — the target is wall-clock latency, NOT correctness (a job that is GREEN but slow). Encodes the loop — MINE CI timing for the real long poles → DIAGNOSE the bottleneck class (under-sharded matrix, cold cache, missing/too-broad path-filter tier, serial needs-chain, redundant rebuild) → PROVE the fix keeps identical coverage → FIX FORWARD → VERIFY the before/after delta at unchanged coverage → REPEAT. And the hard line — speed comes from doing the same work faster or skipping PROVABLY irrelevant work, NEVER from deleting tests, narrowing greps, dropping shards, or removing a gate. Use whenever chasing CI latency, "CI is too slow", "speed up the checks", "why does the merge queue take so long", re-sharding an E2E matrix, adding or fixing a cache, tuning changed-paths tiering, or running the ci-speed-hunter lane. Distinct from ci-flake-hunting (which owns failures and flakes — speed never touches a red job)./deploy-watchingSingle-lane interval watcher that keeps the integration environment's deploys healthy by fixing FORWARD — the deploy-health lane of a multi-agent fleet. Each tick it reads the newest deploy run, locates the red (deploy step vs post-deploy smoke), classifies it transient (concurrent-deploy state-lock race, CI-infra blip, known smoke transient) or real (deterministic IaC error, ordered co-deploy race, regression from a merged commit, contention inside the shared environment), re-runs the former, and mints a forward-fix PR for the latter that preserves the offending commit's intent — never a revert, never a skipped test. Loops on an interval ("/loop <interval> start"). Use when running a deploy lane, when the dev/staging deploy went red after a merge, when deciding whether a red deploy needs a re-run or a code fix, when the environment may be running stale code, or when `pr-checks` hands over a failure rooted in the integration branch rather than a PR's diff./dispatching-subagentsTurn a groomed tracker issue into a running implementation sub-agent and a merged PR — issue selection (priority, file-disjointness, bundling), model/effort resolution from chat > labels > defaults, the eight-section dispatch brief (worktree, toolchain prefix, pre-push hygiene, scope, git discipline, PR procedure, return contract), parallel dispatch under a concurrency cap, stalled-agent worktree salvage, and verify-then-trust completion checks. Use whenever you are about to spawn a sub-agent (Agent/Task tool call) to implement, fix, refactor, test, or otherwise write code from a tracker issue — even if the user only says "work the next issues", "fix these bugs", "run the loop", or "send an agent at #N" without saying "dispatch"; also use when a dispatched agent stalls, is watchdog-killed, returns status:failed, or reports completion and you must decide whether to salvage its worktree, re-dispatch, or verify its PR.Other plugins' skills for the same job