name: ship-to-prod description: Ship code to production on any project with a single recipe: classify the diff, tests, review by fixed sub-agents (logic-reviewer alone, or security-reviewer + logic-reviewer in parallel if the diff is sensitive), SQL before the code, wait for the real deployment, check in prod, trace in the journal. Run it as soon as the user says "push", "go prod", "put it online", "deploy", or before any merge or migration to prod.
Ship to prod: one recipe, traced
Why this skill: without a single recipe, reviews drift toward improvised prompts (measured: ~700 "homemade" sub-agents a week with a variable prompt, and 40% of a week's production releases with no traced review at all).
0. Before anything
- Read the project's push rule in its
CLAUDE.md(directmain/ staging only / branch + PR / never without a green light). - Work in a worktree. Never
git stash,stash pop,reset --hard,clean: the stash stack is shared between sessions. - No secret in the diff (
git diff | grep -iE 'key|token|secret|password': every hit is either explained or removed).
1. Classify the diff
Sensitive if a line touches: auth or session, RBAC/RLS/permissions, a migration or SQL function, money (payroll, price, balance, rate, payment), minors or moderation, secrets, webhooks or crons, data deletion. Otherwise: simple (UI, copy, small fix, test).
2. Verify before reviewing
- The project's typecheck (shared machine: via
bash "$HOME/.claude/scripts/heavy-job.sh" ..., never two heavy jobs in parallel). - Tests tied to the diff, then the full suite if the project runs it on push. Read the EXIT CODE, not the end of the log.
- Linter in
--fixmode if there is one. - If the code has grown over several iterations:
/simplifyfirst.
3. Review, with the fixed sub-agents (never an improvised prompt)
- Simple diff: one
logic-reviewersub-agent (fresh context, strong model). - Sensitive diff:
security-reviewerANDlogic-reviewerlaunched in parallel, in the same message. - In the prompt: the project, the push rule, what the diff is supposed to do in 3 lines, and the
diff itself (inlined:
git diff <base>...HEAD), plus the list of touched files. Nothing else. - Every defect returned is verified in the code before acting: confirmed (we fix it), dismissed (one line of reason). A non-trivial fix = a new pass by the same agents.
- After 2 passes that find "one more case" of the same kind: change the rule (make it generic) instead of lengthening the list, otherwise the review does not converge.
- We push ONLY when both lists are empty or entirely dismissed with a reason.
4. Push in the right order
- SQL first: migration applied and verified (function body, permissions,
search_path) BEFORE the code that depends on it; a migration that renames keeps the old column until the code is deployed. - Push separate from any rebase (a push chained to a rebase pushes a half-done rebase).
- Wait for the REAL deployment: Vercel = READY status on the right commit; Render = "Live"; Cloudflare = new Worker version; hook-based deployment = wait for the tick (an empty commit or a "Redeploy" can be skipped).
5. Check in prod
- One proof per change: URL returning 200, SQL query showing the new value, cron log line,
screenshot. Visible change = the
verify-for-realskill. - What could not be verified is written in black and white ("not verified: ..."), never passed over in silence.
6. Trace
- Entry in
~/.claude/session-log.md(at the top): project, commit, "logic-reviewer" or "security-reviewer + logic-reviewer", number of defects confirmed / dismissed, proof in prod, next step. - Recap to the user: what is live, what was fixed thanks to the reviews, what remains unverified.
What "done" looks like
- Typecheck and tests green with the exit code read.
- Reviews traced with their angle, no open defect.
- Deployment observed on the right commit.
- One proof in prod per change, or an explicit "not verified" note.
- Journal line written.