Community코딩 & 개발github.com

ship-gate

How changes reach production safely on a live product — building a gate that cannot be skipped rather than relying on care, matching ceremony to blast radius, treating schema migrations as the one thing that never rolls back, rolling back before diagnosing, and keeping secrets off the command line. Use this whenever setting up or changing a deploy pipeline, branch protection, CI, or git hooks; whenever about to merge, push, deploy, promote or release; whenever a database migration or schema change is involved; whenever an emergency hotfix is needed; and whenever deciding how much verification a change deserves. Reach for it early on any project that has real users, and when bootstrapping a new repo that will eventually have them.

ship-gate란 무엇인가요?

ship-gate is a Claude Code agent skill that how changes reach production safely on a live product — building a gate that cannot be skipped rather than relying on care, matching ceremony to blast radius, treating schema migrations as the one thing that never rolls back, rolling back before diagnosing, and keeping secrets off the command line. Use this whenever setting up or changing a deploy pipeline, branch protection, CI, or git hooks; whenever about to merge, push, deploy, promote or release; whenever a database migration or schema change is involved; whenever an emergency hotfix is needed; and whenever deciding how much verification a change deserves. Reach for it early on any project that has real users, and when bootstrapping a new repo that will eventually have them.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Kogworks/claude-code-skills/tree/HEAD/skills/ship-gate

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

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

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

문서

Ship gate

A live product is one where a bad deploy costs someone other than you. These rules exist because a person who intends to be careful still ships a broken build at 1am.

The thesis

A human who double-checks gets tired. A gate does not.

Make the mistake impossible, or reversible — in that order. Every rule below is one of those two. When you are tempted to replace a gate with "I'll be careful this time", you are choosing the option that has already failed.

A corollary worth stating plainly: the gate applies to changes you are certain about. Certainty is exactly the state in which people skip steps, and it correlates poorly with being right.


1. The gate has three layers, and only one of them matters

server-side branch protection   ← the only layer that cannot be skipped
CI on every pull request        ← catches the error
local pre-push hook             ← fast feedback, trivially bypassed

Only the server layer is a gate. A local hook is a convenience: --no-verify defeats it, and so does a push from another machine. CI is the thing that actually runs the checks, but without branch protection nothing forces anyone to wait for it.

Configure protection to refuse: direct pushes to the default branch, force pushes, branch deletion, and merges whose required status check has not reported green. On a solo project require zero approving reviews — requiring one makes every merge impossible — but keep the pull request itself mandatory.

⚠️ The required-check name is a load-bearing string. Protection waits for a check with a specific name; the CI workflow publishes one with a specific job id. They are coupled only by that text. Rename the job and every merge blocks forever, waiting for a report that will never come. If merges are suddenly blocked, check that coupling before anything else — though usually a blocked state just means CI is still running.

Emergency fixes: temporarily disable the ruleset, then re-enable it. Do not add a bypass actor. A disable is loud, reversible, and obviously temporary; a bypass is permanent, silent, and will still be there in a year.

Keep the local hook installed even after server protection makes it redundant in normal operation — it is the net for exactly the case where the ruleset is deliberately disabled, which is when a bad push is most likely.


2. Judge a build by its exit code, never by reading its output

A commit was once chained behind a build piped into a pattern match. The pattern matched something harmless, the chain continued, and code that did not compile reached the default branch.

npm run build && git commit     # correct — the shell checks the exit code
npm run build | grep …&& commit # the exit code is now grep's, not the build's

This generalises past builds: any time a command's success is inferred from its text rather than its status, the inference is wrong sooner or later. Log output is for humans diagnosing a failure, not for programs deciding one happened.

Related: if the toolchain generates types or code as part of building, that generation must run before the typechecker. Generated artifacts often exist on a developer's machine only because something was built there earlier, so a green typecheck locally can be a much weaker claim than it looks — a clean checkout may report dozens of errors that the developer never sees.


3. Schema changes are the only thing that does not roll back

