Communitygithub.com

lguidolin/ship-it

Use when the user wants to ship work — push, PR, archive decision records, merge, and clean up. Handles the full lifecycle from committing final changes through post-merge cleanup including converting specs/plans to compact decision records.

ship-it란 무엇인가요?

ship-it is a Claude Code agent skill that use when the user wants to ship work — push, PR, archive decision records, merge, and clean up. Handles the full lifecycle from committing final changes through post-merge cleanup including converting specs/plans to compact decision records.

지원 대상Claude Code~Codex CLI~Cursor
npx skills add https://github.com/lguidolin/agent-skills/tree/main/skills/ship-it

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Ship It

Handle the complete shipping lifecycle: stage, commit, push, open a PR, archive decision records post-merge, and clean up.

Overview

Every change goes through a branch and PR. Never push directly to main. This skill handles the full wrap-up cycle including post-merge documentation archival.

Commit messages are documentation. The PR title becomes the squash-merge commit on main and appears in the changelog. Get it right at PR creation time.

Archive after merge, never before. Specs and plans remain accessible until the PR is merged. Only after merge do we convert them to compact decision records.

When to Use

  • User says "push", "ship it", "let's ship", "open a PR", "create a PR"
  • User says "merged", "it's merged", "pull and cleanup" after a PR was opened
  • User has completed implementation and wants to wrap up
  • After completing a plan where the next step is to submit the work

When NOT to Use

  • User explicitly wants to push directly to main (confirm this is intentional first)
  • Repo has no remote configured
  • Changes are work-in-progress the user isn't ready to push yet
  • User just wants to commit without shipping (use conventional-commits-and-releases)

Process

Phase 0: Verify and Detect

A red suite never becomes a PR. Run the project's full test suite first. If anything fails, report the failures and stop — do not commit, push, or open a PR. This gate is house policy and is not delegated.

Environment detection (normal repo vs. named-branch worktree vs. detached HEAD) and base-branch determination are delegated to superpowers:finishing-a-development-branch, which already handles all three cases.

Check availability the right way: look for finishing-a-development-branch in your own list of available skills. If it is listed, it is invocable. If it is not listed, it is not — proceed to the fallback.

Do not probe the filesystem for it. ~/.claude/plugins/cache/ holds every version ever fetched, including plugins that are installed but disabled, and skills can be provided by mechanisms other than the plugin cache. A path existing under the cache proves nothing about whether you can invoke the skill.

If available — invoke it for test verification, environment detection, and base-branch determination, then stop before its option menu.

The integration decision is already made by house rule and is not the user's to re-make here: this project merges only through a PR, because the PR is what produces the preview deployment and what CI gates. Its "merge back to <base> locally" option is unavailable. Its "keep the branch as-is" option remains valid — that is a decision to defer, not to bypass the gate.

If missing — fall back, and lose nothing that gates correctness:

  • Run the test suite directly.
  • Treat the branch's upstream, or main, as the base; confirm with the user before proceeding.
  • Skip worktree cleanup in Phase 6; delete the branch normally.

Phase 1: Stage & Commit

git status --short
git branch --show-current
git log --oneline @{upstream}..HEAD 2>/dev/null || echo "No upstream set"

Decision tree:

  • On main with uncommitted changes → create branch, commit, push, PR
  • On feature branch with uncommitted changes → commit, push, PR (or update existing PR)
  • On feature branch with unpushed commits → push, PR (or update existing PR)
  • On feature branch with existing PR → push (PR already exists)

If there are unstaged changes:

  • Ask the user if all changes should be included or specific files
  • If changes span multiple concerns, suggest splitting

Craft the commit message:

TypeWhen
featNew functionality
fixBug fixes
docsDocumentation only
choreConfig, dependencies, tooling
refactorCode restructuring, no behavior change
testAdding or modifying tests
ciCI/CD workflow changes

Format: <type>[optional scope]: <imperative description>

Rules:

  • Imperative mood ("add", not "added" or "adds")
  • Lowercase first word after colon
  • No period at the end
  • Short (50 chars or less for the subject)
  • Describe what the commit does, not how

Present proposed commit message to user and confirm before committing.

Phase 2: Branch & Push

If on main, create a branch:

<type>/<short-description>

Examples:

  • feat/oauth-login
  • fix/null-response-handling
  • docs/release-workflow-permissions

Push:

git push -u origin $(git branch --show-current)

Phase 3: Open PR

PR title = conventional commit message (used for squash-merge on main).

PR body structure:

## What changed

[Specific description of additions/modifications/removals]

## Why

[Motivation — what problem does this solve?]

