triage-aging-prs
БесплатноБез исполняемых скриптовНе проверенDrive an aging pull-request backlog to zero. Inventories every open PR, finds the STRUCTURAL blockers first (a required check that can never run, a reviewer…
от coalesce-labs★ 20 звёзд на GitHubОб этом скилле
Triage Aging PRs
Drive a stale pull-request backlog to zero without breaking main.
The mistake this skill exists to prevent: grinding through review comments PR by PR while the real blocker is structural. Fix the gate first, or you will do a night's work and merge nothing.
Step 0 — Inventory before you touch anything
Resolve the target repo and its default branch first — both are used throughout. $ARGUMENTS carries --repo owner/name; nothing else reads it, so without this an invocation naming another repo silently operates on the current checkout — and every ruleset mutation and merge below would hit the wrong repository. Likewise a repo whose default branch is master/develop must never be probed as main.
REPO="$(printf '%s' "${ARGUMENTS:-}" | sed -n 's/.*--repo[= ]\([^ ]*\).*/\1/p')"
REPO="${REPO:-$(gh repo view --json nameWithOwner --jq .nameWithOwner)}"
BASE="$(gh repo view "$REPO" --json defaultBranchRef --jq .defaultBranchRef.name)" # never hardcode main
gh pr list --repo "$REPO" --limit 60 \
--json number,title,isDraft,mergeStateStatus,isCrossRepository,createdAt,headRefName \
--jq '.[]|[.number,(if .isCrossRepository then "FORK" else "base" end),.mergeStateStatus,
(if .isDraft then "DRAFT" else "-" end),(.createdAt[0:10]),(.title|.[0:50])]|@tsv' |
sort -k2,2 -k1,1n | column -t
Classify every PR before doing any work. Do NOT treat the raw open count as the goal:
| Class | What it means | Action |
|---|---|---|
| Genuinely stale | Opened well before the current work window | The actual target |
| Fresh | Opened in the last day or two | Steady-state flow, not backlog |
| Draft | isDraft |
Not mergeable by design — exclude |
| Do-not-land | The user has said to leave it | Exclude, and re-check any bulk action against this set |
| Release PR | e.g. release-please's chore: release main |
Outward-facing — the user's call, never auto-merge |
Report the split. "18 open" is meaningless; "3 genuinely stale, 12 opened today, 4 drafts" is a status. A backlog whose count is flat while you merge steadily is not stuck — arrivals are matching your throughput, which is a different problem with a different fix.
Step 1 — Find the STRUCTURAL blocker first
Before any review work, ask: can these PRs merge at all?
1a. What does the branch actually require?
gh api "repos/$REPO/rules/branches/$BASE" --jq '.[]|"\(.type) (ruleset \(.ruleset_id))"'
# ONLY the rulesets this branch actually evaluates. A repo may also hold disabled
# rulesets, or ones targeting tags/other branches, whose rules never apply here —
# printing them identifies requirements that do not exist.
for id in $(gh api "repos/$REPO/rules/branches/$BASE" --jq '[.[].ruleset_id]|unique|.[]'); do
gh api "repos/$REPO/rulesets/$id" --jq '.rules[]|select(.type=="required_status_checks")|.parameters'
gh api "repos/$REPO/rulesets/$id" --jq '.rules[]|select(.type=="pull_request")|.parameters'
done
Two traps:
- Rulesets vs classic protection.
branches/main/protectionreturning 404 "Branch not protected" does NOT mean unprotected — modern repos use Rulesets (Settings → Rules → Rulesets). Query/rules/branches/$BASE, which reports what actually applies. - Thread resolution hides inside
pull_request.required_review_thread_resolutionis a parameter of thepull_requestrule, not a rule type. Filtering by.typemisses it and you will wrongly conclude threads don't block.
1b. Compare a fork PR's checks against a base PR's
gh pr view <BASE_PR> --repo "$REPO" --json statusCheckRollup --jq '[.statusCheckRollup[]?|(.name//.context)]|sort'
gh pr view <FORK_PR> --repo "$REPO" --json statusCheckRollup --jq '[.statusCheckRollup[]?|(.name//.context)]|sort'
The fork gate. GitHub withholds repository secrets from fork PR workflows (otherwise any fork could exfiltrate them). So any check needing a credential — a deploy preview, a cloud-provider integration — never runs on a fork. Its check is absent, not failing. If such a check is required, every fork PR is permanently unmergeable no matter how clean.
Detect it by the check being missing from the fork's rollup while present on a base PR.
Remedies, in order of preference:
- Give the contributor write access → future branches are in-repo and get the token.
- Migrate existing heads to base-repo branches.
- Temporarily remove only the offending context from
required_status_checks— ask the user first, back the ruleset up, and record how to restore it:BLOCKER="Cloudflare Pages" # the fork-incompatible check, whatever it is called here gh api "repos/$REPO/rulesets/$ID" --jq '{name,target,enforcement,conditions,bypass_actors,rules}' > backup.json # Drop ONLY that context. Keep the rule, its other contexts, and the strict policy. jq --arg b "$BLOCKER" ' .rules |= map( if .type == "required_status_checks"
Установить triage-aging-prs в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteEditGrepGlobTaskFAQ
Что делает скилл triage-aging-prs?
Drive an aging pull-request backlog to zero. Inventories every open PR, finds the STRUCTURAL blockers first (a required check that can never run, a reviewer that never fires, chronically red CI), triages every unresolved review thread in parallel and VERIFIES each finding against the code before fixing it, then merges serially. **ALWAYS use when** the user says 'burn down the PRs', 'stale PRs', 'aging PRs', 'PR backlog', 'get these PRs merged', 'clear the PR queue', or asks why PRs are not merging. Repo-agnostic — works in any repo with the gh CLI.
Как установить скилл triage-aging-prs?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл triage-aging-prs запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic