Skip to the first section
CLAUDE.mddoc/skillsdevsuiteproduction
How it’s made · a sentence to shipped

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.

01The loop

From a sentence to shipped

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.

Fig. 1 / The loop
red? fix it1askone sentence2readCLAUDE.md → a doc3changecode + its doc4deploybuilt once, on dev5provesuite + a browser6shipa person says goa personthe agenta script
A person asks and a person says go. Everything between is the agent and its scripts.
1

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
2

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
3

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
4

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
5

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
6

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
One sessionillustrative

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.

02ContextCLAUDE.md

What every session starts from

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.

CLAUDE.mdat the repo root
  1. ## StackEach module, and what it is built with.
  2. ## Repo mapThe main paths and the doc for each, then a table from topic to design doc.the map ↓
  3. ## Non-negotiablesThe rules no task may break.the rules ↓
  4. ## CommentsSay why, never what. Rename before explaining.
  5. ## Agent toolsHow one file serves three agent tools, and how a skill is written.
  6. ## 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.

Working on…
Read
doc/architecture/sse-design.md

The live stream: what a signal is, and how one reaches the open clients of the people it is for.

doc/architecture/database-design.md

Every table, and the rule that the schema changes through migrations only.

doc/architecture/chat-design.md

The mechanics every kind of chat shares. Each kind then has a doc of its own.

doc/architecture/ai-design.md

The gateway every model call goes through: routing, prompts, evals and cost.

doc/architecture/notes-design.md

Notes written together: the socket, Clean up and the conformance suite.

doc/architecture/infrastructure-design.md

The two environments, how a deploy runs, and what differs between them.

doc/components/cue-front-end-design.md

The web app’s tokens, primitives and motion rules.

  • 23
    doc/architecture/
    designs that cut across modules
  • 13
    doc/components/
    a doc per module, and the two web design systems
  • 1
    doc/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.

  1. 01No secrets in the codeEnvironment variables only.
  2. 02The store apps’ API only growsAn installed app can’t be recalled: add, and rename or remove only with a migration plan.
  3. 03Wire values keep their spellingAn enum on the wire is lowercase, and stays what it is.
  4. 04The schema moves by migrationAnd a migration that has shipped is never edited.
  5. 05Dev is never mistaken for productionTwo servers, two scripts, two sets of names.
  6. 06No branches of its ownWork lands on the current branch unless a person asks otherwise.
  7. 07Docs track codeA change that alters what a doc says changes the doc with it.
  8. 08Docs describe the presentHow the system is: no history, no roadmap.
  9. 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.

03Skills.claude/skills/

Thirty-eight skills

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.

Deploy

the server stack, to an environment
  • /deploy-devBuild each new revision once, restart dev on it, stamp the builds healthy.
  • /deploy-prodShip the builds dev proved and roll them out, one replica at a time.
  • /cue-deploy-verifyCommit, push, deploy to dev, run the API suite, check every container.
  • /api-testRun the live API suite against the deployed dev server.

Install

a dev build onto a device
  • /install-iosBuild the debug app and install it on a connected iPhone.
  • /install-androidBuild and install the Android app on a device or the headless emulator.
  • /install-notes-iosInstall Cue Notes for iPhone’s dev build on the simulator or an iPhone.
  • /install-notes-androidInstall Cue Notes for Android’s dev build on an emulator or a device.

Release

ship to people
  • /release-cliBuild, test and release the Go CLI through GoReleaser and Homebrew.
  • /release-macosSign, notarize and publish the Mac app: DMG, Homebrew cask, Sparkle appcast.
  • /release-androidPublish the signed bundle to a Google Play track; promote to production when asked.
  • /release-notes-iosArchive, verify and upload a Cue Notes for iPhone build to TestFlight.
  • /release-notes-androidSmoke-test the minified Cue Notes bundle, then publish it to a Play track.
  • /release-iosRun the unit suite, then archive, verify and upload a build to TestFlight.
  • /ios-release-notesWrite the App Store notes for the current version, then bump it.
  • /tagCut and push a semver tag, with a note on what it represents.

Dev data

a world to test in
  • /reset-dev-dataReset the dev database to a showcase world: people, events, decisions, trips, channels, chats and notes.
  • /clear-dev-dataWipe all user data from the dev database.

Maintenance

