Command Palette

Search for a command to run...

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

pr-merge-prep

БесплатноБез исполняемых скриптовНе проверен

Autonomously bring a PR to mergeable state. Resolves merge conflicts, fixes CI failures, addresses review comments, syncs PR description, and requests…

doodledoodот doodledood★ 40 звёзд на GitHub

Об этом скилле

User request: $ARGUMENTS

If no PR specified: Detect PR from current branch. If detection fails, report and stop.

If PR is draft: Log "PR is draft, skipping" and stop.

Goal

Single-pass autonomous pipeline that identifies and resolves PR merge blockers: conflicts, CI failures, review comments. Each invocation handles what's currently blocking — the loop skill handles re-running for iterative convergence across invocations.

Concurrency Guard

After PR detection and draft check, prevent concurrent runs on the same PR. If another run is currently active, abort and log "Concurrent run detected, skipping." Acquire the lock when starting work, release on every exit path (including early exits and errors).

Pipeline

Execute phases in order. Log findings to /tmp/pr-merge-prep-log-{pr-number}.md after each phase (append to existing log if present, enabling cross-invocation continuity).

Push rule: Batch all commits from a phase and push once at the phase boundary. CI and downstream phases depend on the pushed state.

CI wait rule: After any phase pushes, the next phase that reads CI status must wait for checks to reach terminal status (success or failure). If checks remain pending, log as inconclusive and continue to the next phase — independent phases (comment triage, description sync) should not be blocked by slow CI. Only Phase 6 (re-review) hard-gates on CI terminal status.

Phase 1: Merge Conflicts

Update the PR branch to include the latest changes from the base branch (even if the diff is empty — the branch may be behind). Resolve conflicts where only one side modified the region or where changes are in non-overlapping sections. Log all other conflicts as unresolved. If the update strategy does not support partial conflict resolution, log all conflicts as unresolved. If the branch update itself fails (branch protection, force-pushed base, etc.), log the error as "Phase 1 failed" and continue to Phase 2 — CI triage and comment processing are independent of branch update state. Phase 2 should skip code-caused fixes (branch may be stale) but can still retrigger infrastructure failures. Note that if no push occurred this invocation, CI data reflects the prior push state — triage is still valid for infrastructure re-triggers but code-caused classification may be stale.

If the PR targets a non-default base branch, handle normally.

Phase 2: CI Failures

Triage before fixing:

  • Compare failing checks against the base branch. Pre-existing failures (also failing on base) are not the PR's responsibility — skip them.
  • Infrastructure failures (DNS errors, flaky tests, timeout without code cause) — trigger a CI re-run.
  • Code-caused failures — read the failure logs, identify the root cause, and fix. (If the diff is empty or Phase 1 failed, skip code-caused fixes — only handle infrastructure re-triggers.)

Each code fix must be an atomic commit with a descriptive message. Run project tests before committing to verify no regressions — if tests fail, revert the fix and log it as unresolvable. Local test results approximate CI behavior; if the fix passes locally but fails in CI, the next invocation will catch it.

If no project test commands are discoverable, skip the test verification step and log the assumption.

Phase 3: Review Comments

Triage all unresolved PR review comments in a single pass. Note: comments marked "outdated" by GitHub due to rebase (positional staleness from Phase 1) are different from the "Outdated" false-positive pattern below — positionally outdated comments may still be valid and should be triaged normally.

Classification prerequisites: Bot/human labeling (see references/known-bots.md) and full thread context inform every classification. No comment is classified without both. Classify before fixing. Threads with sub-discussions, follow-up questions, or unanswered replies are uncertain regardless of top-level content.

Classification criteria:

Classification Criteria
Actionable Real issue with a clear, safe fix. The fix does not touch core logic or require a large refactor.
False positive Matches a false-positive pattern (see below). Premise contradicts actual code behavior.
Uncertain Unclear validity, risky fix, touches core logic, or requires large refactor.

False-positive detection patterns:

Type Signal
Outdated Suggested change already exists in code; commit history shows it was addressed
Misread code Comment's premise contradicts what code actually does
Wrong context Comment references behavior/variables not present in the target code
Style preference No functional or readability improvement — naming changes that aid comprehension are actionable, not style
Resolved in thread Reply discussion shows issue was already addressed or withdrawn

See references/classification-examples.md for con

Полный SKILL.md на GitHub

Установить pr-merge-prep в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

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

references/classification-examples.mdreferences/known-bots.md

FAQ

Что делает скилл pr-merge-prep?

Autonomously bring a PR to mergeable state. Resolves merge conflicts, fixes CI failures, addresses review comments, syncs PR description, and requests re-review. Designed for unattended cron execution via loop skill. Use when: "prep pr for merge", "make pr mergeable", "fix pr blockers", "autonomous pr maintenance".

Как установить скилл pr-merge-prep?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл pr-merge-prep запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить pr-merge-prep с