pnpm generate
Turn one sentence into a running app. Claude synthesizes a demo-spec JSON from your idea, the spec is validated, and it is scaffolded through the same pipeline as the built-in demos — so a generated app rides the exact code paths the test matrix covers.
pnpm generate "a habit tracker with streaks" --db supabase --features mcp
How it works
- The idea + a strict spec contract go to claude-opus-4-8 (adaptive thinking, official SDK).
- The returned JSON is parsed (fenced or bare), then run through loadDemo + validateRefs — the same validation --demo ./spec.json uses.
- It scaffolds via the normal pipeline: all flag validation, feature stripping and the leak guard apply.
- The synthesized spec is written to apps/<slug>/spec.json so you can reshape it later.
Flags
- --slug <name> — override the derived slug.
- --db convex|supabase, --features a,b, --design/--accent/--mode/--layout/--title — passed through to the scaffolder.
- --spec-only — synthesize + validate the spec, print the command, do not scaffold.
- --mock <file> — read the model output from a file instead of calling the API (offline / testing / spec iteration).
- --json — emit the machine-readable result line.
Needs ANTHROPIC_API_KEY in the environment. Without it, the command tells you to write a spec by hand and use pnpm new <slug> --demo ./my-spec.json instead.
The spec contract, field types and role keys are identical to a hand-written spec file — see the demo-apps page and the entity-views reference.