Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Deploy?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/kish21-deploy)
---
name: deploy
description: Put the app on its host and document how.
---
# `/deploy` — Development ⑦ · run as an **engineer who has been paged at 3am**
> Part of **product-playbook**. Reads + updates the project spine (`PRODUCT.md`, or the project's
> existing docs — resolve per `MECHANISMS.md` §Spine resolution); writes `docs/deployment.md`.
> **Rule files — open by path, never search:** `${CLAUDE_PLUGIN_ROOT}/PRINCIPLES.md` · MECHANISMS.md = `${CLAUDE_PLUGIN_ROOT}/references/mechanisms.md` · MECHANISMS-ON-DEMAND.md = `${CLAUDE_PLUGIN_ROOT}/references/mechanisms-on-demand.md` · STATE-MODEL.md = `${CLAUDE_PLUGIN_ROOT}/docs/state-model.md` (a path still starting with `$`: the variable is the folder two levels above this SKILL.md, holding `commands/` and `PRINCIPLES.md` - never another tool's install). If `python` will not start (not found, or a sandbox refuses it): the project's `.venv` Python, else `python3`, else `py -3` - never a hunt; later commands use the start's `Run this copy as` line.
> **`status.py next --phase deploy` prints this phase's sections of `PRINCIPLES.md` and `MECHANISMS.md`** — apply them; never open the whole files (a situational companion only when a rule points into it). Load-bearing: **secrets are the user's to paste, never yours to write**,
> **no-hardcoding**, **fail-closed**, **docs match reality**, **honest gap surfacing**.
> **This phase executes a decision; it does not make one.** `#Architecture` already recorded the runtime
> target; this phase carries it out and writes down how (case file: The deploy nobody wrote down).
## Contract
- **Purpose:** the product is reachable at a URL by someone who is not you, and the steps are written
down so the next deploy is not a rediscovery.
- **Reads:** `PRODUCT.md#Architecture` (**the runtime target of each deployable unit, data custody and
migrations approach** — copied, never re-decided), `#Foundation`, `#Plan` (which milestone needs
reachability), `#Dev-complete`, the env-var reads and `.env.example` — as `next` prints them.
- **Writes:** `docs/deployment.md` (the companion document) + `PRODUCT.md#Deployment` (a short record
and a pointer to it).
- **Gate type:** `verification` — pass/fail on a live URL; the preference was settled in `#Architecture`.
**Not batchable:** it creates a real environment and the first run needs the user at the host's
dashboard. (`STATE-MODEL.md` §2d)
- **State model** (`STATE-MODEL.md` §2c): writes `#Deployment` · `declined` ✓ · `override` ✓ ·
`running` ✓ (a first deploy waiting on an account, a DNS record or a quota) · `superseded` ✓
- **Exit criteria:**
- [ ] **Every deployable unit's host is the one `#Architecture` recorded** — copied verbatim, with its
provenance. A different host here is a contradiction, not a detail (`MECHANISMS.md` §Step 3c). → `Host (copied from #Architecture`
- [ ] **`docs/deployment.md` exists** and carries: host · build and start commands · the exact env-var
list · how migrations run on deploy · first-deploy steps · **the deploy order across units** · the one
command or URL that proves it worked · the rollback path. → `docs/deployment.md`
- [ ] **The env-var list is GENERATED from what the code reads, and `.env.example` is checked against
it** — the config loader's reads and every build-time read, not retyped. A variable the code reads that
`.env.example` lacks, or one it lists that nothing reads, is named. Every variable the boot guard
requires appears in it; a test-only one (read only by tests) does not. → `Env vars set on the host`
- [ ] **Migrations on deploy are defined, not asserted.** `#Architecture` typically says *"applied on
deploy"*; name the command, where it runs, and what happens when it fails. → `Migrations on deploy`
- [ ] **A real request succeeded** against the deployed URL — the health path (a static site: the root
and a deep link) *and* one real user path; a path behind a sign-in may be owner-verified, recorded as
such. A build that went green is not a product that answers. → `Proof it answers`
- [ ] **`/foundation`'s placeholder guard was considered before the first deploy**, not discovered by
it: the guard is working as designed when it refuses to boot on an unset host variable, and that is
the single most likely first-deploy failure **for a value read at boot**. → `Env vars set on the host`
- [ ] **Every value read at BUILD time was checked in the built output.** Nothing rejects an unset one:
the page falls back to a mock or a dead button, and the site looks live while it is not. → `Env vars set on the host`
- [ ] **The built output carries no credential of any kind, and every way a stranger can get signed in
is listed** — each one closed, or open because the user said so. → `Who can get in`
- [ ] **What a visitor can see was checked before the URL went public** — vendor hostnames, account
names and internal URLs in the built output and its network calls, each fine or hidden because the
user said so. → `Who can get in`
- [ ] **Preview deployments are off, or run against their own backend and data** — unmerged code never
reaches production data. → `Who can get in`
- [ ] **With `#Dev-complete` empty, what a stranger can reach and spend was asked before the URL went
public**, and the answer is recorded. → `Who can get in`
- [ ] **No secret was written by this skill, or asked for in chat.** The document says *which* variables
the host needs and how to generate each value; **the user pastes the secrets into the host
themselves**. Public build-time values are committed, not pasted. → `Env vars set on the host`
## Step 0 — Context + prior-gate check
- **One first command: `python ${CLAUDE_PLUGIN_ROOT}/tools/status.py next --phase deploy`** — it prints `#Architecture`'s **runtime target**, **data custody** and **migrations approach**, `#Foundation`, `#Plan`, the env list generated from the code and the rules; never open `PRODUCT.md` whole. Show its first line. Say which host you are executing and that it came from `#Architecture`.
- **List every deployable unit, and read the runtime target for EACH — not "the" runtime target.** A unit
is anything built, run or served on its own: the site, the API, a worker, a forwarder in front of a
vendor. (case file: Three things to deploy and one Host slot)
- **If `#Architecture` records no runtime target for a unit**, warn and offer a **narrow** `/architect`
run for that unit first (allow override) — deploying to a host nobody chose is how a project acquires infrastructure it
cannot justify later.
- **Before any host question, explain build and deploy in one plain line, with an analogy** — *building
turns your code into the files a server runs, like printing a book from the manuscript; deploying puts
them where anyone can reach them, like putting the book in a shop* — then ask. (case file: What is
building?)
- **ONE question round, before the first deploy:** the start's questions, each as options with one *(Recommended)* and *Other* (`CAPABILITIES.md` §Ask the user a question with options); after the proof the record saves - no save question; the close asks *"Change anything?"*.
- **What this phase must NOT do:** re-decide the host, write or ask for a secret, or merge without the user's explicit word.
- **If `#Dev-complete` is empty**, say so: deploying an unfinished product is legitimate (a milestone may
need a URL before the product is done — that is usually *why* this phase runs early) but it should be a
choice, not an accident. **Then ask what a stranger can reach and spend once the URL is public** — can
anyone sign up, and what does each action cost (a paid model call, a GPU job, an email sent)? Security
work deferred "until outside users" is due the day the URL is public. Record the answer and what was
closed. (case file: Public sign-up where every click spends money)
- **An override is RECORDED, never a verbal "yes"** (`MECHANISMS.md` §Declined runs): follow the start's gate line - an unfinished milestone is one line, no question; any other gate is ONE options question, and Proceed runs `status.py bypass --from deploy --gate <gate> --reason "/<gate> not passed - the user chose to go on"` - never a typed reason.
- **A re-run or a stop:** the start prints the rule only when the case is real (a `RE-RUN` line; a stop: `status.py set
deploy declined --reason "<what was missing>" --gate <phase>`, nothing in `PRODUCT.md` touched). A host change keeps
the superseded one with its dated line: *why the other host lost* is the expensive thing to reconstruct.
## Step 1 — Apply principles (this phase)
- **Secrets are the user's to paste.** Hand over the exact variable names and how to generate each value.
**Never write a secret into a file, a command you run, or the chat.**
On the owner's machine or a server the secrets file is readable by its owner only, and no secret value
reaches a log - `set` checks both.
- **A public build-time value is not a secret — commit it; only secrets are pasted.** A value baked into
the built site ships to every visitor, so typing it into a dashboard only makes it drift. Commit it in
the file the build reads (`.env.production` or its equivalent, not swallowed by `.gitignore`). **A secret
found in a build-time value is already public:** stop, tell the user to move it behind the server and
rotate it — never commit it. (case file: Thirty-four public values typed into a dashboard)
- **When the host builds on merge, merging IS deploying.** Take the deploy through the repo's PR flow,
and merge only on the user's explicit word — an ambiguous "ok" is not a merge. (case file: Merging was
the deploy)
- **No-hardcoding still applies on the host:** its env vars are the same config layer as `.env`; a value
that only exists in a dashboard is dead config with a bill.
- **Fail-closed reaches production too.** The boot guard that rejects placeholders does not get an
exemption because it is inconvenient at 2am on the first deploy.
## Step 2 — Write `docs/deployment.md` from the runtime-target CATEGORY
**Scaffold from `templates/deployment.md`** - its `**In short:**` line first: where it runs and who can reach it, how to deploy it again, how to roll it back. The steps differ by **category, not by brand** — Vercel,
Railway, Render and Fly are one recipe with different button names; a bare VPS is a genuinely different
one. Use the user's named host in the examples if they have one, and **never turn this into a
supported-vendor list** (same rule as `/foundation`'s test-datastore recipes).
1. **PaaS / managed platform** → connect the repository, set the build and start commands, paste the
secrets into the dashboard, and let the platform build on push. Migrations run as a release/build step.
2. **Container-anywhere** → build the image, push it to a registry, and run it with the env supplied by
the runtime. Migrations run as a one-shot job or an entrypoint step, **never on every replica at once**.
3. **VPS** → a process manager, a reverse proxy with TLS, and a deploy script that pulls, builds,
migrates and restarts. Say where the env file lives and who may read it.
4. **The user's own machine** → the "deploy" is an install and a run command; say plainly what other
people can and cannot reach, because a milestone criterion may quietly assume they can: `Live URL` says
`own machine - not public, reachable by <who>`, the proof is a local request, and the close never says "live".
5. **Static site / CDN** → the host builds the site and serves its files: no start command, no health
path — write `none — static` in both rows. A single-page app needs the host's fallback to `index.html`,
or every deep link returns 404. (case file: The static site with no start command)
**Several units:** each gets its own category and its own column in the template. **Name the deploy
ORDER** — which units deploy on merge and which by hand — and deploy a backend and its migrations BEFORE
merging a frontend change that needs them. (case file: The site deployed before its backend)
**Before the first deploy, per unit:**
- **Look up the host's CURRENT recommended product for this category, not from memory.** The host is
decided; which of its products to use is checked today. A different product at the same host is a
dated note in `#Deployment`, not a new host. (case file: The product the host had retired)
- **Check toolchain parity: the host's build image against the repo's pinned runtime AND package
manager** (`engines`, `packageManager`, the lockfile's version). A mismatch is fixed in the build command
and recorded. (case file: npm 10 on the host, npm 11 in the repo)
- **Copy the host's cost and free-tier limits, and what happens at each, from `#Architecture`** (look them
up if it has none), and say what each usage counter on the dashboard counts and when it resets.
- **Use the repo's real deploy entrypoint** — a wrapper script or task the repo documents, not a vendor
command quoted in a changelog. (case file: The command from the changelog)
- **In a monorepo, point each host project at its own folder**, with the name its config file expects;
read the first build log's working directory and command. (case file: The build that ran at the root)
Fill every section of the template. **The env-var list is generated from what the code reads** — the start
prints it (boot reads, build-time reads like `import.meta.env.*`, test-only ones to leave out) — then
**check `.env.example` against it**: name each variable it lacks and each one nothing reads. Mark each
variable secret or not, **read at build or at boot**, and **committed or pasted**. **Do not invent one
variable of it.** (case file:
The env list that had drifted to half)
## Step 3 — Deploy once, for real, and write down what it took
Do the first deploy *with* the user — they hold the credentials. Then:
- **Before the URL is public, scan the BUILT output for credentials of every kind, and list every way a
stranger can get signed in.** Search the build folder for password strings, sign-in calls with typed-in
values and real account emails — a key-format secret scan misses all three. List sign-up, demo or
quick-login buttons, magic links and guest modes; each is closed, or open because the user said so.
(case file: The demo buttons that shipped two passwords)
- **Before the URL is public, ask what a visitor can see.** Search the built output and its network calls
for vendor hostnames, account or workspace names and internal URLs. A dashboard does not hide them
(build-time values ship either way); a domain and a forwarder in front of the backend does. Record what
the user chose. (case file: The vendor's name in every request)
- **A proxy, CDN or forwarder in front of the backend changes who the backend thinks is calling** — ask
whether it keys anything on caller IP, origin or host. Never raise a trusted-hop count while the origin
is reachable directly (a direct caller forges the hop): the forwarder vouches for the visitor with a
shared secret the origin checks. (case file: Every visitor in one rate-limit bucket)
- **A secret that must exist on two sides rolls out so either side missing means the old behaviour** —
never an outage window, never a bypass window. (case file: Every visitor in one rate-limit bucket)
- **Attaching the custom domain and DNS is the user's step at the dashboard** — say so up front, and never
write a DNS route into committed config. (case file: The domain step the agent could not take)
- **Preview deployments are off, unless they have their own backend and data.** A host that builds every
branch or PR gives unmerged code a URL that talks to the production backend and data. Turn them off, or
point them at a separate backend, and record which. (case file: Previews on production data)
- **A value read at build time is not boot-time config: an unset one fails OPEN, silently — check each one in
the built output.** Search the built files for each value the page needs (the API base, the auth
project URL); these ship to every visitor, so reading them handles no secret. (case file: The site that
looked live)
- **Prove it answers.** Hit the health path and **one real user path** on the deployed URL, and record the
command and the response. A green build is not a working product; `/build` already learned that lesson
on localhost and it is more true here. **A static site:** the root → 200, a deep link → 200, the served
JavaScript contains the production API base, and one call from the site reaches the real backend.
- **A user path behind a sign-in is the owner's to walk — never sign in with a real account's credentials,
and never ask for a password.** Record it as `owner-verified (manual) <date>: <what they did> → <what
they saw>`, not as an `evidence:` line: no command anyone can re-run stands behind it. (case file: The
signed-in path the agent must not walk)
- **Run the migrations the way the document says**, and record what happened.
- **Record the rollback path you have** — not the one you would like; `/ship` takes its rollout-safety
lines (revert · migration-down · flag-off · the post-deploy signal) from it on every release.
**Rehearse it before you record it:** a deliberately bad release (one extra migration) on a fake host folder
or a local copy, then the rollback - the start lists the steps and the two traps it finds (no down-migrations:
the rollback is the database backup; a copied release folder runs the old code).
- **Anything that blocked and was not fixable today** (a quota, a DNS propagation, a paid tier) puts the
section in the **`running`** state with a due date, rather than a green tick. **The user sets the date**
— ask; never invent one.
- **Stop every local emulator you started, and check no child process is left** holding files open.
## Step 3b — Principle-gate: it is deployed, or it is not (evidence)
Walk the exit criteria and prove each with a command, not a claim. The load-bearing one: **a real request
to the public URL, recorded in the one settled evidence form** (`STATE-MODEL.md` §2f) —
`` `evidence: curl -s https://<url>/health → 200 ok · docs/deployment.md · 2026-09-11` ``. **No URL
that answered means this gate did not pass**, regardless of how well the build went. An owner-verified
path passes the user-path half; the transition guard reports it `UNVERIFIED — owner-verified`, never `PASS`.
**Close the loop (`MECHANISMS.md` §Step 3b):** `status.py set deploy filled --section-from <file> --commit "<one line>"` (`--dry-run` lists every gap) checks the record and the files, saves (`MECHANISMS.md` §Commit the work; `--no-commit` instead of `--commit` only when the user said not to save) and prints the rest of the close: reconcile any number against `#Vision` (surface a contradiction, never write over it); **run the transition guard** (`MECHANISMS.md` §Step 3b, item 4): re-run this phase's own `evidence:` lines, a verdict for every exit criterion — `UNVERIFIED` is a normal outcome, silence is not; **close in plain language** (`MECHANISMS.md` §Plain-language close): **What just happened** · **What I skipped or couldn't do** · **Test this yourself** · **What YOU do next**, ending with its `Open a NEW conversation` line word for word.
## Step 3c — Contradiction check (BEFORE the save call in Step 3b: what it fixes or records goes in that save)
Per `MECHANISMS.md` §Step 3c, check what this phase produced against decisions **already recorded** —
here `#Architecture`'s runtime target, data custody and migrations approach, and `STRUCTURE.md`'s tree
(a `Dockerfile` written here contradicts a recorded decision not to have one). **Carry any decision still OPEN forward** (§Step 3c item 4). On a conflict, **name both sides, ask
which wins, and update the loser** — never leave it standing in two places.
## Step 4 — Handoff
"It's live at `<url>` (own machine: running locally), and `docs/deployment.md` says how to do it again.
- Next run **`/test`** — the suite now has a real environment to run against, and any milestone criterion
that needed a public URL (a second device, a real user, a link a stranger opens) is now reachable.
- `/ship` will use the rollback path recorded here on every release from now on."