skills/mp-ship/SKILL.md
Ship finished work: sync base, commit, push, PR, wait for CI green, merge. Use when: "ship it", "ship and merge", "ship this"
npx skillsauth add MartinoPolo/mpx-claude-code mp-shipInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Full workflow from finished execution to merged PR. $ARGUMENTS
gh pr merge --squash --autogh pr checks --watchDetect current state and determine entry point:
git status --porcelain
git log origin/<current>..HEAD --oneline 2>/dev/null
gh pr list --head <current-branch> --json number,state,url --jq '.[0]'
| State | Entry point | |-------|-------------| | Uncommitted changes | Step 2 (sync) | | Committed but not pushed | Step 3 (push only) | | Pushed, no PR | Step 4 (create PR) | | PR exists, CI pending/failed | Step 6 (watch CI) | | PR merged | Step 8 (post-merge) |
Determine target branch: use $ARGUMENTS if provided, otherwise run node $HOME/.claude/scripts/detect-base-branch.js.
Spawn a Sonnet general-purpose sub-agent with sync-base instructions:
Task: Merge origin/<target> into current branch.
git fetch origin <target>git log HEAD..origin/<target> --oneline— if empty, report "already synced" and stopgit merge origin/<target>- If conflicts: list conflicted files (
git diff --name-only --diff-filter=U), read each, resolve simple conflicts (non-overlapping, clear intent) with Edit tool +git add. For complex/ambiguous conflicts, show both sides and ask the user.- After all resolved:
git commit(accept default merge message)- Report: commits merged, conflicts resolved (if any)
If the Sonnet agent cannot resolve conflicts (complex overlapping logic): take over at Opus level, resolve manually, then continue.
Spawn mp-git-committer sub-agent (Haiku):
push: true commit_hint: $ARGUMENTS or summary of changes from git diff --stat
Handle result:
4a. Find linked issue:
Fast-path: node $HOME/.claude/scripts/extract-branch-issue.js
If no number extracted, spawn mp-issue-finder sub-agent (Haiku) with repo, branch, commits, diff summary.
4b. Create PR:
Spawn mp-pr-manager sub-agent (Haiku):
issue_number: (from 4a, if found) description_hint: summary of changes
Handle result:
Detect repo merge strategy:
gh repo view --json squashMergeAllowed,mergeCommitAllowed,rebaseMergeAllowed --jq '.'
Prefer squash > merge > rebase (use first allowed).
gh pr merge <pr_number> --squash --auto
(Replace --squash with detected strategy if squash is not allowed.)
gh pr checks <pr_number> --watch
On CI failure:
gh run list --branch <branch> --limit 1 --json databaseId,conclusion --jq '.[0]'
gh run view <run_id> --log-failed
Analyze failure logs. Classify:
gh run rerun <run_id> --failedFor code fixes:
mp-git-committer sub-agent (Haiku) with push: true, commit_hint: "fix: CI failure — <summary>"gh pr checks <pr_number> --watch)For flaky/infra reruns:
gh run rerun <run_id> --failedAfter 3 fix attempts: report full failure summary to user and stop. Do not merge.
Compose summary: what shipped, tests added, files changed, CI run URL. Write to temp file and post:
gh pr comment <pr_number> --body-file <temp_file>
Detect worktree context:
git rev-parse --git-common-dir
.git → not in worktree, run git pull on current repoworktrees/ → pull into main repo:MAIN_REPO=$(dirname "$(cd "$(git rev-parse --git-common-dir)" && pwd)")
git -C "$MAIN_REPO" pull
git checkout <original-branch>
(Only if the pull in 8b switched context. In worktree mode this is unnecessary.)
After completion, display:
development
Audit all active skills for consistency, convention drift, and common issues. Auto-fixes where possible, reports remaining issues. Use when: "audit skills", "skill audit", "check skills", "lint skills"
development
Scan recent Claude Code sessions for grilling/design discussions, extract decisions, and update CONTEXT.md + DECISIONS.md. Use when: "harvest decisions", "extract decisions from sessions", "update docs from sessions", "sync decisions"
tools
Consolidate CONTEXT.md: remove duplicates, outdated items, tighten language. Use when: "consolidate context", "clean up context", "simplify context", "consolidate requirements"
tools
Consolidate CONTEXT.md (or legacy REQUIREMENTS.md): remove duplicates, outdated items, tighten language. Use when: "consolidate requirements", "clean up requirements", "consolidate context", "simplify context".