Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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)

  1. Invoke git-plugin:git-coworker-check on <root>; stop if another agent is active there.

  2. 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)

  1. 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.json
    
  2. Fetch every head and base once, so no agent fetches:

    bash ${CLAUDE_SKILL_DIR}/scripts/prefetch-heads.sh --root <root> <work>/roster.json
    

    On MISSING= PRs re-run Step 1; still missing → report them unreviewed and re-plan without them.

  3. For each runs[i], in order, adapt workflows/pr-review.workflow.js and 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.

  4. For each review-<i>.json with unverified rows, re-run the template once with claims = that run's unverified rows and prs = those PRs' rows from review-plan.json runs[i].prs; write <work>/verify-<i>.json.

  5. 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)

  1. 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.json
    
  2. For each runs[i], in order (the next run must see this one's push), adapt workflows/pr-fix.workflow.js and run it with args {repo, root, base: "origin/<default>", units: runs[i], gates, setup, skills: ["git-plugin:git-commit-workflow"], decisions, trailer}. gates are the repo's test and lint commands; decisions relay Lauri's choices as given. Write each return to <work>/fix-<i>.json.

  3. 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.

  1. 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.

  2. Re-list fresh (a blocker may have merged mid-sweep): repeat Step 1.2.

  3. 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
    
Полный SKILL.md на GitHub

Установить 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 *)
Read
Write
Workflow
Skill

Вложенные файлы

REFERENCE.mdreferences/draft-gates.mdreferences/fix-redispatch.mdreferences/handoff-formats.mdreferences/merge-procedure.mdscripts/lib/summary.shscripts/list-sweep-prs.shscripts/merge-gate.shscripts/merge-review.shscripts/plan-review-runs.shscripts/prefetch-heads.shscripts/prune-worktrees.shscripts/review-to-units.shworkflows/pr-fix.workflow.jsworkflows/pr-merge.workflow.jsworkflows/pr-review.workflow.js

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить git-pr-sweep с