Skip to main content
Generalmelodic-software

ship

Validate state and merge branch to main for production deployment. Use as final ZTE step after all checks pass.

Stars
74
Source
melodic-software/claude-code-plugins
Updated
2026-04-07
Slug
melodic-software--claude-code-plugins--ship
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/melodic-software/claude-code-plugins/HEAD/plugins/tac/skills/ship/SKILL.md -o .claude/skills/ship.md

Drops the SKILL.md into .claude/skills/ship.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

Ship

Validate workflow state and merge to main for production deployment.

Arguments

  • $1: Branch name to merge

Instructions

You are the ship command - the final step in Zero-Touch Engineering. Validate everything is ready, then merge to main.

Step 1: Validate State Completeness

Before shipping, ALL these fields must be populated:

  • adw_id - Workflow identifier
  • issue_number - GitHub issue being resolved
  • branch_name - Branch with changes
  • plan_file - Implementation plan path
  • issue_class - Task classification
  • worktree_path - Isolated environment path (if using worktrees)

If any field is missing or empty, ABORT and report what's missing.

Step 2: Validate Worktree (if applicable)

If using worktrees, perform three-way validation:

  1. State has worktree_path field
  2. Directory exists on filesystem
  3. Git recognizes worktree (git worktree list)

If validation fails, ABORT and report the issue.

Step 3: Validate Branch Exists

git branch --list $1

If branch doesn't exist, ABORT.

Step 4: Fetch Latest Main

git fetch origin

Step 5: Checkout Main

git checkout main

Step 6: Pull Latest

git pull origin main

Step 7: Merge Branch

Merge with no-fast-forward to preserve commit history:

git merge $1 --no-ff -m "Merge branch '$1' into main"

If merge conflicts occur, ABORT and report conflicts.

Step 8: Push to Origin

git push origin main

Step 9: Post Completion

Report successful ship:

Shipped: Branch $1 merged to main and pushed to origin

Output

Return structured result:

{
  "success": true,
  "branch": "$1",
  "merged_to": "main",
  "commit": "{merge_commit_hash}",
  "pushed": true
}

Or on failure:

{
  "success": false,
  "reason": "{failure_reason}",
  "step_failed": "{step_name}",
  "remediation": "{suggested_fix}"
}

Safety Gates

This command has multiple abort points:

  1. State validation - Missing fields block merge
  2. Worktree validation - Invalid environment blocks merge
  3. Branch validation - Non-existent branch blocks merge
  4. Merge conflicts - Conflicts block push

Notes

  • Ship happens in MAIN repository, not worktree
  • Always fetch/pull before merge to avoid conflicts
  • Use --no-ff to preserve full commit history
  • This is the final step - validate EVERYTHING before executing