Create using gh CLI:

gh pr create --title "<conventional commit message>" --body "<PR body>"

If gh is not available, provide the PR URL from git push output or construct it.

Verify the preview environment came up. If the project deploys per-PR previews, wait for that workflow and confirm the environment is reachable before handing the PR over:

gh pr checks --watch

If the preview fails to deploy, report it and stop. A PR nobody can review is not shipped.

Where this skill stops. ship-it ends its deployment awareness at the preview. Staging and production promotion are not its job — they belong to the project's delivery skill (cloud-delivery-aks, or its equivalent). Phases 4-6 below are git and documentation hygiene, not deployment.

Phase 4: Wait for Merge

After PR is created, ask: "Let me know when it's merged and I'll handle cleanup and archival."

Wait for user confirmation (e.g., "merged", "done", "it's merged").

Phase 5: Post-Merge — Archive Decision Records

Specs and plans are verbose by design — good for a human reading the history, expensive every time Claude loads one. Converting them to compact decision records keeps the essential decisions cheap to read while the full narrative stays on disk, archived, costing nothing until someone opens it deliberately.

Only after the PR is merged, check for unconverted specs/plans:

ls docs/superpowers/specs/ 2>/dev/null
ls docs/superpowers/decisions/ 2>/dev/null

The recording-decisions skill ships two helpers for this. Locate them — the skill may be installed in the project or globally:

for base in .claude/skills ~/.claude/skills; do
  d="$base/recording-decisions/scripts"
  [ -d "$d" ] && echo "$d" && break
done

If found, $d/doc-archive.sh lists unconverted specs and prints a conversion prompt, and $d/index-rebuild.sh regenerates the index. If not found, do the same work by hand using the steps below — they are self-contained.

If unconverted specs/plans exist:

  1. Ask the user: "I found specs/plans that may correspond to this work. Want me to convert them to compact decision records and archive the originals?"

  2. If yes, for each spec:

    • Read the spec content
    • Generate a decision record with YAML frontmatter:
      ---
      title: <extracted from spec>
      date: <from spec filename>
      component: <inferred from content>
      status: implemented
      supersedes: null
      dependencies: [<inferred>]
      ---
      
    • Write ~30-50 lines capturing: key decisions, interfaces, constraints
    • Save to docs/superpowers/decisions/<date>-<topic>.md
    • Move original spec to docs/superpowers/archive/specs/
    • Move matching plan to docs/superpowers/archive/plans/
  3. Rebuild the master index — regenerate docs/superpowers/index.md from every decision record's frontmatter, grouped into an Active Decisions table (component, title, date, dependencies) and a Superseded table (component, title, superseded by). Run $d/index-rebuild.sh if you located it above; otherwise write the file directly.

  4. Commit the archival:

    git add docs/superpowers/
    git commit -m "docs: archive specs and update decision index"
    git push
    

Phase 6: Cleanup

git checkout main
git pull
git branch -d <branch-name>
git push origin --delete <branch-name> 2>/dev/null || true
git fetch --prune

Verify clean state:

git branch --show-current
git log --oneline -3

If the work happened in a git worktree, delegate the teardown to superpowers:finishing-a-development-branch (its provenance-based cleanup — it knows which worktrees it owns and leaves externally-managed ones in place). If that skill is unavailable, remove the worktree manually with git worktree remove <path> and confirm with the user first.

Key Principles

  • A red suite never becomes a PR — verify before anything else (Phase 0)
  • Never push to main directly — always branch + PR. The PR is the preview deployment and the CI gate; a local merge skips both. This overrides any workflow that offers merging locally as a choice.
  • Shipping ends at the preview — merge, archival, and cleanup are hygiene; promotion to staging and production is a separate skill's job
  • Conventional commits — the PR title is the changelog entry
  • Archive after merge only — specs stay accessible during review
  • Decision records are compact — ~30-50 lines, YAML-indexed, LLM-optimized
  • Clean up completely — no stale branches or tracking refs

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

lguidolin/change-hygiene-and-code-craft

Use when writing or refactoring code, structuring a commit or PR, or deciding whether to abstract duplication. Symptoms — mixing reorg with logic changes, a PR doing several things at once, a file growing large, the second copy of similar code, or unsure whether to DRY something up.

lguidolin/cloud-delivery-aks

Use when deploying to Kubernetes or Azure Kubernetes Service (AKS), configuring cloud secrets, setting up progressive rollout/canary, per-PR ephemeral environments, or k8s health probes. Keywords — Kubernetes, AKS, Key Vault, Argo Rollouts, Flagger, canary, blue-green, liveness, readiness, PodDisruptionBudget, HPA, rollback, GHCR.

