/agents-skills:pr-checksfrom agents-skills
Interval-driven watcher that keeps open agent PRs green and mergeable by detecting CI failures, merge conflicts, and merge-queue failures. Scans all PRs each tick and dispatches fixes for failing checks, dirty branches, and poison-pill PRs that stall the queue.
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: green checks + clean mergeability. Find failing CI, merge conflicts, and merge-queue failures on open agent PRs and get them fixed. Nothing else.
The critical insight this lane exists for: head-green does NOT mean queue-green. A PR can pass its own head checks (against an older base) yet fail the merge_group run that actually gates the merge. Reading only statusCheckRollup is blind to that whole class of failure — and that blindness is exactly how one poison-pill PR stalls the queue for hours.
This skill builds on the shared PR mechanics in driving-prs-to-merge (the mergeStateStatus table, CI transient-vs-real classification, the conflict/DIRTY cheap-first ladder, merge-queue operations, force-push discipline). It adds the single-lane watcher loop and the full merge-queue health protocol on top.
Project-agnostic; the adopting project defines these in its own CLAUDE.md (the full set lives in driving-prs-to-merge). Used here:
| Placeholder | Meaning |
|---|---|
<owner>/<repo> | GitHub repository slug |
<integration-branch> | Branch PRs target and the queue merges into |
<required-checks> | Names of the merge-gating CI checks (the rollup check and its inputs) and the workflow that runs them |
<local-gate> | The full local verification command CI mirrors (lint + typecheck + tests) |
<merge-strategy> | Allowed strategy flag — and whether a merge queue governs <integration-branch> |
<flake-ledger> | Where known-flaky jobs are tracked; absent → degrade to "retry twice on same SHA" |
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.
Slots = max fix sub-agents running at once — NOT a cap on PRs scanned. Scan EVERY agent PR each tick; if more PRs are red/conflicting than you have slots, queue the rest for next tick — never leave a red PR unwatched. Small fixed default (≈2 for this lane), tuned to the machine; a slots=N token in the start prompt overrides.
You orchestrate; you do not diagnose-by-editing or write fixes yourself. Delegate per MODEL-DEFAULTS.md:
caveman:cavecrew-builder for ≤2-file fixes). Never the cheap tier for code.gh/grep/ls, a path lookup, caveman:cavecrew-investigator locating failing code). The gh / gh api graphql queue commands below you run yourself — they are cheap and you are the brain reading their output.agent-model:/agent-effort: label — never self-escalated (see gh-issue-labels / jira-issue-fields).Run the loop on the workhorse tier. Merge-queue diagnosis (head-green ≠ queue-green, poison-pill vs flake, ejected vs never-armed, wedge detection) is the highest-attention reasoning in this lane and the one place to consider operator-gated premium escalation — never on your own.
You OWN: failing required checks (<required-checks>), merge_group (queue) CI failures, poison-pill PRs, and queue ejections, DIRTY/conflicting PRs, branches behind <integration-branch>.
You do NOT touch: dispatching new issues (the dispatch lane — dispatching-subagents / orchestrating-slots), review/bot comment threads (the pr-comments lane), merged-PR cleanup (the pr-cleanup lane), deploy/infra health (a deploy lane, if your fleet runs one). Notice one → ignore, not yours.
Agent PR (shared definition across lanes): an open PR whose author OR assignee = your login (gh api user --jq .login). Scope every scan to YOUR login only; never touch another operator's PRs.
gh pr view <PR#> --json statusCheckRollup,mergeStateStatus,autoMergeRequest.driving-prs-to-merge. Dispatch a workhorse sub-agent to fix on the PR branch; push; let CI re-run. Never --admin, never --no-verify, never skip-label past a real failure.<integration-branch> / UNMERGEABLE queue entry → sync by merge, not rebase (git merge origin/<integration-branch>) when the project's pre-push hook rejects rebased PR branches and these PRs carry do-not-rebase; otherwise follow the cheap-first DIRTY ladder in driving-prs-to-merge. Re-push through the hook (full <local-gate>); never bypass.
pr-comments lane is also pushing a review fix to this branch, don't push concurrently — re-merge origin/<branch> before pushing, never force-push its commits.<flake-ledger>) → re-run the check before touching code. See the transient-vs-real classification in driving-prs-to-merge.<integration-branch>, not this PR's diff (a broken-base regression that fails every PR) → hand to the deploy/infra lane if your fleet separates deploy health; that is not this lane's to fix. Per-PR stuck/recurring → escalate per the stuck-PR triage in driving-prs-to-merge.Only relevant when a merge queue governs <integration-branch> with ALLGREEN grouping (any one failure drops the whole group). Reading only head statusCheckRollup is blind to all of it — and that blindness is how PRs sit stuck for hours.
gh-readonly-queue/<integration-branch>/pr-<N>-<sha> branch — the PR squashed onto current <integration-branch>. A PR can pass its own head checks (against an older base) yet fail the merge_group run (classic: a typecheck error that only appears against the current base). The merge_group result, not the head check, is the real merge gate.CLEAN but unqueued and unarmed — green-looking, going nowhere. One poison-pill PR (or one bad title) stalls the entire queue.Run all four EVERY tick:
A. Find poison pills (failed merge_group runs).
gh run list --repo <owner>/<repo> --event merge_group --workflow "<required-checks-workflow>" \
--status failure --limit 10 --json headBranch,createdAt
# headBranch = gh-readonly-queue/<integration-branch>/pr-<N>-<sha> → that PR N failed the QUEUE run
A PR whose merge_group run failed (not cancelled — see C) is a poison pill. Confirm real, not flake — a flake is the same head SHA with both a pass AND a fail, so fetch every conclusion for that SHA (drop the status filter):
SHA=$(gh pr view <PR#> --repo <owner>/<repo> --json headRefOid --jq .headRefOid)
gh run list --repo <owner>/<repo> --event merge_group --workflow "<required-checks-workflow>" --limit 40 \
--json headSha,conclusion --jq "[.[]|select(.headSha==\"$SHA\")|.conclusion]"
# contains BOTH "success" and "failure" → flake → gh run rerun, do NOT dequeue or code-fix
# only "failure" (no success for this SHA) → real poison pill → proceed
For a real merge_group failure:
--disable-auto alone does NOT dequeue):
gh pr merge <PR#> --disable-auto
ID=$(gh api graphql -f query='query($o:String!,$r:String!,$n:Int!){repository(owner:$o,name:$r){pullRequest(number:$n){id}}}' -f o=<owner> -f r=<repo> -F n=<PR#> --jq '.data.repository.pullRequest.id')
gh api graphql -f query='mutation($id:ID!){dequeuePullRequest(input:{id:$id}){clientMutationId}}' -f id="$ID"
origin/<integration-branch> in first — the failure is usually a semantic conflict with the current base (typecheck, mock drift) the head run never saw.gh pr ready <PR#> --undo). A draft cannot re-enter the queue, so a sibling lane re-arming on green head checks can't re-poison. Mark ready (gh pr ready <PR#>) when fixed.B. Re-arm innocent ejected PRs. CLEAN + no mergeQueueEntry + no autoMergeRequest is not enough — those three read identically for a PR ejected from the queue AND for a brand-new PR the pr-comments lane has not armed yet (review threads still pending). Arming the latter races the comments lane and can merge before review. Discriminator: an ejected PR has a merge_group run for its current head SHA (the run cancelled/failed when its group dropped); a never-armed PR has no merge_group history at all. Re-arm only when ALL hold:
SHA=$(gh pr view <PR#> --repo <owner>/<repo> --json headRefOid --jq .headRefOid)
gh run list --repo <owner>/<repo> --event merge_group --json headSha,conclusion \
--jq "[.[]|select(.headSha==\"$SHA\")]|length" # >0 → was queued → ejected; 0 → never-armed, NOT yours
pr-comments lane's).gh pr merge <PR#> --auto (NO --squash/strategy flag — a merge queue REJECTS it and silently drops enrollment).A PR with zero merge_group history is never-armed, not ejected → leave it to the pr-comments lane's initial arm-after-review; do not touch it. This rule is the re-arm-after-ejection case only.
C. cancelled ≠ failed. A cancelled merge_group run is collateral from another PR's group-drop (the cancel-on-destroy workflow), NOT this PR's fault. Do not treat it as a poison pill — treat the PR as an innocent ejection (rule B).
D. UNMERGEABLE / wedged entries. mergeStateStatus/autoMergeRequest lie when enqueued; the only definitive queue state is GraphQL:
gh api graphql -f query='query($o:String!,$r:String!,$n:Int!){repository(owner:$o,name:$r){
pullRequest(number:$n){ mergeQueueEntry{ state position enqueuedAt } } } }' -f o=<owner> -f r=<repo> -F n=<PR#>
state == UNMERGEABLE → conflict against base → dequeue + merge origin/<integration-branch> (step 4) or draft. Wedged: state == AWAITING_CHECKS with enqueuedAt more than ~30 min ago and no merge_group run started → dequeue → gh pr update-branch → re-arm. Compute the age from enqueuedAt with your platform's date arithmetic (e.g. on BSD/macOS date -j -f %Y-%m-%dT%H:%M:%SZ).
Title-format trap: a single bad PR title (e.g. 2+ leading caps, if the ruleset gates on title format) boots the entire merge group it shares. If a group keeps dropping with no failing test, check titles and fix via API edit: gh api -X PATCH repos/<owner>/<repo>/pulls/<PR#> -f title='<lowercase conventional>'.
This lane runs in a high-volume, repetitive loop. Operate in caveman mode (load the caveman skill) for all working output. Delegate diagnosis + edits to sub-agents (or caveman:cavecrew-investigator to locate failing code) so noisy logs stay out of your context.
Report per tick: PRs N, head-red: #x (fix dispatched), conflict: #y, poison-pill: #z (dequeued+drafted), re-armed ejected: #w, queue: healthy/thrashing.
Caveman compresses prose only — never machine-precise content: every gh/gh api graphql command, the queue-state names (UNMERGEABLE/AWAITING_CHECKS/cancelled/failure), file:line refs, code blocks stay byte-exact. Commit messages and PR-body prose: write normally, through the humanizer skill.
All scanned PRs green at both layers (head checks AND merge_group), no poison pill sitting in the queue, every innocent ejection re-armed → queue healthy and end the tick. The loop re-fires on its interval. Note: head-green-only is NOT a stop condition — a green head with a failing/absent merge_group result still needs action.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pr-checks, merge-queue, ci-watcher, multi-agent, github-actions
32 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.npx claudepluginhub skyfox675/agents-skills --plugin agents-skillsOther plugins' skills for the same job