@octabits-io/create
A new app on the octabits platform, ready for a coding agent:
npm create @octabits-io@latest my-app
cd my-app
pnpm dev # http://localhost:3107 — no Docker, no keys
claude # or: codex
Use npm to start it, even though the app itself uses pnpm (the CLI runs pnpm install): npm
checks the registry for @latest, while pnpm create serves what it downloaded on an earlier run
for up to a day, @latest or not. With pnpm, pin the version (pnpm create @octabits-io@0.2.0)
or pass --config.dlx-cache-max-age=0.
Without pnpm on your PATH, create installs through Corepack (bundled with Node 22–24), which
fetches the pnpm version the app names; corepack enable pnpm then gives you the pnpm command.
With neither, it creates the app, skips the install and says how to get pnpm.
The app names the pnpm the platform runs (12, packageManager), and a pnpm on your PATH switches
to it on its own. Its settings are in pnpm-workspace.yaml, with the platform’s two supply-chain
gates: a version published less than a day ago is not installed (minimumReleaseAge: 1440; pnpm add takes the newest version that is a day old, an exact younger one is refused), and a
dependency’s install script runs only when the package is listed in allowBuilds with a reason
(strictDepBuilds). The @octabits-io packages are private on npm: put a read-only token in your
user config once (npm config set //registry.npmjs.org/:_authToken <token>; pnpm and npm both
read it), and give CI and the image NPM_TOKEN. The app ships no .npmrc: pnpm 11 and later
ignore a token a project’s .npmrc reads from the environment. pnpm run doctor checks both.
The same file approves every platform package’s agent skills, so pnpm links the skills of the
packages the app installs — add-a-scoped-table from rls, add-a-queue-job from queue, one
or more from each — into .claude/skills and .agents/skills as pnpm-@octabits-io+<package>-<skill>,
beside the app’s own, at the version installed and kept current by every install; npx skills experimental_sync is not needed in a created app.
On a terminal it asks three questions (arrow keys and Enter, with @clack/prompts), installs behind a spinner and ends with a summary of the next commands:
| Question | Answers | What it writes |
|---|---|---|
| Sign-in | none for now · Better Auth, inside the app · Zitadel · Microsoft Entra ID · another OIDC provider | Better Auth: AUTH_PROVIDER=better-auth and a generated BETTER_AUTH_SECRET, nothing to fill in. A provider: the AUTH_* block of .env.local, with <placeholders> for the ids your provider gives you (pnpm run doctor lists the ones still open) |
| Model | scripted · a model you run · a model a runner serves from a machine the app cannot reach · Mistral, hosted in the EU · Anthropic or OpenAI, hosted in the US | AI_MODEL=local, the server URL and the model id; AI_MODEL=runner, the model id and the runner tags (the runner is registered on the settings page, octarun started on its machine); or AI_MODEL=mistral, anthropic or openai and a placeholder for the API key (the vendor becomes a subprocessor; Anthropic and OpenAI are a third-country transfer, and .env.local, the closing summary and pnpm run doctor say so) |
| Database | embedded PGlite · Postgres in Docker (the platform’s local stack) · a Postgres you have | DATABASE_URL |
| Capabilities | a multi-select beside the core: example, files, mail, knowledge, import, links, legal (the consumer-law pages: a cancellation and a withdrawal button, the generated imprint and privacy notice), decisions, mcp, assistant (a chat that reads and proposes with the MCP endpoint’s tools) — the example and decisions ticked | the code itself: what you leave out is not in the app (below) |
Whatever the answers, .env.local also gets a PII_MASTER_KEY generated for this app — 32
random bytes, the key every organisation’s encryption key is wrapped with. .env.local is
gitignored; give production its own key and keep both with your other secrets, because losing one
loses every value encrypted under it.
The first three answers are configuration only. The fourth chooses code.
The core is always there and carries the platform’s promises: row-level security, encrypted
personal data, the ledger with its anchor and the audit evidence, access and erasure requests for
every kind of person the app keeps data about, events, jobs, the bell, telemetry and the guard.
Capabilities are the parts beside it, each with its files, tables, packages and skill: the
example (contacts, their notes and the AI brief a person reviews — propose, apply, revert), files on
a contact, mail to a contact, the knowledge base, spreadsheet import, signed links, the AI decision
(the triage), the MCP endpoint, and the assistant (a chat on the MCP endpoint’s tools). Files, mail, the import, signed links and the decision hang off
the example’s contacts and bring it with them; --with none is the bare core, nothing beside it, for
an app that starts from its own domain. Better Auth comes with
--auth better-auth, and agents’ sign-in through it when MCP is in too. A capability left out is
not in the app at all: its files, its lines in the lists the core reads and in AGENTS.md, its
packages; the app’s first migration is generated from its own schema after the install, and
package.json records what it has (octabits.capabilities), which pnpm octabits upgrade keeps to. The template is tested whole on every
pull request, and with the bare core and the core plus each capability (scripts/check-capabilities.mjs). The closing message lists the next
commands for what you chose (with Zitadel in Docker: the compose profile and the script that
registers the app; with mcp: claude mcp add --transport http <app> http://localhost:3107/api/mcp,
which connects Claude Code to the app, and how the agent signs in with the sign-in you chose).
The app is Next.js, React and shadcn/ui on Drizzle over embedded PGlite (Postgres through
DATABASE_URL), in English and German from one text catalog (messages/; APP_LANGUAGE=de makes it
German by default, and an app’s own texts go in messages/<language>/app.json). Every table carries the organisation under forced row-level security, an AI step
proposes and a person applies, an AI decision applies itself when it is sure and asks a person
when it is not, every applied change is in a hash-chained ledger and can be reverted, every
model call passes a disclosure gate, and a person’s data is stored encrypted under its
organisation’s key.
What makes it a place to build with an agent:
AGENTS.md |
the app’s rules, each with the check behind it, the file map, the recipes, which platform package does what |
skills/ |
step-by-step recipes ending in the command that proves them, linked in .claude/skills (Claude Code) and .agents/skills (Codex) |
pnpm guard |
the platform’s promises as checks over the app: migrations match the schema, every table scoped or declared global, the app role bound by the policies, runtime isolation and the tenant isolation matrix over every scoped table, the purge manifest, no model around the disclosure gate |
| Stop hook | .claude/settings.json and .codex/hooks.json run the guard when the agent ends its turn and send it back with the failures |
| SessionStart hook | the same two files give the agent a few lines on the app before its first turn — its capabilities, the settings still <placeholders>, the database and its migrations — read from files alone, never a failure (scripts/session-start.mjs) |
docs/platform/ |
every platform package’s README at the released version, and the index over them — for the packages the app has not installed yet |
| CI | pnpm guard, typecheck, test and build on every pull request |
Options
npm create @octabits-io@latest <dir> -- [--auth none|better-auth|zitadel|entra|oidc] [--model scripted|local|runner|mistral|anthropic|openai]
[--model-url <url>] [--model-id <id>] [--runner-id <id>] [--db pglite|docker|postgres] [--database-url <url>]
[--with all|none|example,files,mail,knowledge,import,links,decisions,mcp,assistant] [--yes] [--no-install] [--no-git]
Every question is a flag; with npm create, flags go after --. Without a terminal (a coding agent, CI, a script) nothing is asked and
the defaults fill in what no flag says; --yes does the same on a terminal. --db postgres
needs --database-url: a URL is never guessed. Without a terminal --with defaults to all: an
agent or CI gets the template as it is tested whole. --no-install skips pnpm install; --no-git
skips git init and the first commit (the guard hook checks only what changed since that commit).
A coding agent setting an app up for a person follows the package’s set-up-an-app skill
(skills/set-up-an-app/SKILL.md, also served as https://octabits.io/start.md): it asks what the app
is for before anything else, recommends each answer from that — only the capabilities it calls for —
always passes every flag, and ends in the app’s first spec. A test holds its answers to the flags’.
Upgrading an app
pnpm octabits upgrade # in the app; then, after any conflicts: pnpm octabits upgrade --continue
The app’s octabits script runs the octabits command of the latest @octabits-io/create, which
moves the app to the template that version carries. package.json records the template an app was
created from ("octabits": { "template": "0.12.0" }); an app older than that field is dated by its
first commit — its own folder’s, inside a monorepo — checked against its platform package ranges, and
refused when they disagree, or told with --from <version>.
An app records its capabilities (octabits.capabilities), and both templates are merged as the app
would have them — with those only: what changed in the core and in its capabilities comes in, a
capability it was created without stays out, and so does one the template gained since (pnpm octabits add brings it). A capability the new template made of what was its core (the example, in
0.16) is kept where the app still has its files and left out where it removed them by hand; the
record follows. An app created with capabilities left out has migrations of its own,
generated from its schema; its next one is too, and the template’s new migrations are listed in the
report for you to read for any data step your rows need.
An app with no record (one that removed capabilities by hand, say) gets one: upgrade, add and remove
read it from which of each capability’s files the app has, write it, and print what they decided. More than
half of its files and the app has it; half or fewer and it is left out, along with anything that needs what
is out, because leaving one out touches nothing while counting one in brings back what the app deleted. A
capability partly there is named either way. To overrule it: undo, write octabits.capabilities, commit, run
it again.
- On a clean git tree only, so the upgrade is one diff you can read and undo
(
git restore . && git clean -fd && rm -rf .octabits-upgrade; the state dir is gitignored). - Each file is a three-way merge of the old template, the new one and the app (
git merge-file): untouched files take the template’s version, files both changed are merged, and lines both changed are left with conflict markers. A block between<!-- BEGIN:octabits-… -->and<!-- END:octabits-… -->(the agent rules at the top ofAGENTS.md) is the template’s: it is replaced as a whole, and the app’s edits around it are kept. - A file the template moved (named in its
moves.json,{ "<version>": { "<old path>": "<new path>" } }) is moved in the app first, for every version after the app’s template, oldest first: the app’s edits are merged at the new path, and no copy is left at the old one. capabilities.jsonis merged by capability and then by file, so an app that reordered it merges like any other and a new line lands in its entry. A value both changed, or an entry one side removed and the other changed, is a real conflict, left between markers.- What is the app’s is never merged, once it has it:
messages/<language>/app.json,src/lib/app-language.ts(the app’s default language) andtext-exempt.json(the files check 24 lets stay out of the catalog). package.jsonis merged by key, its dependencies kept in order where the app kept them so; every platform package moves to the version released with the new template, together, one the app uses on its own account too, whose capability it left out: its range and the app’sminimumReleaseAgeExcludeagree after the merge. An app that links the packages from its workspace (workspace:*, an app in a monorepo that builds them from source) keeps its links, and a package the template adds is linked too.- The template’s new migrations are not merged into
drizzle/:pnpm db:generatewrites one migration after the app’s own from the merged schema, and its SQL is replaced by the template’s. - A merge of lines cannot know that a line the template removed cleanly was one the app’s own code still needed. So the report lists names the app still uses that the template took away: an import that went from a file the app changed while the file still uses the name, and a name a file imports from a module that no longer exports it. That is read from the text, so it is a lead, not a proof, and it sees nothing that has no import (a key in a string, a behaviour the app counted on).
- The first
pnpm guardafter the upgrade that brings the text catalog fails on an app with pages of its own (check 24 reads every.tsx), and the report says so before it runs, naming each: translate it, or name it with its reason intext-exempt.json.pnpm octabits upgrade --continue --exempt-own-pages "<why>"does the second for all of them:textsfor each,formatsfor those that format by the browser. A reason the app wrote stays. - Then
pnpm install, the skills relinked for Claude Code and Codex,pnpm typecheck(the proof of the list above) andpnpm guard; either failing fails the run, with the upgrade left in the working tree and still in progress:.octabits-upgrade/stays until both have passed, sopnpm octabits upgrade --continueruns them again after the fix (its migration is not made twice). The notes between the two versions close the report. - The install gets past the day’s gate by itself.
minimumReleaseAgeExcludemoves with the versions, while the lockfile still holds the old ones, and pnpm holds every lockfile entry to the gate before it resolves anything: within a day of two consecutive releases it would refuse the version it is about to replace. So the install runs with the lockfile’s platform versions excluded too, then the template’s list goes back and a second install settles the lockfile under it. A platform version no range moves, one the app reaches only through another package, can stay in the lockfile: when it is under a day old it stays on the list too, and the run names it for you to drop. After--no-install, a plainpnpm installmeets that gate: runpnpm octabits upgrade --continue, or wait the day. - It stops at a checkpoint: a release every database must have run before the app goes past it,
because a later template drops columns whose contents only that release’s backfills move (0.7.0,
before migration 0012).
--to <version>upgrades to it; deploy it everywhere, commit, then upgrade the rest of the way.
An app created before the octabits script existed runs it once from its directory:
npm exec --yes --package=@octabits-io/create@latest -- octabits upgrade.
upgrade, add and remove say how they ended in their exit code, through pnpm octabits too, for a
script or an agent:
| Exit code | Meaning |
|---|---|
| 0 | done |
| 2 | stopped at conflicts, the report above it: resolve them, then --continue (a --continue that finds markers left says the same) |
| 1 | anything else: a failed pnpm typecheck or pnpm guard, a failed install, a refusal |
Adding a capability
pnpm octabits add mail # in the app; after any conflicts: pnpm octabits add --continue
Brings capabilities the app was created without (example, files, mail, knowledge, import,
links, decisions, mcp, assistant, better-auth, with what they need) from the template it is on (octabits.template): each file merged
three ways — the template without them, with them, and the app — so what the app changed stays and
the capabilities’ marked lines come back; their packages added to package.json and recorded in
octabits.capabilities; then pnpm install, a migration for their tables, the skills relinked and
pnpm guard. On a clean git tree only, so the change is one diff. The app’s add-a-capability
skill is the procedure.
Removing a capability
pnpm octabits remove example files mail import links decisions # after any conflicts: pnpm octabits remove --continue
Takes capabilities out the same way, the other direction — the example (contacts, notes, the brief),
once the app is your own: their files where the app left them as they came (one it changed is kept,
and named), their marked lines, the pairs that go with them, their packages, their record — and the
app’s own share of them: the files its capabilities.json lists under them and the lines it marked
@capability <name>, deleted and named; then
pnpm install, a migration that drops their tables — every drop under a -- reviewed: line naming
the removal, for pnpm guard — the skills relinked and pnpm guard. A capability another one still
needs is refused until both are named. The migration deletes the rows in those tables: read it, and
run pnpm db:dry-run against a copy of a database that holds data first. The app’s
replace-the-example skill is the procedure.
How the template is made
It is the platform’s apps/starter, tested on every pull request in the platform repository,
exported into this package when it is released (scripts/export-template.mjs --package). The
package versions in the created app are the ones released with this version of create.
npm drops every .gitignore from a package, at any depth, so the template carries each one as
gitignore and create (and pnpm octabits upgrade, which reads the template the same way) gives
it its name back — among them infra/dev/zitadel/.gitignore, which keeps Zitadel’s admin token out
of the app’s git, and infra/single-host/.gitignore, which keeps the host’s env files, certificates
and dumps out. An app created from a release that dropped them has neither; its next pnpm octabits upgrade
adds them.
Validating the platform before a release, from a checkout with the packages built:
node packages/create/bin/create.mjs /tmp/try --link .
--link packs every platform package as npm would publish it and installs the app from those
tarballs, so pnpm dev, pnpm build and the guard run against exactly what the release would ship.
When not to use it
- You already have an app. Install the packages you need; each README says how. Give its
agent the platform’s procedures with the
skillsCLI, for Claude Code, Codex, Cursor and the rest:npx skills experimental_syncinstalls the skills shipped in the packages the app depends on, at the versions it installed;npx skills add octabits-io/octabitsinstalls every offered skill — one or more per package, plusstart-an-appand the Zitadel and Entra ID setups. - You want the Hono or Nuxt stack. The template is one stack on purpose; the platform’s
packages work on any (see
start-an-appin the platform repository).
License
MIT
From @octabits-io/create@0.32.1 in the platform repository.