Built with Claude Code
How a change gets from one sentence to production, and what makes it safe to let an agent carry it there.
Cue is built with Claude Code, Anthropic’s coding agent: an AI that works in the repository and the terminal much as a developer does, reading files, running commands and editing code, while a person directs it. Here a person says what should change. The agent reads what it needs, makes the change, deploys it to a dev server, proves it there against the running system, and ships it when told to. Six steps, in this order, and a failed proof sends the work back to the change.
ask
A change starts as a sentence typed into the terminal, in plain words.
- Who
- A person
- With
- the terminal
- Leaves behind
- a task, in plain words
read
The instruction file names the design doc for the task. The agent reads that one before it touches the code.
- Who
- The agent
- With
- CLAUDE.md
- Leaves behind
- the rules, and the one right doc
change
Code and the doc that describes it change together, in one commit on the main branch, which /fuzi makes and pushes.
- Who
- The agent
- With
- /fuzi
- Leaves behind
- one commit: the code and its doc
deploy
Each image whose source changed is built once, named by its revision, and started on the dev server.
- Who
- A script the agent starts
- With
- /cue-deploy-verify
- Leaves behind
- a build, stamped healthy
prove
The API suite runs against the live dev server, and the agent opens the page it changed in a real browser. Red means back to the change.
- Who
- The suite, then the agent
- With
- /api-test · /verify-web
- Leaves behind
- a build, stamped verified
ship
Production is a person’s decision. The deploy then ships the very builds dev proved, and production runs them as they are.
- Who
- A person, then a script
- With
- /deploy-prod
- Leaves behind
- production, on the proven builds
What makes that safe is written down, in three places: one instruction file, the design docs it points to, and thirty-eight skills. Then comes the proof, and the pipeline that refuses to ship without it.
A session does not inherit the last one’s conversation. What it starts from is one file at the root of the repo, CLAUDE.md, and that file does two jobs: it routes to the one design doc the task needs, and it states the rules that never bend.
## StackEach module, and what it is built with.## Repo mapThe main paths and the doc for each, then a table from topic to design doc.the map ↓## Non-negotiablesThe rules no task may break.the rules ↓## CommentsSay why, never what. Rename before explaining.## Agent toolsHow one file serves three agent tools, and how a skill is written.## SkillsAll thirty-eight commands, a line each.the skills ↓
AGENTS.md →GEMINI.md →are symlinks to this file, so three agent tools read one text.
The map: one doc per task
The agent doesn’t load the whole library. It finds its task in a table and reads the doc on that row before it touches the code. Less context per session is more accuracy per task.
- 23doc/architecture/designs that cut across modules
- 13doc/components/a doc per module, and the two web design systems
- 1doc/product/what Cue is, and for whom
The rules: nine that never bend
Most of the file is guidance to weigh against the task. These are not: each one guards something that is expensive, or impossible, to undo.
- 01No secrets in the codeEnvironment variables only.
- 02The store apps’ API only growsAn installed app can’t be recalled: add, and rename or remove only with a migration plan.
- 03Wire values keep their spellingAn enum on the wire is lowercase, and stays what it is.
- 04The schema moves by migrationAnd a migration that has shipped is never edited.
- 05Dev is never mistaken for productionTwo servers, two scripts, two sets of names.
- 06No branches of its ownWork lands on the current branch unless a person asks otherwise.
- 07Docs track codeA change that alters what a doc says changes the doc with it.
- 08Docs describe the presentHow the system is: no history, no roadmap.
- 09Docs name no versionsThe build file owns every dependency version.
One of them is what keeps the map true: when a change alters what a doc says, the doc changes in the same commit. Claude Code keeps a memory between sessions too, but the rules and the map live in the repository, where every session, and every other agent, reads the same text.
A skill is a directory around one SKILL.md, and it turns a job of many steps into one command. It says what done means, spells out the commands whose exact shape matters, and records what went wrong before. Thirty-eight of them cover a change’s whole life, from a test build on a phone to a release in the stores.
Inside one skill
A skill has few parts. This is the one the loop leans on most, read from the top.
--- name: cue-deploy-verify1The name is the commandA skill is a directory. Its name is what gets typed after the slash.
description: Commit, push, deploy to dev, run the API suite, and verify every container and public URL is healthy — one command, one summary2One line to be found byAn agent picks a skill by this line, so it says exactly what the skill does.
allowed-tools: Bash, Read, Grep, Glob ---
3Only the tools it needsThis one may run commands and read files without asking; any other tool asks first.
## 2. Deploy and verify … ./omni-deploy.fish --verify4The exact commandWhere a command’s shape is the contract, the skill spells it out. The rest is left to judgment.
## 3. Report … The exit code is the verdict: 0 all green · 1 the deploy failed · 2 deployed, but a check is red · 255 SSH failed.5What done meansA bar, not a script: stated so any run can be judged at a glance.
## On failure 2, API red — … investigate, don’t blindly re-run …6What was learned the hard wayEach failure the skill has met leaves a line, so the next session doesn’t meet it fresh.
A skill’s prose names no particular tool, and a symlink shows the same directory to other agents, so one set of skills serves them all.
A change that compiles has proved nothing. Each kind of change has a check that runs against the real thing, and the check that matters most leaves a mark the production gate can read.
| Check | Runs against | Catches | Decides |
|---|---|---|---|
| The API suite/api-test | runs againstThe deployed dev server, through its load balancer. | catchesA broken API contract, or a server that falls over under it. | decidesA green run stamps the backend build verified. Production takes a backend build without it only through the hotfix lane or break-glass. |
| A real browser/verify-web · /verify-admin | runs againstThe dev site, signed in, in headless Chromium, WebKit or Firefox; the admin dashboard, run against dev’s API. | catchesA page that compiles, type-checks, and renders nothing. | decidesWhether a web change is called done. The screenshots are read back, not just taken. |
| The conformance suitecue-notes-conformance/ | runs againstGolden fixtures that every Cue Notes client’s tests read. | catchesTwo clients that disagree on a position, a sync or a rendering. | decidesEach Notes client’s own test run: the fixture is right, the client is wrong. |
| The AI eval/ai-eval | runs againstA golden set, through each text feature’s real service and the real models. | catchesA prompt, schema or model change that broke what the AI got right. | decidesNothing by itself: a check, shown beside the AI changes a production deploy ships. |
| The rehearsalrehearse.fish | runs againstA scratch copy of the production stack, on the dev server. | catchesA deploy script that fails when it matters: a refused gate, a ship cut mid-pull, a build that won’t boot. | decidesWhether a change to the pipeline itself may reach production. |
That mark is a stamp: a second tag on a build, kept in the registry beside the bytes it describes. It is written only after the proof, and it lives and dies with its build, so no database reset can forge one or lose one.
Two scripts deploy Cue: one for dev, one for production. One rule shapes both: build once. Each image is built once per source revision, on the dev server. Dev runs that build and proves it; production is handed the same bytes and builds only in a break-glass run. So a green run on dev says something about what production runs. Eight steps take a build there, and one more brings it back.
Commit and push
on devPending work is committed and main is pushed. The server’s checkout fast-forwards to exactly that commit; one that has drifted stops the run before anything is built.
Leaves behindone commit, on both ends
Build once
on devA build is named by its revision: the last commit that touched its image’s source. A revision the registry already holds is never built again. A new one is built for both servers’ platforms and pushed.
Leaves behinda build in the registry, for amd64 and arm64
Run it on dev
on devDev recreates only what changed, waits for both backend replicas to answer healthy, and checks that every app container runs the revision just built.
Leaves behindthe stamp healthy
Prove it
on devThe API suite runs against the freshly deployed server, then the run checks that nothing crashed under it. A green suite over a steady stack stamps the backend build.
Leaves behindthe stamp verified
The gate
to productionA production deploy’s first check runs on the dev server, against the registry. A missing build or a missing stamp stops it there, before production is contacted, and the refusal names the command that fixes it.
Leaves behinda yes or a no, and why
Ship
to productionThe three builds are copied into production’s image store over one SSH session. Each is pulled by its digest, and kept only once it proves to be the build that was asked for. Nothing that runs is touched.
Leaves behindthe builds in production’s image store
Adopt
to productionProduction tags what each service runs now as :previous, the way back. Only then does :latest move, and only onto the exact build the ship handed over.
Leaves behind:previous and a new :latest
Roll
to productionThe two backend replicas are recreated one at a time. Each must answer healthy, asked from beside the load balancer, before the next goes, so one is always serving. A web app restarts only when its build or its definition changed.
Leaves behindproduction on the new builds
Or roll back
to productionIf the new build won’t come up, the roll stops and the replicas go back to :previous. It sits in production’s own image store, so the way back needs no network and no dev server.
Leaves behindproduction as it was
The gate
The gate is where proof becomes permission. It reads the registry, never a dashboard: the backend build must be verified, the two web builds healthy. Take a stamp away and see what it says.
- cue-corehealthy
- cue-front-end
- cue-admin
--unverified, the hotfix laneEvery build carries the stamp production asks of it.
The roll
The roll is where a deploy could be felt, so the API stays up through it: the two backend replicas are replaced in turn, in five moves. A changed web app is one container, and its restart costs a few seconds of errors.
The three shipped builds are adopted by digest. Both replicas still serve the old build.
core-1 is recreated on the new build. Until it answers healthy, nginx sends every request to core-2.
nginx reloads and finds the new core-1. Requests alternate again: one replica new, one old.
core-2 is recreated in its turn, and nginx sends every request to the new core-1.
nginx reloads once more. Both replicas run the new build, and a healthy one served throughout.
The Builds page
A deploy, a ship or a suite run ends by writing down what it saw, in its own server’s database: how it ended, what each service runs, and on dev every build in the registry with its stamps. The admin dashboard’s Builds page reads that ledger, and the ledger only informs: the gate reads the registry, and a write that fails changes no deploy’s outcome.
Why two scripts and not a CI platform
Cue uses no CI platform. Building on a server the project owns skips the cloning, cache restores and artifact uploads a hosted runner pays for on every run: the checkout and the build caches are already there from the last deploy, and the only build bytes that travel are the layers production doesn’t hold yet. No deploy waits in a hosted runner’s queue, and the whole pipeline is two Fish entry points and a few bash files anyone can read.
The dev server is one kind of machine and production another, so each build on dev is made for both, amd64 and arm64, in one pass. Each image comes from a Dockerfile with two kinds of stage: one that builds, and a small one that runs.
| Image | Built in | Runs as |
|---|---|---|
| cue-core | built inA JDK stage: Gradle compiles the Kotlin source into one JAR, which runs on any platform. | runs asA JRE with libvips and ffmpeg, the media pipeline’s tools, as an unprivileged user. No build tools, no source. |
| cue-front-end | built inA Node stage: Next.js builds its standalone output. | runs asDistroless Node as an unprivileged user: no shell, no package manager. |
| cue-admin | built inThe same stage, for a different app. | runs asDistroless Node again. |
Every build stage runs on the build server’s own platform, and each runtime stage only copies from it, so one build yields both images with almost nothing emulated. The exception is the layer that installs cue-core’s media tools, which is rebuilt only when its inputs change.
A build knows nothing of the server it will run on: it carries no server’s environment and no keys, and takes one argument, its own revision. That is what lets dev and production run the same bytes. An image whose source didn’t change keeps its revision and isn’t built at all.
The server stack deploys from a script. The apps on people’s devices ship separately, each through a skill of its own, and all from one Mac: the signing keys never leave it.
| Client | Skill | Goes to |
|---|---|---|
| Cue for iPhone | /release-ios | toTestFlight. Submitting to the App Store is a person’s step. |
| Cue for Android | /release-android | toGoogle Play’s internal track. Production is that same build, promoted. |
| Cue for Mac | /release-macos | toA notarized DMG, a Homebrew cask, and the feed the app updates itself from. |
| Cue Notes for iPhone | /release-notes-ios | toTestFlight. |
| Cue Notes for Android | /release-notes-android | toGoogle Play’s internal track, after the minified build is smoke-tested. |
| CLI | /release-cli | toBinaries for macOS and Linux, and a Homebrew cask. |
/ios-release-notes writes what’s new for the App Store, and /tag cuts a version tag with a short note on what it stands for. The store apps reach testers first; a person submits or promotes from there.