Skip to content
Back to skills

Ship

CSecurity

Take a finished Elixir MCP change to production and prove it there. Preflight (your own worktree, AWS caller), release bookkeeping (JSON API version and pin, the What's new file when worth telling, site docs, the change note), `npm run verify`, commits, a draft pull request merged on a green `validate` check, the deploy (it takes the production lock) with the right acceptance scope, triage of every acceptance failure, the live read-back, then sibling repos and the close. `/ship` runs every st...

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 29, 2026
devopstypescriptgonodeawsgitapidatabase

Works with

  • cli
  • api
  • mcp

Security analysis

C67/100
  • criticalPipes output to a shell interpreter
  • mediumUses curl or wget to download content

Pro scans all 2 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add jthingelstad/elixir-mcp --skill ship --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ship?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ship
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/jthingelstad-ship/badge)](https://www.skillsdirectory.com/skills/jthingelstad-ship)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ship
description: Take a finished Elixir MCP change to production and prove it there. Preflight (your own worktree, AWS caller), release bookkeeping (JSON API version and pin, the What's new file when worth telling, site docs, the change note), `npm run verify`, commits, a draft pull request merged on a green `validate` check, the deploy (it takes the production lock) with the right acceptance scope, triage of every acceptance failure, the live read-back, then sibling repos and the close. `/ship` runs every step; `/ship from <step>` resumes at one (`/ship from triage` after Jamie ran a deploy the session was refused). Use whenever work in this worktree is ready for production, including at the end of `/tool-change`, `/migration`, a Gym round or a consistency round.
---

# Ship

The loop that takes a finished change to production. It was done by hand
four times on 2026-09-25 (9.0.0 through 9.1.1), and each pass relearned a
step: a deploy time written from memory, a note naming a field its
response does not serve, a catalogue seed pushed past the response cap.

**Deploying is part of done:** a fix that is merged but not deployed is
not shipped. Never stop to ask
whether to deploy. Product questions (a new tool, an MCP or JSON API
major, anything a DECISIONS line covers) are asked before building.

How to change a tool is `/tool-change`, a migration `/migration`, a live
op `/ops`; they end here. Steps, in order: `preflight`, `bookkeeping`,
`verify`, `commit`, `merge`, `deploy`, `triage`, `read-back`, `siblings`, `close`.

## Preflight

1. **The worktree is yours alone.** A session is one worktree, one
   branch, one pull request; the main checkout stays on a clean `main`.
   On Jamie's machine the domain's `scripts/session-start <slug>
   elixir-mcp` makes it. Elsewhere: `git worktree add --detach
   <dir>/elixir-mcp origin/main`, then `scripts/worktree-setup.sh` from it
   with `CODEX_SOURCE_TREE_PATH` (the main checkout) and
   `CODEX_WORKTREE_PATH` set. Edits, commits and pull requests take no
   lock; the deploy takes the production lock itself (Deploy, below).
2. **The caller is cloud-engineer:** `AWS_PROFILE=cloud-engineer aws sts
   get-caller-identity` answers account <account>, ARN containing
   `assumed-role/ProjectsCloudEngineer/projects-cloud-engineer`, as
   `infra/scripts/deploy.mjs` checks. Native endpoint throttles live in
   `infra/template.yaml`, not API Gateway stage settings. Never the `jamie` profile.
3. **origin/main is current:** after `git fetch`, HEAD is not behind
   `origin/main`. Behind means another actor shipped: find out who first.
   Work on the session's branch (`session/<slug>`), made before the
   first edit; main takes nothing but merged PRs. `gh pr list` shows the
   work other sessions already have open.
4. **Nothing holds migrate:** `elixir-mcp-migrate` runs at reserved
   concurrency 1, so a deploy behind a running backfill fails at its
   migration step with a 429 (twice on 2026-09-22). A write through
   `npm run op` holds the production lock while it runs, so `deploy.mjs`
   refuses and names it; a raw invoke does not, so ask before deploying
   over one you know of.
5. **The reference is committed:** `git -C ../cr-agent-api-docs status
   --porcelain -- data/card-roles.json data/deck-aliases.json` is empty.
   The vocabulary import refuses otherwise, after the migrations have run.
6. **Acceptance can run:** `test -f acceptance/.env` (never read it).
   Without it an asked-for gate prints `acceptance: skipped` and runs none.
7. **Nothing blocked is committed:** "never deploy past a commit whose
   infrastructure change is blocked" (ENGINEERING, "Deploying"): deploys
   are cumulative, so the next one would carry it past its refusal.

## Bookkeeping

By what changed. Each record below is a file of the change's own, so
two pull requests never edit one shared file (2026-10-10). Read a shared
file (the JSON API pin, a docs page) before editing it: on 2026-09-08 a
version bump by string replace matched nothing, because another session
had moved the file.

**The MCP tools** (a declaration, response, note or error): nothing to
bump. MCP has no version number (2026-11-23): `serverInfo.version` and
every `meta.contract_version` are the tool fingerprint, `tools.<12 hex>`,
and move by themselves when a declaration does.
- A change that breaks a caller (a removed or renamed tool, argument or
  field, a changed meaning) is Jamie's call, asked up front and stated in
  the pull request.
- Agents learn of a change worth telling from What's new
  (`elixir_updates`); write an entry when it is (below).
- After editing `packages/contracts`, `npm run build` there: other
  workspaces read its `dist`, and `services/mcp`'s tests are a bare
  `node --test`, so a focused run reads the old build (the root
  `npm test` rebuilds).

**The JSON API** (`GET /api/v1/me` itself; since 5.0.0 it mirrors no
tool, so an MCP change never moves it):
- `info.version` in `packages/contracts/integration-api.openapi.json` on
  ordinary semver: "a removed or renamed response field is a major of its
  own `info.version`" (DECISIONS), an addition a minor. A major is
  Jamie's call.
- The version and fingerprint in `services/web-api/test/sign-in-api.pin.json`;
  `sign-in-api-contract.test.mjs` fails until then, its diff showing the
  fingerprint.
- `apps/site/src/docs/sign-in-with-elixir.md` says what `/me` answers.

**What a user sees**, when it is worth telling (not every change needs
one; a tool change that people who connect a client should hear of does): a file in
`apps/site/src/_data/updates/`,
`<YYYY-MM-DD>-t<HHMMSS>-<slug>.md` (`apps/site/AGENTS.md`, "Updates"): use
the current UTC date and time and this change's slug, without reserving a
daily number. Same-second entries sort by file name; legacy numbered
entries keep their relative order. Never rename an existing entry. A
`# Title` line, then the body written for a person. No versions line:
entries before 2026-11-23 end with one, and new ones do not. Mark it
`<!-- timeline -->` (first line, `apps/site/AGENTS.md`, "Updates") only
when a person using the app would notice the change and want to know:
never for a change only agents or operators see, and rarely more than one
or two a week. A marked entry is in every signed-in person's Timeline for
a week, and its first paragraph (400 characters at most) is all it shows.

**Site docs** in `apps/site/src/docs/`, same commit. The tool reference is
generated from the registry: fix the declaration, never the page.

**The change note:** `docs/notes/<YYYY-MM-DD>-<slug>.md`
(`docs/notes/README.md`: what, why, what it ships with); a decision gets its
`docs/DECISIONS.md` line in the same commit. `docs/NOTES.md` is the frozen
archive; never append to it. Anything left open is a GitHub issue
(`needs-jamie`, `engineering`, `parked`), not a note.

## Verify

`npm run verify`: prettier check, oxlint, knip, the TypeScript check
(`verify:static`), then every workspace test on scratch Postgres
(`infra/scripts/test.mjs`: one build, then the workspaces side by side;
`node infra/scripts/test.mjs <unit>...` runs a few), then the Lambda
bundles (`build.mjs`). It must reach the tests: the chain is `&&`, and "A
run that ends on knip is not a green test run - it is no test run"
(`docs/NOTES.md`, 2026-09-23, when one briefly read as a pass). Read the
runner's summary (every unit `ok`), not the last line. A unit that fails
only beside the others is a race to fix, never one to rerun past.

The journeys: when `git diff --name-only origin/main...HEAD | sh
infra/scripts/e2e-needed.sh` prints `true`, also `npm run e2e` (set
`ELIXIR_E2E_PORT` if 4321 is taken). CI runs them on the same answer, and
on a push to main when what changed since main's newest green commit
reaches them (`infra/scripts/lib/push-plan.mjs`). Node 24 (`.node-version`): a run on another major
warns that it is not a pass on 24.

## Commit

- Logical chunks, message-first: write the message, then stage exactly the
  paths it describes. `git add -A` sweeps another worker's edits into a
  commit whose message does not say so.
- A commit leads with what it does ("War trophies note names the field
  served; ..."). End every message with the attribution
  trailer the session's instructions require, if any.
- Assert HEAD moved (`git log --oneline -1`). Never pipe commit output
  through `tail`: the pipe's status is tail's, so a failed commit passes.
- `&&`, never `;`, before push or deploy (DECISIONS, "One worktree per run or session; the lock guards production").

## Merge

main accepts only a pull request whose `validate` check is green (the
ruleset on `main`, 2026-09-26; no bypass, for Jamie's account either,
which is the account agents push as). No review is required: the check
is the gate, the PR is the record. The branch need not be up to date
with main (2026-10-08), so auto-merge lands a PR about a minute after
it goes green even when another PR merged first; main's own push run
then tests the combination, and the deploy gate waits for it.

1. At the first push, a draft: `git push -u origin HEAD`, then
   `gh pr create --draft --fill`. The open pull requests are how sessions
   see each other, so it goes up early, not at the end.
2. Done and `npm run verify` passed: push, `gh pr ready`, then
   `gh pr merge --auto --rebase --delete-branch` (a multi-commit PR gets
   a title that says what the whole ships). Rebase keeps each
   message-first commit on main as its own commit.
3. `gh pr checks --watch --fail-fast`. Green: auto-merge lands it;
   never merge by hand while it does. Red:
   read the failure, fix on the branch, push; never merge around it. A
   check that fails and passes on a re-run is a flake, and a flake is a
   defect: fix it in this PR or file an `engineering` issue the same day.
4. A rebase conflict with main (GitHub reports the PR `DIRTY`): rebase
   the branch on `origin/main`, resolve, push; the check re-runs.
5. `gh pr view --json state -q .state` is `MERGED`, then
   `git fetch origin && git switch --detach origin/main` in the
   session's worktree. Deploy from there, never from a branch.

Work that stops before the merge (credentials, a red check you cannot
fix now) leaves the PR open with its state in the PR body. Ending a
session (`session-finish`) refuses work that is on no pull request.

## Deploy

```sh
AWS_PROFILE=cloud-engineer node infra/scripts/deploy.mjs --acceptance=<family>
```

`deploy.mjs` takes the production lock after the CI gate and releases it
when it exits (`infra/scripts/lib/production-lock.mjs`; one file in the
clone's common git directory, so every worktree sees it). A lock another
holder has is a wait, never a workaround: the refusal names the holder,
since when and what for, and their deploy ships origin/main, so yours may
find nothing left to do. Never clear another holder's lock. A live deploy
writes `deploys/production.json` and comments on each pull request it
shipped (the time, the tool fingerprint and JSON API version, the acceptance result, and the timing:
the start, the CI gate's wait, each phase's seconds).

The profile goes in the environment: "the CLI profile flag alone does not
satisfy the SDK's provider chain" (ENGINEERING). The only flags
(`infra/scripts/lib/deploy-args.mjs`):

| flag | use |
|---|---|
| (none) | update the stack; acceptance skipped, with a WARNING |
| `--acceptance=<family>` | that family's cases; `a,b` for several |
| `--acceptance` (or `ACCEPTANCE=1`) | the whole suite |
| `--skip-headroom-check` | run acceptance below the database's headroom floor; an outage only |
| `--skip-web` | no site build or sync |
| `--rotate-origin-secret` | mint a new CloudFront origin secret; the doors accept the old one (`OriginSecretPrevious`) until it is cleared |
| `--verify-reference-seed` | update only: after operator code push, compare every live reference seed column before migrations/import; require identical seed content and import the same frozen repository snapshot |
| `--platform` | migrations and the stack update even in the site lane |
| `--param=Key=Value` | a PRESERVED parameter's first value |
| `--help`, `-h` | print the flags; deploys nothing |
| `--create` | first deploy only; GATED, never from here |

**Scope.** "The acceptance suite is the release gate, opted into per
deploy" (DECISIONS). A tool changed: `--acceptance=<family>`, the tool
name's prefix (`badges`, `battles`, `cards`, `clans`,
`elixir`, `game`, `players`, `war`); 9.0.1 ran
`--acceptance=war,clans`. Shared code (`services/mcp/src/protocol.mjs`,
`packages/tools`, ingest) or a release: `--acceptance`;
family runs skip the `#docs` cases. Nothing a tool serves changed
(the web app, site copy, infrastructure, mail, an op): none, and the change
note says why. Never the whole suite by habit: on 2026-09-23 a full pass
on every deploy drained the database's EBS byte balance in an afternoon,
and on 2026-11-12/13 about ten runs drained it to 0 and the database
dropped connections.

**One acceptance run per deploy train.** Several pull requests merging
in one sitting are one train: deploy as they land without acceptance,
then run the gate once, on the last deploy, with the narrowest family
list that covers every tool they changed (`--acceptance=war,clans`).
The run is paced (it rests twice each call's time): about 45 minutes
for the whole suite, 15 to 25 for one family, holding the production
lock throughout, so plan for it.

**The headroom preflight.** With acceptance asked, `deploy.mjs` reads
the database's EBS byte and I/O balances from CloudWatch before it
builds and again before the run (`infra/scripts/lib/db-headroom.mjs`).
Under 50% (whole suite) or 25% (a family) it refuses: at the first read
nothing is deployed (exit 2); at the second the deploy is live, the
record says acceptance was refused, and it exits 1. Then wait (about 3
points an hour) and run `npm run acceptance` later, or deploy with one
family; never retry in a loop. `--skip-headroom-check` only in an
outage, and the report says so. A preflight SKIPPED line (CloudWatch
unreadable) is reported, not ignored. `--skip-web` leaves `/docs`,
`/updates` and `/tools.json` as they were: never with a tool or docs
change.

**Refusals.** A dirty worktree (untracked files aside): the build bundles
the tree as it is, so an uncommitted edit would ship untraced. An unknown
flag exits 2 before any AWS call: until 2026-09-25, `--help` deployed.
**The CI gate** (`infra/scripts/lib/ci-gate.mjs`): HEAD must be
`origin/main`, and `validate` must be green on HEAD or on the merged PR
head with the same tree; a check still running is waited for (15 min).
`--break-glass` skips it only when GitHub itself is unreachable, never
for a red check, and a change note in `docs/notes/` says why.

**Lanes** (`infra/scripts/lib/deploy-lane.mjs`). Each bundle's key is
the hash of its content. When every key and the template match the live
stack (and no `--param` or rotation), the deploy takes the **site
lane**: no migrate push, no migrations, no stack update; everything else
below still runs. The log names the lane and, for the platform lane,
what changed. A docs page is always platform: the corpus rides the
web-api, MCP and migrate bundles.

**Order** (`DEPLOY_PHASES` in `deploy.mjs`): build, upload, the app's
assets, lane, the endpoint grant check (a missing or foreign CloudFront
grant refuses the deploy before anything is migrated or switched: find
who changed it, and restoring it is Jamie's call), migrations (a failure
stops the deploy before code flips), vocabulary import, stack, the
endpoint grant and its read-back, the first migrations (`--create`
only), the public statistics snapshot (platform lane; a failed snapshot
warns, the deploy finishes and exits 1), card art, site publish (only what
changed, by MD5 and headers; assets first, never deleted; then documents;
`lib/site-publish.mjs`), CloudFront invalidation and the prune of assets
no deploy has shipped for 14 days (the `deploys/site-assets/`
manifests), smoke
(`infra/scripts/smoke.mjs`), acceptance when asked, the record. A
red smoke or acceptance means the code is already live: "a red smoke means
fix forward now, not walk away". Migrations never roll back.

**The snapshot.** `fixtures/card-roles.snapshot.json` is the tests' copy
of the vocabulary, stamped with the last commit that touched the
reference's two data files. The deploy never writes it (2026-11-13); when
the reference has moved it warns. Refresh it on a branch with
`node infra/scripts/import-card-roles.mjs --snapshot-only` and merge it
like any other PR. A deploy that finds any tracked file modified after
its build stops before upload and names the files; one that finds it at
the end exits 1 after the record.

**Refused by the session's permission check?** Do not route around it,
piece by piece or through a sibling's CI. Hand Jamie the exact command
once, acceptance flag included, and say "deploy owed" on the pull
request (the 2026-09-25 13:06Z blocked run, closed by the 9.0.1 deploy on
Jamie's go). `/ship from triage` once it has run.

## Triage

Every acceptance failure gets one verdict, and the report to Jamie lists them all. The
verdicts, the file each writes and its precedent are in `triage.md` beside
this file. Without exception:
- a suspected flake is re-run alone (`node acceptance/run.mjs --only
  <suite/id>`) before it is called one;
- a `known.json` entry has a current reason and an `until`; a failure you
  can fix is never known;
- a `result_too_large` at the 48,000-character cap is a priced answer, so
  a catalogue seed that trips it is re-seeded smaller;
- no control case is deleted: every finding keeps one.

## Read-back

The smoke read the doors; read what this change moved, reads only:
- `curl -s https://elixir.poapkings.com/api/public/status`: `health.ok` is
  true (edge-cached about 60 s).
- On Jamie's `elixir-mcp` connection, `meta.contract_version` on any
  response is the new fingerprint (`tools.<12 hex>`, the same as
  `/tools.json`), and `serverInfo.version` shows it on reconnect (`/mcp`),
  which a new argument may need first. `elixir_updates` answers a new
  What's new entry.
- The change itself: re-make the call that showed the defect (the Gym
  case's arguments, the feedback item's call) and read the changed field.
- On the same host, `/tools.json` carries `contract_version` (the
  fingerprint) and `/docs/integration-api.json` the JSON API's
  `info.version`; `/updates` lists a new entry at its own page.

## Siblings

- Only after the hub change it needs is live: Drop's sign-in over
  `/api/v1` (cffc06d) went out after 9.1.1 let `/oauth/userinfo` answer an
  `/api/v1` grant, Clan b4a5d61 after 9.0.1.
- Drop, poapkings.com, cr-agent-api-docs and elixir-mcp-discord
  take only pull requests from 2026-09-26, on this repo's ruleset shape
  (`validate`, rebase, no bypass): each lands through its own Merge step.
- Elixir Drop deploys by CI from `main` once
  `validate` is green on the merged commit (moving to GitHub OIDC roles),
  so merging one is a production deploy: a session that could not deploy
  the hub does not merge a sibling that needs it. Watch the deploy on the
  merge SHA (`gh pr view <n> --json mergeCommit`), not the branch's:
  `gh run list -c <sha>`, then `gh run watch <id> --exit-status`.
- elixir-mcp-discord's three bots build from the local checkout on
  purpose (nearly live code: they are Jamie's tests); its own guide
  owns their deploy.
- Clan is part of this application: its shared packages, UI, private ledger and
  jobs build, test and deploy in the canonical Elixir lane.
- elixir-bot is retired (stopped 2026-09-26): no sibling step, never in
  scope.
- Each sibling repo keeps its own gate (Drop's `CONTRIBUTING.md` names
  it). A sibling change is made in that repo's own worktree, named when
  the session starts (`session-start <slug> elixir-mcp <sibling>` on
  Jamie's machine). Collectors: `docs/RELEASING-COLLECTOR.md`.

## Close

- The deploy's comment on each pull request it shipped is the record of
  what went live; there is no post-deploy notes PR. What is still owed is
  an issue (`needs-jamie` or `engineering`). A deploy time quoted anywhere
  only if you read it: on 2026-09-25 an unverified one had to come out
  (dd546ed4). Write it `13:14Z (8:14 AM CT)`.
- Answer the feedback the change closes after the read-back, `done` with
  the UTC day it went live in `shipped_in`, by `docs/OPERATIONS.md`, "Feedback" (through `npm run op`,
  a compare-and-set, then a read-back).
- A DECISIONS line added or changed: `/consistency <decision>` that day.
- `git status --porcelain` empty (untracked files count), then end the
  session (`session-finish <slug>` on Jamie's machine).
- Tell Jamie what shipped (commits, any JSON API version), what acceptance caught, and
  **Needs you** (a refused deploy's command, a live check only he can
  make). Times in US Central.

Files in this skill

  • SKILL.md20.4 KB
  • triage.md6.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.