Guides shipping changes from local branch to production safely, covering approval gates, branch discipline, code review, CI, secrets, migrations, rollback, and observability.
Ships in wellmade. Installing the plugin adds it to Claude Code.
How it loads
What the skill costs in Claude's context, stage by stage
Every session~115 tokens
Name and description: Claude knows it exists.
When invoked~2k tokens
SKILL.md joins the conversation and stays.
5k kept after compaction
Only if needednone
None: SKILL.md is the whole skill.
SKILL.md
96 lines · ~2k tokens
Shipping to production
Shipping is where small mistakes become outages and leaks. The habits below make it routine and reversible.
The approval gate
These actions reach real users or cannot be undone. Get explicit approval in this conversation before each one:
a merge, or a push to the default or production branch
a production deploy
a migration run against production data
a change to production env vars or secrets
Approval for an earlier change does not count. "Keep going" does not count. If the host deploys on push (for example Vercel or Netlify with Git integration), a push to the production branch is a production deploy. Deploy to a preview by default, and deploy to production only when the user names production.
Branch and PR discipline
Follow the repo's branch rule. If the repo has branch protection, a PR template, or other contributors, work on a branch and open a PR. If a solo repo commits straight to the default branch, ask once which flow the owner wants, then follow it.
Keep a PR small and about one thing. A PR that touches dozens of unrelated files cannot be reviewed and hides bugs. If scope grows, split it.
Write the PR for the reviewer: what changed, why, how you tested, and what to watch after deploy. Include before and after screenshots for any UI change.
Never force-push over a shared branch or rewrite shared history.
The review gate
Treat review as a safety control, not a formality. Answer every comment: fix it, or reply with the technical reason you did not.
If an automated reviewer or required check exists, do not route around it. Do not weaken a branch protection or approval rule, and do not use --no-verify or an admin merge, to get a change in. If a rule blocks you, fix the change or get a real approval.
A green pipeline is necessary, not sufficient. A human still confirms the behavior.
CI
CI runs the build, type check, lint, and the test suite on every PR. A red CI blocks merge. A flaky failure is still red; see testing-and-verification.
Keep CI fast; slow CI gets skipped. Cache dependencies, shard tests, run the heavy suite only where it matters.
Make CI the same as local: same commands, same versions. Commit the lockfile, and in CI install with the frozen-lockfile command (npm ci, pnpm install --frozen-lockfile, yarn install --immutable).
Put each dependency upgrade in its own PR. For a major version, read the changelog and list the breaking changes that touch this repo.
Attach or reference the passing result in the PR. A test cited as proof must have actually run.
Secrets and environment
Never commit a secret. Never paste a live secret into a chat, an issue, or a log. Use environment variables and a secret manager.
Before each commit, check the staged diff for secrets (git diff --cached, or the repo's scanner such as gitleaks).
Keep a committed .env.example with keys and empty values. Keep real .env files git-ignored.
If a secret is exposed, revoke or rotate it first. Rotation is the fix; assume anything public was captured. Do not rewrite or force-push history to hide it. A history rewrite is the owner's decision.
If push protection blocks a push, remove the secret. Never use the bypass.
Separate environments: local, staging or preview, production. Each has its own keys and its own data. Never point a dev build at production data by default.
Validate required environment variables at startup and fail fast with a clear message if one is missing. A deploy that silently runs with a missing variable is how production breaks.
Database and migrations in production
Make each deploy compatible with the schema before and after it: expand, then contract. Add a column before the code that uses it. Remove a column only after no deployed code reads it.
Ship the data migration in the same PR as the code that needs it. Run a large backfill as its own step after the expand deploy: in batches, each in its own short transaction. Never put a backfill in the same transaction as the schema change, because the change's lock is held until that transaction ends.
Until the backfill finishes, make readers handle both the old and the new shape.
Before a schema change on a large or busy table, write in the PR which lock it takes and for how long. On PostgreSQL:
Set lock_timeout (for example SET lock_timeout = '5s') before the change, and retry on timeout. A blocked ALTER TABLE queues every read behind it.
Build indexes with CREATE INDEX CONCURRENTLY, outside a transaction. Turn off the migration tool's wrapping transaction for that file. If the build fails, drop the invalid index and retry.
Add a foreign key or a check constraint as NOT VALID, then VALIDATE CONSTRAINT in a separate step.
Do not change a column's type on a large table. Add a new column and backfill it.
Run the migration on a copy with production-scale row counts, and write the run time in the PR.
Before a migration that drops or rewrites data, confirm that a restorable backup or point-in-time recovery exists, and write its timestamp in the PR.
Deploy and rollback
Deploy to staging or a preview first and check it there, not only locally.
Put a risky behavior change behind a feature flag that is off by default. Test with the flag on and off. Remove the flag when the rollout ends.
Prefer gradual rollout (canary or staged) for risky changes so you can stop early.
Rollback means redeploying the previous build. It works only while the previous build runs on the current schema, so keep the schema expanded until the new build has run in production for the period the team agreed. Contract after that.
During an incident, roll back the code and leave the schema. Never run a down-migration that drops a column or table; it deletes the data written since the deploy.
Deploy small and often rather than one large risky release.
Observability
Log enough to diagnose: structured logs with a request id, errors with context, no secrets in logs.
Add metrics for the outcomes that matter: success and error rates, latency, and the key business events. You cannot fix what you cannot see.
Set up error reporting and at least one alert on the thing that must not break.
Before a production deploy, write down the metric to watch (for example the 5xx rate on the changed route), its current baseline, a watch window, and the threshold that triggers a rollback. At the end of the window, report the numbers. If the threshold is crossed, roll back first and investigate after.
Cost
Turn off or pause expensive resources (GPUs, large instances, sandboxes) as soon as a job ends. Idle paid compute is pure waste; add an auto-stop on idle.
Know the unit cost of the main operations before you scale them.
Launch checklist
The user approved each merge, production deploy, and production migration in this conversation.
The repo's branch flow was followed; the PR is small and says how it was tested, with screenshots for UI.
CI green: build, types, lint, tests, with results attached. No check bypassed.
No secret in the staged diff; required env vars validated at startup; secrets in a manager.
The schema change is expand-then-contract; any backfill runs in batches outside the schema change; the lock is named in the PR.
Verified on staging or preview, not only locally.
The watch metric, baseline, window, and rollback threshold are written down.
The previous build runs on the new schema, so redeploying it is a one-step rollback.
If this change starts paid compute, it stops when idle.
Configuration
What SKILL.md sets; muted values are Claude Code's defaults