keeping it current and true
  • /ai-evalRun the AI golden set through each feature’s real service: pass rate, latency, cost.
  • /dep-upgrade-coreUpgrade Gradle and Spring dependencies, core’s base and stock images; verify tests and boot.
  • /dep-upgrade-webUpgrade npm dependencies and both web apps’ base images; verify builds and dev-server boot.
  • /dep-upgrade-cliUpgrade Go modules; scan for vulnerabilities, verify build, vet and cross-compile.
  • /dep-upgrade-iosUpgrade Swift packages; verify the simulator build and the unit tests.
  • /dep-upgrade-notes-iosBump Cue Notes for iPhone’s exact pins; verify conformance and the simulator suites.
  • /dep-upgrade-notes-androidUpgrade Cue Notes for Android’s catalog; verify conformance, goldens and the R8 bundle.
  • /dep-upgrade-macosUpgrade Sparkle and the Notes engine’s pins; verify conformance, a clean build, unit tests.
  • /dep-upgrade-androidUpgrade the Gradle version catalog; verify tests, screenshot goldens and the R8 release.
  • /refresh-public-docsLeave these four pages true to the source and a pleasure to read.
  • /refresh-docsCheck the internal design docs against the source; cut stale claims and history.
  • /refresh-api-testLeave the live API suite fully covered, tight and current; prove it green.
  • /refresh-skillRewrite one skill as a bar for a capable agent, losing no hard-won fact.

Building something large

phased projects
  • /lantuDraft the one-shot prompt a later session runs to scaffold a phased project.
  • /jungongCarry a phased project to its end unattended, one fresh subagent per phase.

Session workflow

the everyday loop
  • /static-usersSign in to dev as a test user with a fixed code, then reset it.
  • /verify-webProve a web change on the dev site in a real headless browser.
  • /verify-adminRender every admin page against dev, both themes, desktop and phone.
  • /fuziStage, commit and push all pending work in one pass.
  • /wufengEnd-of-session review: delivered end to end, flaws fixed, the change exercised.

Inside one skill

A skill has few parts. This is the one the loop leans on most, read from the top.

cue-deploy-verify/SKILL.mdexcerpts
  1. ---
    name: cue-deploy-verify
    1
    The name is the command

    A skill is a directory. Its name is what gets typed after the slash.

  2. description: Commit, push, deploy to dev, run the API suite, and verify every container and public URL is healthy — one command, one summary
    2
    One line to be found by

    An agent picks a skill by this line, so it says exactly what the skill does.

  3. allowed-tools: Bash, Read, Grep, Glob
    ---
    3
    Only the tools it needs

    This one may run commands and read files without asking; any other tool asks first.

  4. ## 2. Deploy and verify
    … ./omni-deploy.fish --verify
    4
    The exact command

    Where a command’s shape is the contract, the skill spells it out. The rest is left to judgment.

  5. ## 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.
    5
    What done means

    A bar, not a script: stated so any run can be judged at a glance.

  6. ## On failure
    2, API red — … investigate, don’t blindly re-run …
    6
    What was learned the hard way

    Each 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.

04Proof

How it knows it works

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.

The API suite/api-testruns 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-adminruns 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-evalruns 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.fishruns 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.

05Ship it

From commit to production

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.

One build’s way to production
DevProduction
01

Commit and push

Pending 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

02

Build once

A 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

03

Run it on dev

Dev 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

04

Prove it

The 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

05

The gate

A 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

06

Ship

The 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

07

Adopt

Production 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

08

Roll

The 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

09

Or roll back

If 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.

The registry, as the gate reads itpress a stamp to take it away
  • cue-corehealthy
  • cue-front-end
  • cue-admin
Deploy with --unverified, the hotfix lane
The gate opens. The ship begins.

Every 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.

Fig. 2 / Rolling deploy
cue-lbnginx · round robincue-core-1v41 · servingrecreatingv42 · healthycue-core-2v41 · servingrecreatingv42 · healthy12345

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.

While one replica is recreated, nginx sends everything to the other.

A dry run

--plan runs both servers' halves and changes nothing. Per image it says whether the registry holds the build, which stamps it carries, what the gate would say, and whether production already holds it.

A hotfix lane

--unverified lets a backend build through the gate that is healthy on dev but not yet verified by the suite, and waives nothing else. The run's summary and the Builds page name it.

Break-glass

If the dev server can't be reached and a deploy can't wait, --break-glass skips the ship and the gate: production builds all three images from its own checkout and rolls them as usual. That run is marked too.

Rehearsed, failures included

A rehearsal script replays the whole path against a scratch copy of the production stack: a break-glass deploy, a refused gate, a ship cut mid-pull, a build that won't boot, a stopped registry, a check that goes red after the roll.

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.

06Images

Three images, two platforms

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.

cue-corebuilt 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-endbuilt inA Node stage: Next.js builds its standalone output.runs asDistroless Node as an unprivileged user: no shell, no package manager.
cue-adminbuilt 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.

07Releases

Out to people

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.

Cue for iPhone/release-iostoTestFlight. Submitting to the App Store is a person’s step.
Cue for Android/release-androidtoGoogle Play’s internal track. Production is that same build, promoted.
Cue for Mac/release-macostoA notarized DMG, a Homebrew cask, and the feed the app updates itself from.
Cue Notes for iPhone/release-notes-iostoTestFlight.
Cue Notes for Android/release-notes-androidtoGoogle Play’s internal track, after the minified build is smoke-tested.
CLI/release-clitoBinaries 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.

Built with Claude Code – Cue