pr-merge-prep
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.