---
name: ship
description: Use when commits may leave the machine, or the user asks to push, open, watch or merge a pull request or fix its failing checks, conflicts or review comments. Not for reviewing code, an unnamed PR, or a release.
context: fork
agent: exo:orchestrator
argument-hint: "[pull request numbers] [--land]"
allowed-tools: Bash(node *repo-fields.mjs*)
model: opus
effort: medium
---

# Ship

Goal: ship only as the user says.

1. **Authorize.** Letter, non-`ask` `ship` setting or merge request authorizes the route.
   - Watching or comments authorize only fix commits, push and replies, not force, `--no-verify` or a relaxed gate/test.
   - Confirm the PR is the one the request named before any push or reply.
2. **Overview**: `../../lib/references/closing.md`, three lines, then the question.
   - `Changed`, `Verified` go only to run report.
   - From `gate`, its lines replace overview.
   - A named follow-up adds `Follow-up: <what>, no issue filed; say so to file one`. No `gh issue create` before the yes.
3. **Ask.** Quote the stdout of `node "${CLAUDE_SKILL_DIR}/scripts/ship.mjs" --routes` as the menu; nothing leaves the machine before the letter.
   - Read `references/pr-merge.md` for routes the menu skips.
   - A set `route: ` skips asking; explain an unapplied `ship=`.
   - `--land` → take the menu's (A) with no question.
4. **PR body** for `open-pr`/`pr-merge` with `Closes #<n>`.
5. **Verify**, for `pr-merge`: hand diff to `gate`; `FAIL` pushes nothing.
   - Record or reuse verdict: `references/pr-merge.md`.
6. **Route.** `node "${CLAUDE_SKILL_DIR}/scripts/ship.mjs" --route <push|open-pr|pr-merge> --title <subject> --body <file> [--issue <n>] [--method squash|merge|rebase]` under `run_in_background`.
   - Push, open, wait for checks (stops after 20 minutes, exit 124; read output at least every 10 min), gate from API, merge, confirm.
   - After a fix, rerun 5; no `--merge`.
7. **Merge.** List and verify each: `references/pr-merge.md`.
   - `node "${CLAUDE_SKILL_DIR}/scripts/ship.mjs" --merge <n...>` under `run_in_background` gates and merges each. A stop halts no other.
8. **Comments and watching** per their references.

## References

| File | Read it when |
|---|---|
| `references/fields.md` | 4 fields. |
| `../../lib/references/question.md` | 3, `DIRTY`. |
| `references/pr-prep.md` | 4 body. |
| `references/commit-split.md` | Dirty tree. |
| `references/stack.md` | Stacked PRs. |
| `references/fix-ci.md` | Failing check, watch. |
| `references/merge-conflicts.md` | Conflicts, 6, watch. |
| `references/pr-comments.md` | Comments, watch. |
| `references/watch.md` | Watching. |
| `references/pr-merge.md` | 3, 5, 7. |
| `../../lib/references/closing.md` | Before the report. |

Report: the result in plain words (pushed, PR opened, merged, kept local on <branch>, or why it stopped) and the next step; status `gh pr view <n> --json state,isDraft`; `gh pr ready <n>` if draft; if merged `node "${CLAUDE_SKILL_DIR}/../build/scripts/remove-worktree.mjs" --kept --worktree <path> --run .`; when that script refuses, leave the worktree and report the refusal.