lguidolin/commit-history-rewrite

Use when an existing repository has messy commit history that needs to conform to conventional commits before adopting release-please, or when intermediate WIP/fixup/merge commits need to be cleaned up.

lguidolin/conventional-commits-and-releases

Use when committing, writing a commit message, opening a PR that will be squash-merged, or configuring automated versioning/changelogs. Keywords — conventional commits, release-please, semver, feat/fix/chore, breaking change, changelog.

lguidolin/defense-in-depth-security

Use when handling untrusted input, secrets, authentication/authorization, or dependencies — or threat-modeling a new surface. Keywords — STRIDE, threat model, least privilege, secrets management, supply chain, dependency scanning, input validation, audit log, defense in depth.

lguidolin/designing-before-building

Use when starting a feature, fixing a non-trivial bug, or about to write implementation code — before any code exists. Symptoms you need this: "this is simple, I'll just code it", reaching for the editor before a design is approved, or an idea that hasn't been turned into a spec and plan.

lguidolin/engineering-constitution

Use when starting work in a project that follows the engineering constitution, orienting to its rules, or deciding which engineering practice applies to a task — spec writing, commits, testing, security, deploys, database, or UI work.

lguidolin/graphql-contract-testing

Use when writing a GraphQL query/mutation that the UI and a test will share, or building route/schema contract or smoke tests. Symptoms — copying a query into a test, a test asserting on query text, schema change that didn't break the UI build, or RLS/permission drift. Keywords — graphql-codegen, typed document, contract test, route smoke test.

lguidolin/init-repo-CI

Use when setting up a new repository with conventional commits, release-please, and CI automation, or when retrofitting an existing repository that lacks automated versioning and PR validation workflows.

lguidolin/interface-craft-and-accessibility

Use when building or styling UI — components, layouts, forms, design tokens — or making accessibility decisions. Keywords — a11y, WCAG, keyboard navigation, focus state, contrast, design system, minimalist UI, component reuse, ARIA, semantic HTML.

lguidolin/merge-gates-and-automation

Use when setting up or changing CI, pre-push hooks, or a task runner, or deciding what must pass before merge. Symptoms — tempted to put authoritative checks only in a local hook, skip CI, bypass with --no-verify, or unsure what gates a merge vs. runs locally.

lguidolin/observability-and-slos

Use when adding logging, metrics, tracing, health checks, SLOs, or alerting — or when building a service surface that needs to be operable and debuggable. Keywords — structured logs, OpenTelemetry, correlation id, RED metrics, liveness, readiness, SLI, SLO, error budget, alerting.

lguidolin/performance-and-scale

Use when working on hot paths, list endpoints, pagination, data-access in loops, or public interfaces/schemas. Symptoms — unbounded queries, N+1 access, no latency budget, optimizing without measuring, or changing an interface many consumers depend on. Keywords — pagination, N+1, Hyrum's Law, performance budget, bundle size.

lguidolin/postgres-postgraphile-rls-and-sql

Use when writing PostgreSQL, PostGraphile config, Row-Level Security policies, SQL schema files, or working on the Browser→App→PostGraphile→Postgres data path. Keywords — RLS, SECURITY DEFINER, search_path, pgSettings, grants, roles, GraphQL depth limit, query cost, statement_timeout, SQL file organization.

lguidolin/recording-decisions

Use when a design or architecture decision has been made and needs to be captured — writing a decision record or ADR, updating a decision index, noting a deferred idea, or superseding a past decision. Keywords — ADR, decision record, rationale, rejected alternatives, dependency index.

lguidolin/resilience-and-deploy-safety

Use when planning a deploy, designing a rollback, or responding to an incident or writing a postmortem. Keywords — deploy safety, rollback, immutable artifact, progressive delivery, canary, blast radius, incident response, blameless postmortem, error budget.

lguidolin/tests-as-a-control

Use when writing or modifying tests, when a test breaks during a refactor, or when testing permission/role rules. Symptoms — tempted to edit a test to make it pass, testing only the happy path, a deny-test that started passing, flaky tests, or unsure what to assert.

lguidolin/zero-downtime-migrations

Use when changing a database schema where data must survive the change — adding/removing/renaming columns, constraints, indexes, or backfilling. Symptoms — a destructive migration bundled with a code deploy, a NOT NULL column with a backfill, a table-locking UPDATE, or a rename. Keywords — expand/contract, parallel change, backfill, NOT VALID, CREATE INDEX CONCURRENTLY, graphile-migrate.

관련 스킬