
Ship
- 388 installs
- 1 repo stars
- Updated May 26, 2026
- camacho/ai-skills
ship is an agent skill that coordinates final verification, versioning, and deployment steps so agent-built features reach main through a PR auto-merge path or a local shallow-clone merge with rollback awareness.
About
ship is an agent skill from camacho/ai-skills that integrates a feature branch onto main after review and tests pass. The skill requires work on a non-main branch, a completed /review step or explicit user approval, a known worktree path, and zero pending tasks in TaskList or .branch-context.md checklists. Developers reach for ship when implementation is done and CI is either healthy for PR auto-merge or down for a controlled local merge. The workflow announces integration, chooses between PR and local paths, and keeps rollback awareness so production-bound changes land on main safely.
- Checklists pre-deploy verification
- Coordinates tags and release notes
- Aligns with CI/CD promotion steps
- Defines rollback triggers
- Closes the agent delivery loop
Ship by the numbers
- 388 all-time installs (skills.sh)
- Ranked #61 of 248 Release Management skills by installs in the Skillselion catalog
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/camacho/ai-skills --skill shipAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 388 |
|---|---|
| repo stars | ★ 1 |
| Last updated | May 26, 2026 |
| Repository | camacho/ai-skills ↗ |
How do you merge a feature branch to main safely?
Coordinate final verification, versioning, and deployment steps so agent-built features reach production with rollback awareness.
Who is it for?
Developers using Claude Code or Codex worktrees who need a gated final merge step after review with CI-aware PR or local fallback paths.
Skip if: Repositories still mid-implementation with pending TaskList items or teams that require manual release tagging without branch integration.
When should I use this skill?
Implementation is complete, tests pass, /review succeeded, and the feature branch needs to reach main via PR or local merge.
What you get
Merged main branch, closed feature branch, cleaned worktree, and deployment-ready commit on production path.
- Merged main branch
- Cleaned worktree
Files
Ship
Get the branch onto main. Two paths: PR (CI up) or local merge (CI down).
Announce: "Using /ship to integrate this branch."
Prerequisites
1. On a feature branch (not main). 2. /review (Step 6) passed, or user explicitly approved. 3. Worktree path is known (needed for cleanup). 4. No pending tasks. Run TaskList (Claude Code) or check .branch-context.md checklist (Codex). If any step is still pending or in_progress, that step was skipped — go back and complete it before shipping.
If any prerequisite is missing, say which and stop.
Step 1: Validate
pnpm validateIf validation fails, stop. Fix first.
Step 2: Determine target branch
Resolution order (use the first that succeeds):
1. Plan file frontmatter — read the Target: field from ai-workspace/plans/<name>.md if a plan exists. 2. Reflog parent — the branch's reflog records what it was created from:
TARGET=$(
git -C <worktree> reflog show HEAD --pretty=format:'%gs' \
| grep "^branch: Created from" \
| head -1 \
| sed 's/branch: Created from //' \
| sed 's|^origin/||'
)3. Remote HEAD — git -C <worktree> symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||' 4. Default `main` — final fallback. If ambiguous between sources, ask.
Step 3: Present options
CI status comes from conversation context — if the user has said CI is down, frozen, or at billing cap, treat as down. No auto-detection.
CI up (default):
Ready to ship.
1. Open PR + auto-merge
2. Keep branch as-is
3. DiscardCI down:
Ready to ship (CI down — local merge with review gate).
1. Local merge to main
2. Keep branch as-is
3. DiscardOption 1a: PR + auto-merge (CI up)
git -C <worktree> push -u origin <branch>
GH_REPO=<owner/repo> gh pr create \
--base "$TARGET" \
--title "<conventional-commit-title>" \
--body "$(cat <<'EOF'
## Summary
<2-3 bullets>
## Test plan
- [ ] <verification steps>
EOF
)"
GH_REPO=<owner/repo> gh pr merge --auto --mergeReport the PR URL. Proceed to worktree cleanup.
If CI blocks or fails after PR is up: STOP. Ask the user. No self-rescue, no local merge fallback, no force-merge.
Option 1b: Local merge (CI down)
Dispatch the code-reviewer agent on the diff first — all autonomous code must be reviewed before merge:
claude --agent code-reviewer "Review diff: git -C <worktree> diff $TARGET..HEAD"If reviewer returns P0/P1 findings, STOP. Fix before proceeding.
Invoke /local-merge with BRANCH=<branch>, TARGET=$TARGET, PRIMARY=<primary-worktree-path>, MESSAGE="merge: <branch> into $TARGET". It handles the shallow clone, push with retry, and non-destructive propagation to primary.
Option 2: Keep as-is
Report: "Keeping branch <name>. Worktree preserved at <path>."
Do not clean up.
Option 3: Discard
Require typed "discard" confirmation. Show branch name, commit list, worktree path.
git -C <primary> worktree remove <worktree-path>
git -C <primary> branch -d <branch>If branch -d fails (unmerged work), warn the user and stop — do NOT use branch -D. Only delete the remote branch after local delete succeeds:
git push origin --delete <branch>Worktree Cleanup
After PR (1a) or local merge (1b):
# Unlock first (matches the lock applied by /isolate)
git -C <primary> worktree unlock <worktree-path> 2>/dev/null || true
git -C <primary> worktree remove <worktree-path>Then prune the dead branch from local refs if git-trim is installed (handles squash-merged, rebase-merged, and [gone] upstream cases):
if command -v git-trim >/dev/null 2>&1; then
git -C <primary> trim --delete
fi| Path | Cleanup worktree? |
|---|---|
| PR + auto-merge | Yes |
| Local merge | Yes |
| Discard | Yes (in discard step) |
| Keep as-is | No |
Integration
Called by: /task (Step 8) Pairs with: /isolate (cleans up worktree it created), /review (must pass before /ship)
Related skills
FAQ
What are the prerequisites before running ship?
ship requires a feature branch, a passed /review or explicit approval, a known worktree path, and no pending TaskList or .branch-context.md items. The skill refuses to merge when checklist steps remain incomplete.
How does ship handle CI outages?
ship uses PR auto-merge when CI is up and switches to a local shallow-clone merge onto main when CI is down. Both paths keep rollback awareness while integrating the branch.