skills/merge-queue/SKILL.md
Inspect and drain the local deferred-merge queue. Shows worktree merges that /finish deferred (transient block — e.g. the main checkout was on the source branch with WIP) and that a local launchd drainer retries until they land. Use when the user says 'merge queue', 'what merges are pending', 'drain the merge queue', or invokes /merge-queue.
npx skillsauth add alienfast/claude merge-queueInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A /finish … merge (or /full … wt) that can't advance the source branch right now but
could later — the transcript case where the main checkout sat on the source branch with another
session's uncommitted WIP — is deferred, not failed. scripts/finish-merge.sh
exits 3, self-enqueues a marker under <repo>/.claude/merge-queue/<issue>.json, and emits the
DEFERRED-MERGE lifecycle tag. A local launchd drainer
(scripts/drain-merge-queue.sh → merge-queue.sh drain)
retries every ~15 min until each merge lands. This skill is the manual window into that queue.
All logic lives in scripts/merge-queue.sh; this skill only dispatches to it and narrates the result.
/merge-queue [list | drain | <ISSUE-ID>]
list — show the queue.drain — run a drain pass now across all registered repos (don't wait for launchd).<ISSUE-ID> (e.g. PL-361) — drain just that one issue now (its repo is resolved automatically from the registry), then report its status. Other queued issues in the same repo are not touched.list (default)Run and show the output verbatim:
~/.claude/scripts/merge-queue.sh list
Each row is ISSUE | REPO | AGE(min) | TRIES | STATUS / REASON. Interpret the status for the user:
If the queue is empty, say so and stop. (list reads the repos in
~/.claude/merge-queue-repos.txt, which a repo self-registers on its first deferral — so an
"empty" result for a repo that never deferred is expected, not a lost marker.)
drain / <ISSUE-ID>Run a drain pass (the script serializes against the launchd drainer via a per-repo lock, so this is always safe to run):
~/.claude/scripts/merge-queue.sh drain # all registered repos
~/.claude/scripts/merge-queue.sh drain '<ISSUE-ID>' # just that one issue (repo auto-resolved from the registry)
~/.claude/scripts/merge-queue.sh drain '<repo-root>' # one whole repo's queue
The drainer prints one line per marker: DRAINED (merged, marker removed), STILL-BLOCKED
(transient, will retry), NEEDS-RESOLUTION (conflict — needs you), or HARD-FAIL. Surface those
lines and summarize.
NEEDS-RESOLUTION entry (conflict)The drainer deliberately never resolves conflicts unattended — that would land code on a shared branch without review. Resolve it in a normal session, exactly like /finish Step 9's exit-2 path:
jq . '<repo>/.claude/merge-queue/<issue-lower>.json'.
The worktree is mid-merge of the source branch.<wt_dir>, resolve both sides.git -C '<wt_dir>' add <resolved-files>pnpm check from <wt_dir> — must be green before committing.git -C '<wt_dir>' commit -F '<wt_dir>/tmp/git-merge-msg-<issue-lower>.md'~/.claude/scripts/merge-queue.sh drain '<ISSUE-ID>'. On success the marker
is removed and the worktree torn down.The queue is inert without the launchd agent loaded. ~/.claude/update.sh installs and
refreshes it automatically (it renders the plist template for the current $HOME and bootstraps
it idempotently — macOS only), so a normal update.sh run is all that's needed. To (re)install by
hand without a full update (see the plist header for the exact commands):
sed "s|__HOME__|$HOME|g" ~/.claude/launchd/com.alienfast.merge-queue-drain.plist \
> ~/Library/LaunchAgents/com.alienfast.merge-queue-drain.plist
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.alienfast.merge-queue-drain.plist
To remove: launchctl bootout gui/$(id -u)/com.alienfast.merge-queue-drain.
Drainer activity is logged to ~/.claude/logs/merge-queue-drain.log. Notifications fire (macOS
desktop) only for NEEDS-RESOLUTION / HARD-FAIL / long-stuck entries — never for routine retries.
data-ai
Inspect and reclaim leftover /start wt worktrees. Shows which worktrees under .claude/worktrees/ are eligible for cleanup (PR merged, branch merged, or Linear issue Canceled/Done) and which are preserved (active or abandoned-for-resumption), and can reap the eligible ones now. Use when the user says 'reap worktrees', 'clean up worktrees', 'what worktrees are leftover', 'prune worktrees', or invokes /reap-worktrees.
testing
End-to-end Linear issue macro — runs /start then /finish in sequence, gated on the /quality-review verdict. Worktree mode is opt-in via the `wt` token, mirroring /start. Pauses only for plan approval and the deferred-items filing decision; otherwise autonomous. Use when the user says 'full PL-XX', 'ship PL-XX end-to-end', or invokes /full.
development
Adversarial implementation review with triage and fix loop. Hard-gates on `pnpm check`, delegates to the quality-reviewer agent for categorized findings (Critical/High/Medium/Nice-to-Have/Approved), then triages and fixes findings via the developer agent. Loops until a re-review surfaces no new Critical/High/Medium findings (convergence), with a soft ceiling of 5 cycles before asking the user how to proceed; option 3 of that prompt terminates with verdict `escalated-to-architect`. Use when the user says 'review my work', 'check this implementation', 'adversarial review', 'quality review', or invokes /quality-review.
testing
Triage and prioritize Linear backlog. Analyzes issues for staleness, blockers, and suggests priorities based on dependencies and capacity.