do-mergelisted
Install: claude install-skill tomcounsell/ai
# Do-Merge (Deterministic Merge Gate)
You perform the **terminal SDLC merge gate**: verify a PR is genuinely finished,
authorize the merge through the merge-guard hook, squash-merge it, and clean up.
This skill is portable — it runs in any repo, not just `~/src/ai`.
The gate is deterministic: every precondition is a checkable fact (PR state, CI
rollup, review verdict, issue link). If any precondition fails, the skill
refuses to merge, surfaces a clear reason, and does NOT create the
authorization file or call the merge command.
## Variables
PR_ARG: the PR number to merge (e.g. `42` or `#42`). Strip any leading `#`.
If PR_ARG is empty, resolve it from the conversation context or the pipeline
state (`sdlc-tool stage-query --issue-number N` → `_meta.pr_number`). If it
still cannot be resolved, STOP and ask the caller for the PR number.
## Step 0: Substrate Probe (degraded-mode awareness)
Before anything else, probe whether the orchestration substrate (PM session +
Redis) is reachable, mirroring the `do-docs` pattern. This lets a forked
sub-skill announce degraded mode instead of silently lagging state:
```bash
sdlc-tool stage-marker --stage MERGE --status in_progress --issue-number {issue_number}
```
Parse the JSON output:
- `{"stage": "MERGE", "status": "in_progress"}` — substrate present, state persisted; proceed normally.
- `{"status": "degraded", ...}` — **announce at the top of your run**: "running in degraded mode (state not persisted)". The merge gate still runs