Code reverts in seconds: promote the previous deployment. A dropped column does not come back. That asymmetry drives everything here.

  • Additive only, and deployed before the code that uses it. New columns nullable or defaulted; new tables free-standing. Then the old code keeps working, and the new code finds what it expects.
  • Never drop or rename in the same deploy as the code change. To rename: add the new field → write to both → backfill → switch reads → drop in a later, separate deploy. Slower, and it is the only version that can be abandoned halfway without data loss.
  • Preview the generated SQL before applying it. Before a pure code change, that preview must show an empty migration. If it does not, something in the schema drifted and you are about to find out the expensive way.

The payoff: because the schema always moves first and only forwards, the code can always go back. Rule 5 depends entirely on this one holding.


4. Match ceremony to blast radius

One flow for everything means either the copy tweaks are slow or the payment changes are reckless.

ChangeFlow
Copy, colour, one componentBranch → PR → CI green → squash merge.
New feature, route, or APIBranch → PR → CI green → open the preview and use it → merge.
Schema, payments, auth, notifications, rate limitsBranch → schema to production first → PR → preview → merge → verify live within minutes.

⚠️ Even a one-word change gets a pull request once server-side protection is on. That costs a couple of minutes of CI per change and it is the price of the gate. Do not disable protection to avoid it for routine work — that is reserved for emergencies, and a habit of disabling it destroys the whole arrangement.

Two cases where "check the preview" does not apply

Protected preview URLs cannot be verified by fetching them. Deployment protection returns a redirect to a login page, which a script happily reports as a successful response. Only a signed-in browser sees the real thing. Never claim a preview was verified from a fetch — see build-discipline §2, this is the same failure wearing different clothes.

A change with no user interface has no preview to click — a script, a sitemap, a build-time file, a cron job. Its proof is a local production build plus, where it touches data, a full round trip against a non-production database verified by querying that database. Never the exit code alone, and never the preview URL.


5. After every merge, exercise the real thing on a real device

Run the actual user journey end to end, on hardware a user would hold.

No test suite catches "the button does not respond on this phone". On one project, every silent production bug ever found — a control that died permanently, a filter being wiped, a repeated action doing nothing — was found this way and by nothing else. Automated tests and a human with a phone catch disjoint sets of bugs; neither substitutes for the other.


6. Rollback beats fixing forward

When production is wrong, promote the last known-good deployment first, then diagnose. Twenty seconds of a working site beats ten minutes of a clever fix, and the pressure of a live outage is the worst possible condition for writing correct code.

This is why rule 3 is strict: the code can always go back, so never let a deploy put the schema somewhere the old code cannot live with.


7. Secrets never touch a command line

Keep them in environment files and the host's environment variable store.

⚠️ Never pass a secret inline in a shell command, especially PowerShell. Command history is written to disk in plain text and survives reboots, and the "sensitive word" filters that are supposed to suppress it match a short list of names — variables like SMTP_PASS or API_TOKEN are not on it. Use --env-file, or pipe from a file and delete the file afterwards. Never commit a credential scratch file, even briefly.


8. Write down the operations that are silently catastrophic

Every project accumulates a few commands that cause serious, irreversible damage with no error anywhere — regenerating a keypair that invalidates every device subscription, a seed script that truncates, a cache flush that loses queued work.

They are dangerous precisely because they succeed. Keep a short named list in the project's instructions file, each with one line on what it destroys, and treat running one as requiring explicit human confirmation every time.


Setting this up on a new project

Order matters — each step makes the next one meaningful:

  1. CI that runs typecheck, lint, tests and a production build, and needs no secrets to do it.
  2. Server-side branch protection requiring that check, with an empty bypass list. Until this exists, everything else is advisory.
  3. Migration discipline (rule 3) written down before the first schema change ships, because the first careless one is what teaches it otherwise.
  4. The ceremony table (rule 4), adjusted to what this product can actually break.
  5. The dangerous-operations list (rule 8), which starts empty and grows.

Record the project-specific details — the check name, the rollback procedure, the environment layout — in the repository's own instructions file. That file does not travel between projects; this skill does.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

관련 스킬