К основному содержанию
команда CX Codex

ship-ticket — команда для Claude Code: проверка и отправка тикета

Команда ship-ticket берёт уже готовую ветку, проверяет сборку и проводит изменения через код-ревью, PR и слияние. Она пригодится, когда код уже написан в SpecKit Companion.

MIT ★ 110 обновлён 2026-11-03

Установить в Claude Code · Вручную: положить файлы Все способы и платформы ↓
.claude/commands/ship-ticket.md
Открыть на GitHub

Что делает ship-ticket

ship-ticket работает с готовой веткой и не пересобирает задачу с нуля. Команда проверяет состояние Git, связывает ветку с открытым issue и смотрит результаты сборки и тестов. Если проверок нет, они устарели или завершились с ошибкой, дальнейшая отправка останавливается.

Затем запускается /code-review; найденные проблемы нужно исправить. Для изменений рендерера webview, записи результатов запуска или команды публикации предусмотрена дополнительная проверка через /codex:review. После этого команда готовит PR с записью для changelog и сливает его после успешных проверок. При флаге --review-merge слияние приостанавливается до подтверждения.

Работать нужно из корня репозитория, не из main; незакоммиченные изменения могут потребовать отдельного коммита. Если сборка или тесты красные, ветку не отправляют. Это команда для завершения уже сделанной работы, а не для реализации тикета.

Какие задачи решает

  • проверить готовую ветку перед отправкой
  • найти и исправить проблемы в diff
  • связать PR с issue через Closes #N
  • слить PR после прохождения проверок

Примеры запросов агенту

  • Отправь готовый тикет 292 на проверку и создай PR.
  • Проверь текущую ветку, подготовь PR и дождись проверок перед слиянием.
  • Подготовь PR для текущей ветки, но остановись перед слиянием с --review-merge.

Как установить ship-ticket

Вручную: положить файлы

.claude/commands/ship-ticket.md

Вызов — /ship-ticket. Для всех проектов — ~/.claude/commands/

Вопросы о ship-ticket

Как установить ship-ticket в Claude Code?

Скопируйте файл команды в .claude/commands/ship-ticket.md.

Что делает ship-ticket?

Команда проводит уже реализованный тикет через проверку сборки, код-ревью и PR. Она не пишет код заново.

Когда запускается /codex:review?

Только если diff затрагивает рендерер webview, запись результатов запуска или команду публикации. В остальных случаях проверку проводит /code-review.

Исходный текст

ship-ticket.md · MIT
---
allowed-tools: Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(node:*), Bash(python3:*), Bash(code:*), Bash(sleep:*), Bash(jq:*), Bash(tooling/scripts/merge-pr.sh:*), Bash(tooling/scripts/new-worktree.sh:*), Agent, AskUserQuestion, Read, Write, Edit, Skill, TaskCreate, TaskUpdate
description: Ship an ALREADY-BUILT ticket — code review → PR → merge → learnings → install-local. Skips the build (you built it in SpecKit Companion). The tail of /fix-tickets, no rebuild.
argument-hint: "<issue # e.g. 292>  (optional — defaults to the current branch's NNN-slug)  [--review-merge]"
---

## What this does

The **post-build tail** for a ticket you built yourself in SpecKit Companion (GUI / `/speckit.companion.*`). It does **not** rebuild — it takes the committed work on the current feature branch and ships it: review, PR, merge, learnings, reinstall. It is `/fix-tickets` steps 3–8 with the build skipped.

Use `/fix-tickets` when you want the loop to build the fix too. Use **`/ship-ticket`** when the code already exists on a branch and you just want the review→merge tail. Both are step 2 of `/release-loop`.

## Locked defaults

- **Never rebuild.** The branch already has the work; this command only reviews/ships it.
- **Never merge red or pending checks.** Leave the PR open and report.
- **Auto-merge on** unless `--review-merge` is passed (then pause for a thumbs-up before `gh pr merge`).
- **`/code-review` is the review gate** — high effort, **one pass**, findings applied; re-run it on any fix that itself changes real logic (the fix commit is the least-reviewed code). `/codex:review` joins it only for the webview renderer, the run-record writer, or a publish command.
- **Heavy steps run in subagents** (review, distilling learnings); the main loop only does git/gh/decisions.

## Inputs

`$ARGUMENTS`:
- An issue number (`292`) — preferred.
- Empty → derive from the current branch name (`NNN-slug` → look up the issue), confirm before proceeding.
- `--review-merge` anywhere → pause before merge.

---

## Procedure

> Run from the repo root (`~/dev/GitHub/speckit-companion`). Confirm with `git rev-parse --show-toplevel`.

### 0. Preconditions — main loop
```bash
git rev-parse --show-toplevel                 # must be speckit-companion
git branch --show-current                     # must NOT be main; expect NNN-slug
git status --porcelain                        # work should be committed; a clean tree is ideal
```
- **Refuse if on `main`** — there's nothing to ship. Stop and report.
- Resolve the issue number from `$ARGUMENTS` or the branch's `NNN`. `gh issue view <N>` to capture title/body for the PR + verify it's still open. If you can't resolve an issue, ask (AskUserQuestion) — a PR still wants a `Closes #N`.
- If there are **uncommitted** changes that are the real work, commit them first (real change + `specs/<NNN>/` spec folder); do **not** commit `.specify/` regenerated artifacts (`git checkout origin/main -- .specify/<file>` for any swept in).

### 0b. Verify it actually builds — subagent
- **Read the run the build already recorded before running anything.** The implement step records each check with `--verify-run`, so `specs/<NNN>-<slug>/.spec-context.json` already holds the compile and test entries under `verified`, each with its `exitCode`. If they are there, green, and newer than the last source file written (compare against the modified time of `.spec-context.json`), that is the verification — say so and move on. Run `npm run compile && npm test` yourself only when the record is missing, red, or stale. If `apps/speckit-extension/**` changed, also `python3 apps/speckit-extension/scripts/check_shape_parity.py`. If capture/timing changed, run the capture eval.
- Confirm the spec is in a shippable state: `specs/<NNN>-<slug>/` committed, tasks checked, `.spec-context.json` `specName` real (not a `[FEATURE NAME]` placeholder).
- If anything is red, **stop and report** — don't ship a broken branch.

