/github-workflows:pr-sweepfrom github-workflows
Use when open PRs pile up in one repo or across an owner's repos; triage and drive them through repeated rounds until no open in-scope PR created more than 24 hours ago remains.
Ships in github-workflows. 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.
Drive open PRs toward zero through repeated rounds: merge what is safe, repair
what is cheaply repairable, and give every other stale PR an owner, next action,
and wake condition. This is triage-and-clear on open PRs;
/prune-branches --sweep acts on repo/worktree state and is a different job.
This skill decides which PRs move and in what order. It never
reimplements merging: each merge is delegated to /merge-pr, each repair to
/finalize-pr.
createdAt is older than 24 hours.These five hold in every mode. They are the difference between a sweep and a stampede.
Never pass --admin. Never merge a draft. Never bypass a failing check —
repair it or route it to ESCALATE or HANDOFF.
State warning: PR status, CI, and mergeability change constantly, and
mergeable/mergeStateStatusare computed lazily — a first query often returnsUNKNOWN. Re-query before classifying, and never act on a list gathered earlier in the session.
/merge-pr resolves the merge method from the repo's capabilities and the
target branch. For branch and PR-target conventions, follow the
Git Town rule.
This skill passes no method flag and states no default. A promotion PR into a
production branch goes to /promote-release.
/pr-sweep — open PRs in the current repo./pr-sweep --org <owner> — open PRs across the owner's repos, all
authors. Bot and teammate PRs are usually the bulk of a real pile.--author <login> — optional filter. Do not default to "mine": some token
types (app installation tokens) carry no user identity, so a self-filter
silently returns nothing.Claude project route: run one project thread per repository instead of the local fan-out; see the claude-projects rule.
Command shapes live in gh-cli-patterns. List first, act second, and state
the count before touching anything. Every MERGE verdict must pass the
canonical PR-readiness gate,
including zero unaddressed feedback items and all required checks reported.
Use the PR feedback ledger
for comment, review-body, inline, and review-agent findings.
Run all seven phases in order. Phases 1 and 3 fan out; 0, 2, and 4–6 are the lead's. Each round begins with the cadence gate and reports its starting stale count.
(PR number, head OID) plus ordering constraints.MERGE to /merge-pr, and keep
the slot reserved through Phase 5 CI validation. FIX items go to
/finalize-pr, then back through triage in this round. REVIVE, CLOSE,
and HANDOFF follow the evidence and ownership rules in
references/dispositions.md.develop is ahead of main after merges, run /promote-release;
then run the repo's documented end-to-end or deploy check and move the
consumer deployment file per the promotion follow-through contract. A merge
is not counted done until these validations pass; route a failure to FIX or
ESCALATE and keep the round active.createdAt is older than 24 hours. At zero, emit the final report.
Above zero, refresh the ownership ledger from fresh worker evidence, send at
most one batched human ask, schedule the next round under the cadence rules,
and continue the same workers.The lead does exactly two blocking things: the Phase 2 approval round and the Phase 4–6 closeout, including validation, the Phase 6 re-query, and scheduling. Workers re-derive repo details; the lead does not.
Every PR receives exactly one verdict. Rank up when unsure.
| Verdict | When | Action |
|---|---|---|
| MERGE | Passes the canonical readiness gate, with low blast radius or approved escalation. | /merge-pr, then Phase 5. |
| FIX | One /finalize-pr away from the canonical gate. | Repair, then re-triage in the same round. |
| REVIVE | A local branch or worktree holds unpushed commits that complete the PR and no live session owns it. | Push only from a branch this session owns; then re-triage. |
| CLOSE (superseded / merged-elsewhere / obsolete / empty) | Positive evidence only: empty diff against base, every commit's patch-id already on base, a named merged PR supersedes it, or the change's target no longer exists. | Comment with evidence, close, then delete the remote branch and matching local branch/worktree through /prune-branches. |
| HANDOFF(session) | A live session owns the branch. | Message it and require acknowledgement; keep the PR tracked until closed. |
| ESCALATE | Human judgment or a gate is required. | Ask once per round in the batched escalation; keep the PR tracked. |
CLOSE never rests on age or "could not reproduce"; use the same positive evidence bar as issue-sweep (github-workflows). A PR with a human "do not close" or "do not merge" statement, or a review-gate label, is never closed or merged by the sweep — ESCALATE it.
/promote-release./merge-pr refusal routes to ESCALATE; carry its reason forward verbatim.Every route has an owner, next action, and wake condition. Nothing ends in a terminal hold.
PR Sweep — <scope> — round <n>
Merged: <repo#N> — <title>
Fixed+merged: <repo#N> — <what was repaired>
Closed: <repo#N> — <evidence>
Revived: <repo#N> — <branch>
Handed off: <repo#N> → <session> (ack <timestamp>)
Validated: <repo#N> — <CI / promotion / e2e result>
Escalated: <repo#N> — <question> → <decision>
Repo findings: <broken base | repo-wide gate | infra failure>
Open before → after: <b> → <a>
Stale open (>24h) before → after: <b> → <a>
Emit the final report only when the fresh stale count is zero. Intermediate rounds emit a round report plus the ownership ledger; they are not completion. File follow-ups per the project's issue-routing convention.
Diagnosis, parallel protocol, lazy state, schemas, cadence, ownership, and disposition evidence: references/sweep-mechanics.md and references/dispositions.md.
FIX delegate.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jacobpevans-ai/claude-code-plugins --plugin github-workflows18 skills in this plugin
/finalize-prAutomatically finalize pull requests for merge by resolving CodeQL violations, PR feedback, merge conflicts, and CI failures. Handles single PR (current branch or by number), all open PRs in the repo, or all open PRs across the org. Includes bot-authored PRs in all modes./gh-cli-patternsCanonical reference for all gh CLI command shapes used by skills in this plugin. Defines the placeholder convention, default-branch (trunk vs git-flow) detection, allowed --json fields, GraphQL fallback rules, -f/-F/--raw-field flag semantics, the PR-readiness gate, required status contexts, the feedback ledger, code-scanning alert query, review-thread fetch/count/resolve mutations, and heredoc bodies. Prevents Unknown JSON field errors and divergent query shapes./