Ship Workflow (/ship)
Full lifecycle for shipping completed work: pre-flight checks, PR creation, and CI monitoring. Invoke with /ship.
When to Use
Use /ship when implementation is complete and changes are ready to land. This skill runs the full quality gauntlet before creating a PR.
Flags
--merge — Also merge the PR after CI passes (default: stop after CI green)
--no-test — Skip the test step in pre-flight (lint still runs)
Steps (execute in order, no confirmation between steps)
Phase 1: Pre-flight Checks
Detect package manager:
if [[ -f "bun.lockb" ]]; then PM="bun"
elif [[ -f "pnpm-lock.yaml" ]]; then PM="pnpm"
elif [[ -f "yarn.lock" ]]; then PM="yarn"
else PM="npm"; fi
Run checks in order. If any fails, stop and report — do not proceed to PR:
Lint (if package.json has a lint script):
$PM run lint
If lint fails, attempt auto-fix with $PM run lint -- --fix and re-check.
Typecheck (if package.json has a typecheck script):
$PM run typecheck
Tests (if package.json has a test script, skip with --no-test):
$PM run test
Phase 2: Branch + Commit + Push
Check current branch:
git branch --show-current
If on main or master, create a feature branch:
- Format:
<type>/<short-description> (e.g., feat/add-auth-middleware)
git checkout -b <branch-name>
Stage relevant files. Exclude:
.env, .env.* files
- Files matching
*.secret, *credentials*, *token*
- Generated files (
dist/, build/, .next/, node_modules/)
- Binary files not intentionally added
git add <specific files or patterns>
git status
git diff --staged
Commit with conventional format:
git commit -m "$(cat <<'EOF'
<type>: <concise description under 72 chars>
EOF
)"
Types: feat, fix, refactor, docs, test, chore, perf, ci.
Never include "Claude", "AI", or agent attribution.
Push with tracking:
git push -u origin <branch-name>
Phase 3: Create PR
gh pr create --fill
For multi-commit branches or when richer description is needed:
gh pr create --title "<type>: <description>" --body "$(cat <<'EOF'
## Summary
- <bullet 1>
- <bullet 2>
## Test plan
- [ ] <verification step>
EOF
)"
Output the PR URL.
Phase 4: CI Check
Monitor CI status with a 5-minute timeout:
timeout 300 gh pr checks <pr-number> --watch
- If checks pass → report green. Stop here unless
--merge flag was passed.
- If checks fail → report which checks failed. Stop and inform user.
- If timeout → report "CI still running, check manually" with PR URL. Stop.
Phase 5: Merge (only with --merge flag)
gh pr merge --squash --delete-branch
git checkout main
git pull origin main
If merge is blocked (reviews required, branch protection), report and stop — never force-merge.
Phase 6: Summary
After completion, print:
Ship complete
- Lint: passed
- Typecheck: passed (or "no typecheck script")
- Tests: passed / skipped (--no-test) / "no test script"
- PR: #<number> (<url>)
- CI: all checks green / failed / timed out
- Merged: yes (squash) / no (default — use --merge to auto-merge)
Constraints (always enforced)
- Never skip lint — if a lint script exists and fails, stop
- Never merge with failing CI — report failures, do not force
- Never force-merge — if branch protection blocks merge, stop and report
- Default merge strategy: squash — keeps main history clean
- No attribution in commits — already disabled globally
- Never commit directly to main — always branch first
1---2name: ship3description: Full ship lifecycle — lint, test, branch, commit, push, PR, CI check. Use when work is complete and ready to land. Pass --merge to also merge after CI passes. Pass --no-test to skip tests.4---56# Ship Workflow (/ship)78Full lifecycle for shipping completed work: pre-flight checks, PR creation, and CI monitoring. Invoke with `/ship`.910## When to Use1112Use `/ship` when implementation is complete and changes are ready to land. This skill runs the full quality gauntlet before creating a PR.1314## Flags1516- `--merge` — Also merge the PR after CI passes (default: stop after CI green)17- `--no-test` — Skip the test step in pre-flight (lint still runs)1819## Steps (execute in order, no confirmation between steps)2021### Phase 1: Pre-flight Checks2223Detect package manager:2425```bash26if [[ -f "bun.lockb" ]]; then PM="bun"27elif [[ -f "pnpm-lock.yaml" ]]; then PM="pnpm"28elif [[ -f "yarn.lock" ]]; then PM="yarn"29else PM="npm"; fi30```3132Run checks in order. If any fails, stop and report — do not proceed to PR:33341. **Lint** (if `package.json` has a `lint` script):35 ```bash36 $PM run lint37 ```38 If lint fails, attempt auto-fix with `$PM run lint -- --fix` and re-check.39402. **Typecheck** (if `package.json` has a `typecheck` script):41 ```bash42 $PM run typecheck43 ```44453. **Tests** (if `package.json` has a `test` script, skip with `--no-test`):46 ```bash47 $PM run test48 ```4950### Phase 2: Branch + Commit + Push51521. Check current branch:53 ```bash54 git branch --show-current55 ```56 If on `main` or `master`, create a feature branch:57 - Format: `<type>/<short-description>` (e.g., `feat/add-auth-middleware`)58 - `git checkout -b <branch-name>`59602. Stage relevant files. Exclude:61 - `.env`, `.env.*` files62 - Files matching `*.secret`, `*credentials*`, `*token*`63 - Generated files (`dist/`, `build/`, `.next/`, `node_modules/`)64 - Binary files not intentionally added6566 ```bash67 git add <specific files or patterns>68 git status69 git diff --staged70 ```71723. Commit with conventional format:73 ```bash74 git commit -m "$(cat <<'EOF'75 <type>: <concise description under 72 chars>76 EOF77 )"78 ```79 Types: feat, fix, refactor, docs, test, chore, perf, ci.80 Never include "Claude", "AI", or agent attribution.81824. Push with tracking:83 ```bash84 git push -u origin <branch-name>85 ```8687### Phase 3: Create PR8889```bash90gh pr create --fill91```9293For multi-commit branches or when richer description is needed:9495```bash96gh pr create --title "<type>: <description>" --body "$(cat <<'EOF'97## Summary98- <bullet 1>99- <bullet 2>100101## Test plan102- [ ] <verification step>103EOF104)"105```106107Output the PR URL.108109### Phase 4: CI Check110111Monitor CI status with a 5-minute timeout:112113```bash114timeout 300 gh pr checks <pr-number> --watch115```116117- If checks **pass** → report green. Stop here unless `--merge` flag was passed.118- If checks **fail** → report which checks failed. Stop and inform user.119- If **timeout** → report "CI still running, check manually" with PR URL. Stop.120121### Phase 5: Merge (only with `--merge` flag)122123```bash124gh pr merge --squash --delete-branch125git checkout main126git pull origin main127```128129If merge is blocked (reviews required, branch protection), report and stop — never force-merge.130131### Phase 6: Summary132133After completion, print:134135```136Ship complete137- Lint: passed138- Typecheck: passed (or "no typecheck script")139- Tests: passed / skipped (--no-test) / "no test script"140- PR: #<number> (<url>)141- CI: all checks green / failed / timed out142- Merged: yes (squash) / no (default — use --merge to auto-merge)143```144145## Constraints (always enforced)146147- **Never skip lint** — if a lint script exists and fails, stop148- **Never merge with failing CI** — report failures, do not force149- **Never force-merge** — if branch protection blocks merge, stop and report150- **Default merge strategy: squash** — keeps main history clean151- **No attribution** in commits — already disabled globally152- **Never commit directly to main** — always branch first