### 1. Code review — subagent (`/code-review`, and `/codex:review` where it earns its place)
Run `/code-review` on the branch diff vs `main` at **high** effort — **one pass** — and apply findings (`--fix`). Tell the subagent to **read `.claude/review-checklist.md` first** (and honor the `CLAUDE.md` conventions it points to) and check the diff against those known bug classes. Commit fixes; re-run `npm test` if code changed. Record each finding (you'll distill in step 4).

**Codex joins only where a second reviewer has paid for itself.** Launch `/codex:review --base main --scope branch` on the same diff, in parallel and before applying anything, when the diff touches the webview renderer, the writer of the run record, or a publish command. Everywhere else `/code-review` alone is the gate. When both run, reconcile: a finding either reviewer raises gets addressed, and where they disagree the tie-breaker is a test, not an argument.

**Log who found what.** Append one row per finding to `~/dev/GitHub/obsidian-vault/Projects/speckit companion/Review Ledger.md` — date, branch or PR, the finding in a line, found by `code-review` / `codex` / `both`, severity, and whether it changed code. This is the only record of whether the second reviewer earns its place, so it gets written on every run, including the runs where Codex found nothing.

**Re-review the fix, once.** If your applied fixes themselves changed real LOGIC (control flow, a migration, a data-shape writer, an availability/auth gate, a DOM/lifecycle refactor), **re-run `/code-review` on the new commit** — the fix you just wrote is the least-reviewed code in the PR. Docs/CSS/label-only fixes don't need it.

**Two passes is the ceiling.** One review, one re-review, then ship. If the second pass still finds something real, fix it and open a follow-up issue for anything it raises beyond that rather than starting a third. An unbounded loop finds real things and costs more than they are worth: on PR #720 the third pass found a genuine dispatch bug, and the fourth found nothing while the branch sat unmerged. Convergence is a budget, not a proof.

### 2. Open the PR — main loop
A change a user will meet needs its changelog entry on the branch before the PR opens: write it with `/changelog-entry`.

Use `/create-pr` conventions (reads `.claude/pr-profile.md`): conventional-commit title `type(scope): summary`, body with `Closes #N`, summary, technical notes, how-to-verify.
```bash
git push -u origin "$(git branch --show-current)"
gh pr create --title "<title>" --body "<body>" --base main
```
Capture the PR number/URL.

### 3. Merge + cleanup — main loop
**Review-gate:** if `--review-merge` was passed, do **not** merge — post the PR link + a one-line summary, record "merged: NO — awaiting your review," and stop. Otherwise:
```bash
tooling/scripts/merge-pr.sh <PR>      # waits here and merges once every check has passed (auto-merge would skip the test job, which is not required)
gh pr checks <PR> --watch || true     # one wait, to report the outcome
```
Exit 3 means the pull request changes what a person sees and the owner has not looked: record "merged: NO — awaiting your review", show them the change in a note with screenshots, and re-run with `--seen` only after they approve. Never merge around the script with `gh pr merge`.

If checks fail and can't be auto-addressed, leave the PR open, record "merged: NO — checks failing," report.

### 4. Capture learnings + tick the box — distill subagent + main loop
- **Distill — route by shape, don't dump.** A learning earns capture only if it's **checkable, recurring or high-cost, and phrased as a rule/scan**; prefer editing an existing line over adding a near-duplicate; **empty distill is the norm, not the exception.** Route each kept learning to where it fires:
  - a **codebase-specific review check** → `.claude/review-checklist.md`
  - a **universal authoring convention** → the matching `CLAUDE.md` section (Webview & rendering invariants / Code Comments / Design tokens)
  - a **loop-mechanics** improvement → this command file (or `fix-tickets.md`)
  - an **architecture / coverage gap** → a GitHub issue (surface in the report; don't auto-apply)
  - If it can become a test or hook, propose that instead of prose. (`.claude/lessons-learned.md` is retired — don't append to it.)
- **Tick the box:** flip this ticket's line in `~/dev/GitHub/obsidian-vault/Current.md` (and `Projects/speckit companion/composable-workflow/queue.md`) from `- [ ]` to `- [x]` with `→ [PR #NNN](url)`.

### 5. Reinstall + report — main loop
Run `/install-local` so the workspace ends current, then drop the throwaway bump:
```bash
git checkout main && git fetch origin && git pull --ff-only
# /install-local …
git restore package.json package-lock.json .specify/
```
**If the branch touched `apps/speckit-extension/**`** — `/install-local` only refreshes the VS Code extension; the spec-kit extension also needs a `--dev` reinstall so the new `/speckit.companion.*` commands + workflow are resolvable in Claude Code. Check with `git diff --name-only origin/main...HEAD | grep -q '^apps/speckit-extension/'`, and if so:
```bash
specify extension remove companion                # committed stub means a fresh add reports "already installed"
specify extension add ./apps/speckit-extension --dev   # re-copies into .specify/extensions/companion/ + re-emits .claude/ command
specify extension list                            # confirm "companion" at the new state
git restore .specify/                             # gitignored dev-install copies — never commit these
```
The `.claude/` command emissions are **committed real files** (not gitignored like `.specify/`), and the merged PR should already carry the updated ones. If the reinstall leaves `.claude/` dirty (`git status`), that means the PR shipped without re-emitting — **surface it, don't silently restore or commit on main**; the emission belongs in the feature PR.
End with a tight summary: issue shipped, PR link, merged / in-review / blocked, new installed version, **whether the spec-kit extension was reinstalled**, lessons-captured count, and `/release-qa` as the next step for the batch.

## Guardrails

- **Never rebuild** — that's `/fix-tickets`' job. This ships what's already on the branch.
- **Never merge red or pending checks.** Report instead.
- **Never commit version bumps or `.specify/` regenerated artifacts** into the feature PR (install-local's bump is throwaway — restore it).
- **Reinstall the spec-kit extension when the branch touched `apps/speckit-extension/**`** — `/install-local` only covers the VS Code side; `specify extension remove companion && specify extension add ./apps/speckit-extension --dev` is what makes the new `/speckit.companion.*` commands resolvable in Claude Code. Restore the gitignored `.specify/` copies; never commit them on main.
- Always reply to + resolve any PR review threads after fixing.

© alfredoperez · MIT · alfredoperez/speckit-companion

Похожие слэш-команды

Все слэш-команды по теме «Код-ревью и рефакторинг» →
gsd-ship open-gsd Скилл gsd-ship для Claude Code, который отправляет завершённую работу в PR после успешной проверки. Пушит ветку, запускает review и отслеживает слияние. CX Codex +1 582установок ds-ship aicodeking Проводит изменение от кода до слитого pull request без надзора. Запускается по просьбе «отправь до конца», «слей, когда проверки пройдут» или по команде /ds-ship. CX Codex +1 534установок ship-ci-review-loop Community Команда ship-ci-review-loop запускает цикл отслеживания CI и комментариев к пулл-реквесту. Она ждёт прохождения тестов, выгружает замечания ревьюеров и заставляет агента закрыть каждую ветку перед слиянием. CX Codex +1 ★ 2 003звёзд репо ship-it jssblck Скилл ship-it доводит завершённую правку до готового пул-реквеста: коммитит, пушит, открывает PR и следит за CI до зелёного. CX Codex +1 1 700установок ship-pr Pedro Nauck Скилл ship-pr готовит завершённую ветку к сдаче: сверяет документацию, обновляет release notes, делает коммиты и открывает pull request. CX Codex +1 181установок w-ship blockmatic-icebox Скилл w-ship для Claude Code проводит задачу от реализации до PR. Он читает инструкции репозитория, проверяет изменения, коммитит их и открывает или обновляет PR. CX Codex +1 647установок

Из того же набора83

Весь набор →
submit-catalog-update Скилл submit-catalog-update формирует и отправляет issue для обновления расширения companion в каталоге spec-kit. Пригодится мейнтейнерам при выпуске минорных и мажорных версий. CX Codex +1 ★ 110звёзд репо feature-clip Скилл feature-clip ведёт сборку коротких зацикленных роликов SpecKit Companion от захвата в Storybook до файлов для сайта и документации. CX Codex +1 ★ 110звёзд репо publish-speckit-ext Команда publish-speckit-ext для публикации расширения spec-kit в релиз на GitHub. Позволяет другим разработчикам устанавливать расширение через каталог без локального клона репозитория. CX Codex +1 ★ 110звёзд репо speckit.constitution Субагент speckit.constitution создаёт и актуализирует конституцию проекта в .specify/memory/constitution.md на основе принципов команды. CX Codex +1 ★ 110звёзд репо speckit.tasks Субагент speckit.tasks разбивает фичу на задачи в tasks.md: берёт plan.md и spec.md из папки фичи и раскладывает работу по историям с зависимостями. CX Codex +1 ★ 110звёзд репо speckit.clarify Промпт speckit.clarify находит белые пятна в спецификации функции и задаёт до пяти точечных вопросов, чтобы сразу зафиксировать решения в файле. CX Codex GP ChatGPT ★ 110звёзд репо speckit.analyze Субагент speckit.analyze проверяет согласованность spec.md, plan.md и tasks.md перед началом реализации. Помогает найти пропуски и противоречия после генерации задач. CX Codex +1 ★ 110звёзд репо speckit.implement Субагент speckit.implement, который берёт список задач из tasks.md и выполняет их по порядку, проверяя предусловия, читая артефакты проекта и следуя архитектуре из plan.md. CX Codex +1 ★ 110звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой