git-pr-sweep
БесплатноЗапускает вложенные скриптыНе проверенReview, fix, then merge one repo's open PRs incl. ready drafts, as three runnable stages. Use when sweeping a repo's whole PR queue to merge.
от laurigates★ 61 звезда на GitHubОб этом скилле
/git:pr-sweep
Review one repository's open PRs, fix confirmed findings on the PRs' own branches, then ready and merge what passes every gate. Scripts decide every count and gate; only the main session readies and merges.
When to Use This Skill
| Use this skill when... | Use another skill instead when... |
|---|---|
| Taking a repo's PR queue, ready drafts included, through review, fix and merge | Grooming the backlog with no code changes → git-plugin:git-triage |
| Merging only what a fresh review found clean | Human review threads on one PR → recommend the user run /git:pr-feedback |
Merging a known PR chain → git-plugin:git-merge-hazards |
Context
- Current checkout: !
git log --max-count=1 --oneline - Current branch: !
git branch --show-current
Parameters
Parse these from $ARGUMENTS:
| Argument | Default | Meaning |
|---|---|---|
<owner/repo> |
git-plugin:git-repo-detection |
The one repository swept; a github.com URL works too |
--stage review|fix|merge|all |
all |
all runs the stages in order, stopping when one leaves nothing for the next |
--root PATH |
current checkout | Absolute path of a clone whose origin is the repo |
--review FILE |
none | review.json; required by --stage fix; --stage merge without it merges nothing |
--fix FILE... |
none | fix-<i>.json files, for --stage merge |
--dry-run |
off | Stop before pr-fix, gh pr ready and merge-chain.sh; print the plan |
<work> is <root>/tmp/pr-sweep/ when tmp/ is git-ignored there, else the session scratchpad.
Outside <root>'s repository, pass worktrees: "<root>/.claude/worktrees" in every Workflow's args. Formats: references/handoff-formats.md.
Execution
Execute this PR sweep one stage at a time, reading each script's summary before going on.
Step 1: Guard the clone and list the PRs (every stage)
Invoke
git-plugin:git-coworker-checkon<root>; stop if another agent is active there.List open PRs, drafts included, classified by script:
bash ${CLAUDE_SKILL_DIR}/scripts/list-sweep-prs.sh --resolve-blockers --out <work>/roster.json <owner> <repo>Show the counts;
TRUNCATED=true(the 500-PR ceiling) goes in the final report.
Step 2: Review (--stage review|all)
Plan the runs (small PRs share a finder pair):
bash ${CLAUDE_SKILL_DIR}/scripts/plan-review-runs.sh --out <work>/review-plan.json <work>/roster.jsonFetch every head and base once, so no agent fetches:
bash ${CLAUDE_SKILL_DIR}/scripts/prefetch-heads.sh --root <root> <work>/roster.jsonOn
MISSING=PRs re-run Step 1; still missing → report them unreviewed and re-plan without them.For each
runs[i], in order, adaptworkflows/pr-review.workflow.jsand run it with args{repo, root, prs: runs[i].prs, groups: runs[i].groups, context, decided}. Write each return verbatim to<work>/review-<i>.json.For each
review-<i>.jsonwithunverifiedrows, re-run the template once withclaims= that run's unverified rows andprs= those PRs' rows fromreview-plan.jsonruns[i].prs; write<work>/verify-<i>.json.Join every file written, review files first:
bash ${CLAUDE_SKILL_DIR}/scripts/merge-review.sh --out <work>/review.json <work>/review-1.json <work>/review-2.json <work>/verify-1.json
Step 3: Fix (--stage fix|all)
Turn confirmed findings into units; every PR that must not be fixed is excluded with its reason:
bash ${CLAUDE_SKILL_DIR}/scripts/review-to-units.sh --chunk 3 --out <work>/units.json <work>/roster.json <work>/review.jsonFor each
runs[i], in order (the next run must see this one's push), adaptworkflows/pr-fix.workflow.jsand run it with args{repo, root, base: "origin/<default>", units: runs[i], gates, setup, skills: ["git-plugin:git-commit-workflow"], decisions, trailer}.gatesare the repo's test and lint commands;decisionsrelay Lauri's choices as given. Write each return to<work>/fix-<i>.json.Before re-dispatching a FAILED or UNVERIFIED unit fresh, clear what it left (references/fix-redispatch.md), then
gh pr list -R <owner>/<repo> --head <branch> --state all --json number,state,headRefOid.
Step 4: Merge (--stage merge|all)
Main session only, in order; stop handling: references/merge-procedure.md.
A red check on a PR you mean to merge goes through git-plugin:git-merge-hazards § 4's triage first.
Take the review timestamp first, before the re-list, so a later push stops merge-chain.sh:
date -u +%Y-%m-%dT%H:%M:%SZ.Re-list fresh (a blocker may have merged mid-sweep): repeat Step 1.2.
Gate every PR:
bash ${CLAUDE_SKILL_DIR}/scripts/merge-gate.sh --out <work>/gate.json <work>/roster.json <work>/review.json <work>/fix-1.json <wor
Установить git-pr-sweep в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(bash ${CLAUDE_SKILL_DIR}/scripts/list-sweep-prs.sh *)Bash(bash ${CLAUDE_SKILL_DIR}/scripts/plan-review-runs.sh *)Bash(bash ${CLAUDE_SKILL_DIR}/scripts/prefetch-heads.sh *)Bash(bash ${CLAUDE_SKILL_DIR}/scripts/merge-review.sh *)Bash(bash ${CLAUDE_SKILL_DIR}/scripts/review-to-units.sh *)Bash(bash ${CLAUDE_SKILL_DIR}/scripts/merge-gate.sh *)Bash(bash ${CLAUDE_SKILL_DIR}/scripts/prune-worktrees.sh *)Bash(bash ${CLAUDE_SKILL_DIR}/../git-merge-hazards/scripts/merge-chain.sh *)Bash(gh pr ready *)Bash(gh pr view *)Bash(gh pr list *)Bash(date -u *)ReadWriteWorkflowSkillВложенные файлы
FAQ
Что делает скилл git-pr-sweep?
Review, fix, then merge one repo's open PRs incl. ready drafts, as three runnable stages. Use when sweeping a repo's whole PR queue to merge.
Как установить скилл git-pr-sweep?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-pr-sweep запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic