# Designing Tappa prototypes from this project

You are designing a clickable, image-generated app prototype. The creator
sees your work live: every `push` updates their open canvas at the editor
link in about a second. This file is the deal — read it once, fully.

`node tappa.mjs init "one-line app idea" [--brand "Product Name"]
[--device phone|tablet|desktop]` — state the device class explicitly when you
know it; inference from the brief text is only a fallback for when you don't
say. `--brand` is the name PAINTED ON THE SCREENS: the project title is just a
workspace label, but it's also what the renderer falls back to, so when the
idea names the app ("a savings dashboard for Ledgerly") pass that name here or
the label is the wordmark your screens will carry. Need an exact size instead of
a named format? `--aspect 16:10` (or `--aspect 1.6`) or `--width 1600
--height 1000` wins over `--device` — same on `design` (below). Valid range
is 1:3 to 3:1 (gpt-image-2's hard aspect cap); an out-of-range value is
rejected with the valid range, never silently clamped.

**App or graphic.** A project is an app prototype (the default) or a GRAPHIC
design project for its whole life — `node tappa.mjs init "autumn launch for a
coffee roaster: poster, flyer, IG set" --kind graphic` makes the second
(`--kind ui` is the explicit default). Pick it from what the user asked for,
never guess it from keywords. A graphic project is free-floating artboards
(posters, flyers, social posts, each at its own format) — no plan seeded, no
plan.sketch / push loop, no flows, hotspots or tab bars, and no `--device`
(each artboard's format sets its size; `--aspect` only changes the default,
4:5). Its artboards are made by Mio (`node tappa.mjs chat "..."`) or the MCP
artboard tools. Each new artboard gets a drafted TEXT LAYOUT, its wireframe:
every copy line as a block (its words, where it goes, how big), shown on the
board for the user to approve before the first paid render — MCP
`set_artboard_text_layout` reads or changes it, `render_artboards` with
`approve_layout: true` approves and renders it. The render PAINTS each line in
the brand's own type, about at its block: MCP `lift_text` reads the painted
words and retypes them, `add_text` puts exact live text on top, and
`export_print` makes the 300 dpi print file. MCP `export_psd` makes a layered
Photoshop file of a design that has been lifted into layers, and
`export_after_effects` makes After Effects files of a motion take (both free).

**Continue where the user is working.** Before `init`, judge from context:
when the user is continuing work on a product that already has a project
(what they were just working on, or the one they name), put the new screens
INTO it (`init --join <id>`, then add cards to `plan.sketch` and `push`) so
they share its brand, story bible and existing screens as references. Start a
new project when they ask for one or it is a separate exploration; ask when
unclear. `init` (and the MCP's `create_prototype`) lists your other projects
for the same product as a reminder. A brand is reused across projects with
`save_brand_from_prototype` + `apply_brand` — never by re-submitting its
tokens, which renders a different poster.

## Who does the thinking

You do. Wherever Tappa's own AI would author something — the wireframes, the
brand's design system — Tappa can hand YOUR model the exact instructions its
own model gets and then check and save what you send back, with no Tappa
model running (`author --kit` / `--submit` for wireframes, `resynth --kit` /
`--submit` for the design system; over the MCP, `get_wireframe_kit` /
`submit_wireframes` and `get_brand_system_kit` / `submit_brand_system`, which
is the default there). Tappa itself spends only on images — renders and the
brand-kit poster. Want Tappa's own AI (Mio) to do the thinking instead? Talk to
it with `chat` (the MCP's `chat_with_mio`).

## The medium

- `plan.sketch` — THE file you edit. A PROTOSKETCH plan: one boxed card per
  screen plus a FLOW block. Grammar below.
- `nav.json` — the tab bar, nav style, and App Map (see "Tab bars, nav
  style, and the App Map" below) — PROTOSKETCH text has no band for these,
  so they live in their own file, pulled/pushed alongside `plan.sketch`.
- `screens/<id>.webp` (or `.png`) — pulled renders of built screens, each
  named after what its bytes really are (renders are usually WebP). LOOK at
  them; they are your output. `pull` refreshes them.
- `brand.json` — the applied design tokens (read-only; the creator or Mio
  manages brand).
- `tappa.json` — prototype id + the plan version you're on. Don't hand-edit.

## Grounding in an existing app

If this flow EXTENDS or REDESIGNS a REAL app (not a greenfield idea), ground
FIRST, before planning — every forward design should look and feel like the
app it's part of, not a generic reinterpretation.

1. Get a screenshot of EVERY screen you'll redesign — produce them
   yourself. You have the code: run the app (its dev server) and screenshot
   each screen with your own browser tooling at its real device size.
   Behind sign-in, use a test account or render the real components with
   realistic fixture data on a dev-only route. Ask the creator only when
   you truly can't run it, and never redesign from the brief or the source
   alone. **Tappa's server cannot reach localhost** — the capture has to
   happen on YOUR side, not Tappa's.
   **Size ceiling: about 3MB.** Screenshots travel as base64, which inflates
   them by a third, and the platform rejects bodies past roughly 4.5MB — so
   the CLI refuses anything over 2.8MB up front rather than letting you hit
   an opaque 413. Take a VIEWPORT screenshot (one screen, not the full
   page) or downscale to ≤1600px wide; one screen carries all the signal
   either the import or the brand extraction needs. (Redesigning ONE page
   itself — the MCP's `plan_redesign_of_screen` journey — is the exception:
   capture that page in FULL and downscale to fit, never crop. A page that
   scrolls inside its own container returns one viewport from a plain
   full-page screenshot; grow the viewport to the container's scrollHeight.)
2. `node tappa.mjs seed <path/to/screenshot.png>` — imports it as the flow's
   base screen (auto style-anchored server-side — no extra step), then
   vision-reviews it into a regenerable, back-linked planned screen. Prints
   a compact report (name · archetype · purpose, element count, the
   back-linked planned screen id). A NEW project is named `--name "Acme"`,
   else `--screen "Home"` (the screen's name), else the reviewed screen's
   name — never left as "Imported prototype" (same as MCP
   `seed_from_screenshot`'s `name`).
3. Ask the creator: keep the current look, or go a new direction? Keeping it,
   take the FIRST of these that applies:
   - **The brand is already saved.** `init --brand X` and `seed` print a saved
     brand of the same name when the creator's library holds one; reuse it:
     `node tappa.mjs brand --saved <bid>` (no id lists them). It is the brand
     the creator already approved — nothing is re-extracted or re-invented.
   - **Best, when you're in the repo: the token packet.**
     `node tappa.mjs brand --tokens <path/to/globals.css|tailwind.config.ts|tokens.json>
     [--screenshots a.png,b.png] [--fonts "Display, Body"] [--name X]` sends the project's
     own token file (read off disk — works for private repos and localhost
     apps), up to 4 screenshots of the running app, and the real font
     families. Token NAMES say which hex is the page, which is a card, which is
     body ink — Tappa reads those roles in code instead of guessing them from
     pixels. `--tokens` works alone or on top of any source below, and wins
     where it speaks; `--fonts` stops the typefaces being guessed. The command
     prints how many roles it read (0 = the file didn't parse — pass the file
     that actually defines the theme), plus any hex it adjusted and why.
   - `brand --from-url <https://deployed-app>` — exact hexes and font names,
     read from the live CSS plus vision. `brand --from-repo <owner/repo>`
     **reads PUBLIC GitHub repositories only** — it goes through the GitHub
     API, so it cannot see a local path, a private repo, or your working
     tree, and it parses plain hex/CSS-variable declarations (modern
     `oklch()` / bare-HSL / `var()` indirection are missed).
   - Pixels alone: `node tappa.mjs brand --from-screenshot <same.png>` — the
     kit is transcribed from the app's real pixels (palette, type, shape),
     never restyled. A screen with no legible wordmark carries no name, so
     the kit takes the project's brand name (or `--name X`); without either
     the command warns that the name was guessed.
   - New direction → `node tappa.mjs brand --new "<brief>"` — a fresh kit,
     synthesized from a one-line description.
   Every `brand` run names the kit after the project's brand name unless
   `--name` says otherwise. Before approving a build, LOOK at the kit poster
   (`pull` → brand-kit.webp): `status` and the build log warn when the kit is
   named for another product than the project.
4. Match the CODE, not just the look: `node tappa.mjs manifest [dir]` (run it
   in the repo). It scans the repo ON THIS MACHINE — no source is uploaded —
   and sends only a small manifest: each component's import path, export and
   the props it really declares (TypeScript interfaces / type aliases,
   destructured params, forwardRef, cva variants; SwiftUI `View` properties),
   the routes (Next app/pages router, Remix / React Router / TanStack file
   routes, Expo Router, router configs), the token file, framework, styling
   and icon library. Tappa then binds plan parts to your real components by
   name (button → Button, list row → ListItem/ListRow, tab bar → Tabs; a part's
   emphasis → your cva variant value) and records which real components the
   seeded screen uses, so the flow you plan next reuses them. The output lists
   `bound`, `AMBIGUOUS` and `unbound` parts — YOU decide those:
   `node tappa.mjs manifest --map row=TransactionRow --map fab=none` (keys are
   component ids, slots or part kinds; `none` leaves a part unbound).
   `--no-upload` only writes `.tappa/repo-manifest.json`; `--show` prints what's
   stored. Limits: no cross-package or node_modules type resolution, no barrel
   re-exports — a prop it can't see is never claimed, so bindings only ever
   pass props your component declares.
5. From here, every forward design renders grounded in the current app: the
   imported seed anchors flow style (layout, density, chrome), the brand kit
   anchors palette/type/shape, and the repo manifest anchors the components.

### The whole app as originals (an app-wide redesign)

To redesign the app itself (every screen, not one) bring its real screens in
as ORIGINALS: captures grouped in their flows and wired the way the app is,
which the redesign then edits. Three sources, one result:

- **Screenshots you take** (localhost and private repos: Tappa's server can't
  reach them). `node tappa.mjs originals <folder> [--map flows.json] [--name
  "Acme"] [--no-review]` imports one screenshot per request and reviews each
  as it lands. A page that scrolls is best captured in full (downscaled to
  fit), since the redesign edits what the capture shows; a viewport-sized file
  works too (an app that scrolls inside its own container returns one viewport
  from a plain full-page shot anyway). The 2.8MB cap above applies to each file. With no map, the folder's top files are
  the flow "Main", each sub-folder is a flow and file order is its steps, with
  no links (a folder doesn't say which tap leads where). A map, in the spirit
  of flow-review, says more; each link is wired into the plan once both of its
  ends are reviewed:

  ```json
  { "name": "Acme",
    "flows": [{ "name": "Onboarding", "steps": [
      { "id": "welcome", "screenshot": "shots/welcome.png", "route": "/welcome" },
      { "id": "signup", "screenshot": "shots/signup.png" } ] }],
    "edges": [{ "from": "welcome", "to": "signup", "label": "Get started", "type": "sequence" }] }
  ```

- **A deployed site**: `node tappa.mjs originals --url https://acme.com [--max 6]
  [--paths /pricing,/settings]`. The server captures the home page and the
  pages its own nav names (wired home → each page, in the nav's words), at most
  8, and reviews each. A nav drawn in script is invisible to it: then it reads
  the site's `/sitemap.xml` (unwired), else only the home page lands — pass
  `--paths` to name the pages.
- **A PUBLIC GitHub repo**: `node tappa.mjs originals --repo owner/name [--url
  https://acme.com]`. Its screens, flows and links are mapped from the code and
  each screen at a static route is captured at the deployed URL (`--url`, else
  the repo's GitHub homepage). A screen it can't capture (a dynamic route, no
  route) stays a plan entry "drawn from the code's description" until you
  screenshot it and import it onto that entry: `node tappa.mjs originals
  shot.png --onto <planScreenId>` (or `"onto"` on a map step). No deployed URL,
  or a private repo: use the screenshot path (refused before anything is
  charged).

Importing into a project that already has a start screen leaves it as it is.
A review that failed (a gate, a timeout) is re-run alone with `node tappa.mjs
review <screenId>` (~2¢); it also wires that screen's waiting links.

Then ask the creator which redesign: **on_brand** (their brand kept; layout and
hierarchy change per 2-4 edits you agree), **restyle** (their brand and every
page's layout kept; only the visual finish is reworked: type scale, spacing
rhythm, surfaces, imagery treatment) or **new_brand** (`brand --new "<brief>"`).
Keeping the brand: `node tappa.mjs brand --tokens <your theme file> --screenshots
a.png,b.png`. Then plan every redesign in one call:

```sh
node tappa.mjs redesign-app --mode on_brand --direction "lead with the product shot; a denser grid"
node tappa.mjs redesign-app --mode restyle                 # brand + layout kept, finish reworked
node tappa.mjs redesign-app --mode new_brand               # after brand --new "<brief>"
node tappa.mjs redesign-app --mode on_brand --screens <id1>,<id2> --direction "..."
```

It is FREE (nothing renders): one new plan entry per reviewed original, the
originals untouched, the flow carried over (a link from A to B now leads from
A's redesign to B's), the first redesign the start screen. It prints each
redesign, every skipped original with the command that unblocks it, the links
carried, the brand line (what the brand still needs, as a command) and the
build quote. `on_brand` needs `--direction` (2-4 edits agreed with the
creator), or `--recreate` for faithful recreations on purpose. Show the creator
the plan, and `build` only with their yes. Captures are free; each review and a
repo's code map is a metered vision read (~2¢); nothing renders until the
build.

`originals` and `redesign-app` PULL for you when they finish (plan.sketch,
nav.json and the plan version follow the server), so the next `build` or
`push` starts from the plan they wrote. A `push` of that plan.sketch keeps each
redesign's source, content and direction (carried by its id) and every link
(they are in the FLOW block); a card you delete from plan.sketch is a screen
you remove.

**After a re-review** (a review that reads a page better, `node tappa.mjs
review <screenId>`): the original's redesigns NOT built yet take the new read
by themselves (ids, links, direction kept). Built ones are only named as
behind; nothing is redrawn without a yes:

```sh
node tappa.mjs redesign-app --refresh [--screens <redesign or original ids>]  # free: their plans take the new read
node tappa.mjs regen <screen>                                                 # one paid render each, a yes first
```

Changed the brand references (library picks, style pulls, uploads) or the
brief AFTER a kit already exists? `node tappa.mjs resynth [--brief "..."]` re-rolls
its tokens (unlocked ones only — locked tokens survive) and re-renders the
poster in the background, cheaper than re-running `brand` from scratch. It keeps
honoring the brand direction the creator already picked; add
`--direction "<name>"` to synthesize from a different proposed direction, whose
hexes and typefaces then become hard commitments.

Or author the new design system with YOUR model: `node tappa.mjs resynth --kit
[--brief "..."] [--direction "<name>"]` writes the exact input Tappa's own
synthesis model gets into `.tappa/brand-kit/` — `prompt.md` (its full prompt:
the product, the plan, a picked direction's locked hexes/typefaces, the rules),
`references.md` (the reference images it sees first, in order) and
`output-schema.json` (answer with ONE JSON object per this schema; the eight
colors as `#RRGGBB`). Then `node tappa.mjs resynth --submit system.json` runs
the same checks and post-processing Tappa's own answer takes, saves it, and
renders the brand-kit poster from it — one image generation, so get a yes (with
`--caller`, YOUR image tool draws the poster instead: free, its kit lands in
`.tappa/kits/poster/`). (The
poster is the moodboard people look at; every screen render attaches the
brand's component sheet — this app's own components drawn in these exact
tokens — with the exact hexes and fonts in the prompt text, so what you submit
is exactly what renders.) A
system that needs work prints `NEEDS FIX` with the exact correction; a short
component anatomy is the one check you may keep with `--accept` after a round.
Authoring from the project's REAL tokens? Add `--exact` (every hex and typeface
kept exactly as written; contrast problems are printed as advisories instead of
repainted) and/or `--locks colors.primary,typography.displayFont` (those paths
stay pinned through later resyntheses).

`seed` behaves differently depending on whether a project is already
initialized: with a `tappa.json`/`TAPPA_PROTOTYPE_ID` present, it imports
INTO that prototype and never touches brand automatically (it prints a
saved brand of the project's name when your library has one, else the
`brand --tokens` / `--from-screenshot` commands to run, with the clobber
warning up front). With no project yet, it creates one AND brands it: a saved
brand matching `--name` is applied as is; otherwise, in a repo, pass the
theme file — `seed <png> --tokens <globals.css|tailwind.config.ts|tokens.json>
[--fonts "Display, Body"]` reads the brand from it plus this screenshot (the
same packet as `brand --tokens`, so the kit is read, not guessed, and the
poster renders once); with no `--tokens` the brand is transcribed from the
screenshot's pixels (mirroring the one-call MCP seed flow). There's no
existing kit to clobber, so grounding it immediately is the useful default —
`--no-brand` skips it when the creator hasn't said whether to keep the look.

## References + canvas placement

Beyond library picks, more ways to ground a brand or a screen in
real imagery, plus how to make what you found VISIBLE:

- `node tappa.mjs library-search ["<query>"] [--ref-class ui-desktop|ui-mobile|
  graphic] [--style <slug>] [--limit N]` — search Tappa's OWN curated, labeled
  reference library by MEANING (not keyword): hand-reviewed screens and
  graphics with a written summary, style/mood facets, and a named palette per
  item. This is the FIRST stop for reference sourcing — try it before
  `search-images`. Use `--ref-class graphic` for brand-direction/mood
  grounding, or `ui-mobile`/`ui-desktop` for screen grounding (match the
  prototype's device class). `--style <slug>` (a slug from `styles`) narrows
  to ONE named design style — with a query it filters the search, and on its
  own it just lists that style's curated images. A style with nothing curated
  under it no longer dead-ends: the search retries your query with the style
  filter DROPPED and says so in the note (`style "<slug>" has no curated
  matches — showing query-only results instead`), so those rows match your
  words but NOT that style — take the look from the style's `prompt_hints`
  instead. Fewer than about 4 strong hits means retry with `--style`, or
  `search-images` for live web imagery.
- `node tappa.mjs search-images "<query>" [--limit N]` — LIVE web image
  search (Firecrawl first, then serper.dev / Brave Search — whichever keys the
  server has). Good queries: `"<brand> app screenshots"`, `"<brand> instagram
  grid"`, `"site:dribbble.com <term>"`. These are RAW hotlinked candidates:
  look at each one yourself before you keep it (skip watermarks, stock photos,
  clip art, AI slop, delivery marketplaces and aggregators), and re-host what
  you keep by attaching it. A small metered call (~2c). Exits 1 when no search
  provider is configured (set `FIRECRAWL_API_KEY`, `SERPER_API_KEY` or
  `BRAVE_SEARCH_API_KEY` on the server)
  — fall back to `library-search`. The MCP surface's `search_web_images` is
  the reviewed version (free filters, an optional server review, and a
  `sites` mode that screenshots real pages for layout references).
- `node tappa.mjs styles [category] [--query text]` — the VOCABULARY of
  Tappa's trendy design styles (dither, grainy gradients, bento cards, riso
  texture, Y2K, ...). Text only, no images: slug + blurb + prompt hints you
  can drop straight into a brief. Feed a slug to `library-search --style
  <slug>` for that style's actual images.
- `node tappa.mjs plays [--slugs a,b] [--strategy <slug>]` — the distilled
  UX-strategy PLAYBOOK: 12 product strategies (onboarding, activation,
  retention, monetisation, conversion-optimisation, ...) and 33 modular plays
  (empty states, success moments, the paywall, progressive disclosure, time
  to value, ...). Text only, no args = the index; `--strategy` prints that
  strategy's plays + metrics + diagnostic questions, `--slugs` prints full
  play cards (do/don't, founder tip, pair-with links). Reading is the point:
  a play only bites when you fold it into the screen's `Why:` / `Layout:`
  bands before you push. `node tappa.mjs skill ux-playbook` is the
  curriculum. (The `plays` / `uxStrategy` plan FIELDS — which record the pick
  on the plan itself — are set by Mio and MCP agents; PROTOSKETCH has no band
  for them, and the server carries them forward across your pushes.)
- `node tappa.mjs canvas-map` — a spatial map of the creator's canvas:
  brand-kit bounds, per-flow rows, per-screen tile bounds, asset nodes,
  reference boards, and CURRENT wires (derived — asset-to-screen pins,
  asset-to-brand-kit membership, screen-to-screen context). Run this
  BEFORE placing anything so you target real ids, not guesses.
- `node tappa.mjs canvas-place --image-urls <u1,u2> [--near screen --near-id
  <id>] [--wire-screen <id> | --wire-brand-kit]` — places existing assets/
  boards, or ingests new image URLs, onto the canvas near an anchor
  (brand-kit / screen / asset / board), collision-nudged so nothing stacks.
  `--wire-screen <id>` pins the placed items to that screen's renders;
  `--wire-brand-kit` merges their URLs into the brand-identity set (cap 8 —
  overflow prints as "not wired", prune with the webapp's brand references).

None of `library-search`/`search-images`'s results are attached
automatically — even though `library-search`'s images are Tappa's own
durable storage URLs, they still need an explicit `canvas-place`/attach step.
Never leave a reference you sourced invisible:
place what you keep on the canvas near what it informs, and wire it, so the
creator can see WHY a design decision was made.

## Every command, at a glance

Each line is a real invocation — copy one, don't guess at a flag. The
sections below explain the ones that carry judgment.

```sh
node tappa.mjs me                       # who you're connected as
node tappa.mjs init "app idea"          # create + scaffold (or: init --join)
node tappa.mjs init "idea" --kind graphic  # a GRAPHIC design project (artboards, no plan)
node tappa.mjs seed <screenshot.png>    # ground the flow in a REAL app
node tappa.mjs originals <folder> --map flows.json  # a WHOLE app in as originals (or --url / --repo)
node tappa.mjs redesign-app --mode on_brand|restyle|new_brand  # plan a redesign of every original (free)
node tappa.mjs redesign-app --refresh   # redesigns take their re-reviewed originals' read (free)
node tappa.mjs review <screenId>        # re-run an imported screen's review (~2¢)
node tappa.mjs pull                     # refresh plan + nav + brand + renders
node tappa.mjs validate                 # parse + validate, no save
node tappa.mjs push                     # save plan.sketch + nav.json
node tappa.mjs watch                    # push on every plan.sketch/nav.json save
node tappa.mjs author                   # fill in missing Shapes bands (fallback)
node tappa.mjs author --kit             # Tappa's exact layout instructions → .tappa/wireframe-kit/ (free)
node tappa.mjs author --submit a.jsonl  # check + save wireframes YOUR model authored (free)
node tappa.mjs build                    # render every planned screen ($ — yes first); stops after a new brand's kit
node tappa.mjs build --approve-brand-kit # the creator's go past the brand review: render the screens
node tappa.mjs build --no-brand-review  # never stop for the brand review (no human in the loop)
node tappa.mjs build --caller           # YOUR image tool renders the whole build (Codex image_gen) — see below
node tappa.mjs render-kit [screen...]   # the next wave's render kits → .tappa/kits/ (free)
node tappa.mjs submit-render <screen> <image.png>  # hand Tappa the image you rendered (detection only)
node tappa.mjs submit-render poster <image.png>    # …the brand-kit poster you rendered (free)
node tappa.mjs submit-render chrome     # …the whole tab bar set you rendered, in ONE submit (free)
node tappa.mjs status                   # build progress + the brand line
node tappa.mjs wait build               # HOLD until the build finishes — no sleep/poll loops (free; also screen <id> / component_sheet / mio_turn <turnId> / code_conversion <id> / video <id>)
node tappa.mjs open                     # editor + player links (+ is the link live?)
node tappa.mjs share --on               # turn link sharing on (creator's ask only)
node tappa.mjs design "<what to design>"  # ONE on-brand screen PNG ($ — see below)
node tappa.mjs brand --saved [bid]            # reuse a brand already in the creator's library (no id: list)
node tappa.mjs brand --tokens <globals.css>    # the creator's real brand, from the project's own token file (+ --screenshots, --fonts)
node tappa.mjs brand --from-screenshot <png>   # …or transcribed from the running app's pixels
node tappa.mjs tokens --format css      # the brand kit as design tokens (free; --out <file>)
node tappa.mjs spec <screenId|name>     # one screen's developer spec as JSON (free; --out <file>)
node tappa.mjs manifest [dir]           # YOUR repo's components + props + routes → exports use them (free; --map, --show)
node tappa.mjs figma                    # the prototype as a Figma plugin file (free; --out <file>)
node tappa.mjs resynth                  # re-roll the kit's tokens
node tappa.mjs resynth --kit            # Tappa's exact brand-synthesis input → .tappa/brand-kit/ (free)
node tappa.mjs resynth --submit s.json  # check + save the design system YOUR model authored (poster render $; --caller: you draw it, free)
node tappa.mjs components               # the app's ONE component library + sheet status (free; add / edit / remove / redraw / apply: $)
node tappa.mjs model                    # show/change the image model
node tappa.mjs quality <low|medium|high|xhigh|max>  # render fidelity
node tappa.mjs scheme dark              # dark renders on the kit's dark theme (free; --screen <id> for one)
node tappa.mjs checkpoint save "<name>" # a named restore point (free; list / restore <id> --yes)
node tappa.mjs undo-batch <batchId>     # revert one multi-screen run (free)
node tappa.mjs star <screenId>          # keep a design past the 10-entry cap (free)
node tappa.mjs history <screenId>       # a screen's earlier designs + image links (free; --restore <versionId> --yes)
node tappa.mjs sections <screenId>      # a tall page's sections; --order id1,id2,… moves or removes them (free)
node tappa.mjs bible                    # the story bible; correct it: set-cast / replace-fact / … (free)
node tappa.mjs kit                      # the build-kit zip ($ — yes first; --screens id1,id2; --component-map map.json)
node tappa.mjs regen <planScreenId>     # re-render ONE built screen from the plan ($)
node tappa.mjs asset "<what>" --width 1024 --height 768   # ONE real build asset into assets/ ($)
node tappa.mjs svg "<custom icon>" --view-box 64x64       # a Quiver SVG into assets/ ($)
node tappa.mjs remove-bg <image.png>    # cut out an already-sourced bitmap ($)
node tappa.mjs texture "<material>"     # a seamless tile + its CSS ($)
node tappa.mjs comment list             # reviewer feedback (reply / resolve / delete)
node tappa.mjs skill <id>               # print a domain guide
node tappa.mjs library-search "<query>"   # OUR curated reference library
node tappa.mjs search-images "<query>"    # live web image search
node tappa.mjs styles                   # the design-style vocabulary
node tappa.mjs plays                    # the UX-strategy playbook
node tappa.mjs canvas-map               # what's on the canvas, and where
node tappa.mjs canvas-place --image-urls <u1,u2>   # put references on it
node tappa.mjs mio "<note>"             # leave a note for Mio
node tappa.mjs chat "<message>"         # TALK to Mio, like the creator typing
node tappa.mjs traces                   # what the session actually did
```

`open` prints links only after it finds the project. If the lookup fails, it
prints an error to stderr and exits nonzero. Older servers that omit sharing
status still get both links, with no sharing status shown.

**Twelve commands spend the creator's money:** `build`, `regen`, `design`,
`kit`, `brand`, `resynth`, `author`, `seed`, and the four build-asset
commands `asset`, `svg`, `remove-bg` and `texture`. See "Money" below for
what each one costs and which ones need a yes first. Everything else — `pull`,
`push`, `validate`, `watch`, `status`, `wait`, `open`, `share`, `comment`,
`author --kit` / `author --submit`, `render-kit` / `build --caller` (your image
tool draws everything; `submit-render` pays only hotspot detection) and `resynth --kit` (your model does the
authoring — `resynth --submit` renders the poster, one image; with `--caller` you draw it, free), `tokens`,
`library-search`, `styles`, `plays`, `canvas-*`, `traces`, `mio`, `skill` —
is free. `chat` is the one that depends on what you say: Mio spends only when
your message authorizes it (see "Talking to Mio" below).

## The loop

```
[seed, if grounding in a real app]  →  edit plan.sketch (author the Shapes
  bands yourself — skill: wireframes)  →  validate  →  push  →  SHOW + get a
  yes  →  build
```

- `push` saves the plan; the canvas updates live. Version increments each
  save (`pushed v12`).
- `watch` re-pushes automatically on every plan.sketch save — the tight
  dev loop while you iterate.
- `version_conflict` (409) — the creator or Mio (their in-canvas design
  agent) saved since your last pull; NOTHING was written. `pull`, re-apply
  your changes onto the fresh plan.sketch (their work is in there — carry it
  forward), push again.
- Validation errors BLOCK the save and print specifics (duplicate ids,
  unknown hotspot targets, >1 start screen, more than 24 screens). Fix and
  re-push.
- Author the Shapes bands yourself, per screen card (skill: wireframes) —
  that's the default, and it matches Tappa's own layout pass without
  spending a delegated authoring call. `node tappa.mjs author` is the
  explicit opt-in fallback: it fills in any screen still MISSING a
  `Shapes:` band via the same pass the editor uses — one line per screen as
  it lands ("authored @checkout (8 shapes)"), then auto-pulls so
  `plan.sketch` shows the filled-in `Sketch` band. It never overwrites a
  band you hand-authored. If every screen already has shapes, it says so
  and exits clean. A screen that fails to land stays reported by id — run
  `author` again to retry just that screen.
- **Author with Tappa's own instructions, on your model — free.** Between
  hand-writing tuples and delegating to Tappa's pass there is a third way:
  `node tappa.mjs author --kit` writes the EXACT instructions Tappa's layout
  model gets into `.tappa/wireframe-kit/` — `system.md` (the system prompt
  for every screen), `bible.md` (the story-bible step: shared cast, data,
  vocabulary and each screen's composition hint — do it first, submit it with
  `node tappa.mjs author --bible bible.json`, then re-run `--kit` so the
  screen prompts carry it), and `screens/<id>.md` (one full prompt per
  screen, plus its reference image URL when it has one). Answer each screen
  with ONE JSON object per `output-schema.json` (its `layout` is a LAYOUT
  SCRIPT string), one per line in a `.jsonl` file, then
  `node tappa.mjs author --submit answers.jsonl`. Tappa runs the same checks
  its own pass runs and saves what passes; a screen that needs work prints
  `NEEDS FIX` with the exact correction Tappa's model would get — append it,
  re-author just that screen, resubmit (after two rounds, `--accept` keeps
  it). No Tappa model runs, nothing is charged. It is the same kit the MCP's
  `get_wireframe_kit` / `submit_wireframes` hand out.
- **Get creator approval IN THE TERMINAL before building.** Once your
  screens have `Shapes:` bands (hand-authored or via `author`),
  `cat plan.sketch` (or otherwise show it) so the creator sees the filled
  ASCII sketch, print the brand line too (`node tappa.mjs status` shows it:
  "brand: existing — Acme" or "brand: new — will be synthesized during
  build"), and ask an explicit yes/no. Only a "yes" moves to `build`. This
  is a terminal-native substitute for the webapp's plan-review chat card —
  see below.
- **The brand review.** When the brand is NEW (made in this project, not a
  saved or kept one), `build` draws the brand kit (poster, then component
  sheet) and STOPS before any screen: `⏸ PAUSED for the BRAND REVIEW`.
  Show the creator the kit (`node tappa.mjs open`) and ask: change
  anything, or go to the screens? On a clear go,
  `node tappa.mjs build --approve-brand-kit` renders the screens. For a
  change, change the brand and show it again. With no human in the loop,
  `node tappa.mjs build --no-brand-review` turns the stop off for this
  prototype (MCP: `set_render_settings brand_review:false`).
- After meaningful pushes: `node tappa.mjs mio "what changed, what you left
  for Mio"` so the two of you don't fight over the plan.

## Waiting for Tappa — `wait`, never sleep-and-poll

A build, a screen render, a component-sheet redraw and a Mio turn all keep
running after the command that started them returns. Don't loop `status`
with sleeps: `wait` holds ONE request open on Tappa and answers the moment
the job finishes (free — it only reads):

```sh
node tappa.mjs wait build                      # until every screen is rendered + wired (prints the build status)
node tappa.mjs wait screen <screenId|planId>   # one screen's render (--since <ms|ISO> for a render YOU started)
node tappa.mjs wait component_sheet            # the component sheet redraw
node tappa.mjs wait mio_turn <turnId>          # a Mio turn a `chat --wait` left running
node tappa.mjs wait video <boardId|artboardId> # an artboard's clip, or a motion take's MP4, until the file lands
```

Each hold lasts up to `--timeout 50` seconds (default 45); when it runs out
the job is STILL RUNNING (nothing is cancelled) — `wait` keeps re-holding
until the job settles unless you pass `--once`. It answers at once when
waiting cannot help: a stopped build, one waiting on the creator's anchor
pick, or a screen nothing is rendering. A failed or missing job exits 1,
including with `--json`. A job waiting for input, or still running with
`--once`, exits 0 without marking the job complete. The MCP tool is `wait_for`.

## Rendering the build yourself — `build --caller`, `render-kit`, `submit-render`

If YOUR harness can generate images — OpenAI Codex's built-in `image_gen`
(gpt-image-2 on the user's own ChatGPT plan, no API key) — you draw EVERY
image of the build and Tappa does everything else: the brand-kit poster, each
screen (tall pages included), and the tab bar. The images are free on Tappa;
only the ~2¢ hotspot detection per screen is charged.

```sh
node tappa.mjs build --caller           # approve + the FIRST WAVE of render kits (nothing renders on Tappa)
node tappa.mjs render-kit               # the next wave (or: render-kit <screen> to re-issue one)
node tappa.mjs submit-render <screen> <image.png>   # upload + finish that screen; writes the next wave
node tappa.mjs submit-render poster <image.png>     # the brand-kit poster
node tappa.mjs submit-render chrome                 # the tab bar: every image of the set, ONE submit
```

The waves come in the build's own order:

1. **The poster** — when the brand kit has none (every screen renders against
   it, so it comes first): `.tappa/kits/poster/`. A 4:5 portrait. Authoring a
   NEW brand? `resynth --submit system.json --caller` saves the tokens and
   hands you the poster kit in the same step.
2. **The build ANCHOR, alone** — every other screen is told to match its
   pixels, so show it to the creator before submitting it.
3. **The rest, in the build's own waves** — a wave is handed out once the
   previous one is in (`phase: waiting` = kits still out). **A tall page** is
   drawn as SLICES, one kit at a time (`.tappa/kits/<screen>/slice-<k>/`):
   submitting slice k writes slice k+1's kit, whose reference 01 is the bottom
   strip of the slice you just drew; the last slice's submit and Tappa stitches
   the page. Some tall pages are instead ONE fold (two side-by-side columns) or
   border-tall (a magenta-bordered column) canvas — one kit, one submit.
   Tall-page kits must be rendered at EXACTLY their size (they are cut by
   geometry; any other shape is refused with `aspect_mismatch`). Lost your
   place? `render-kit <screen>` restarts it at slice 1, or
   `render-kit <screen> --slice-session <id> --slice-index <k>` re-issues the
   slice it expects.
4. **The tab bar, last** — when every screen has pixels, `submit-render` runs
   the finishing pass (hotspot wiring, flow check) itself; its tab-bar step
   hands the bar back to you, and the kits land in `.tappa/kits/chrome/<variant>/`
   in render order. A kit whose reference 01 is `base_chrome` EDITS your own
   earlier image of that set (render that one first — the CLI copies your
   `render.png` in when it exists). Paint every empty area the flat key color
   the kit names — never a transparent background; Tappa keys it out. Then ONE
   `submit-render chrome` sends the whole set; Tappa splices, shapes and
   assigns it to every tab screen. If your two splice images disagree it asks
   for one image per tab instead (each an edit of your `neutral`), then submit
   the set again.

Each kit lands in its folder with `prompt.txt` and its reference images
downloaded as `01-component_sheet.png`, `02-anchor.png`, … (screens also keep
`.tappa/kits/<screen>.json`, the kit `submit-render` reads). For each kit:

1. Put the references in the conversation **in their numbered order** — Codex's
   built-in image_gen only uses images in context: open each file with
   `view_image` and say its role as you do ("reference image 1: the wireframe —
   follow its layout", "reference image 2: this app's component sheet — the
   brand's colors, type and component construction", …; `render-kit` prints the label for each). The prompt refers to
   them by position.
2. Call your image tool with `prompt.txt` **verbatim** (never shorten or
   "improve" it) at the kit's exact `generatorSize` — only for an ordinary
   screen, if your tool refuses, the nearest of 1024x1536 / 1536x1024 /
   1024x1024.
3. Submit **the file your tool produced**. Codex writes it under
   `$CODEX_HOME/generated_images/` — copy that exact file into the kit folder
   as `render.png` and submit the copy; never a screenshot, crop or re-encode
   of it.
4. `node tappa.mjs submit-render <screen> <file>` uploads it and Tappa
   finishes the screen like a build render: fitted to the frame, on the canvas
   and in the player, on the variation deck, hotspots wired. An image much
   wider than the frame is refused (`aspect_mismatch`, nothing saved) rather
   than silently losing its sides — re-render at the kit's size, or add
   `--accept-crop` with the creator's yes.

Only a tall page no kit covers (a forced tall-page method) comes back with its
price, and it is **never** rendered on Tappa unless you add
`--render-tall-on-server` (creator's yes first).

`build --caller` is the default once the prototype's render source is
"caller" (MCP `set_render_settings` render_source); `build --server` forces a
Tappa render. Over MCP the same loop is `build_plan render:'caller'` →
`get_render_kit` → `submit_render` (kind `screen` / `poster` / `chrome`),
Codex's default.

**The Codex skill.** `public/agent/codex/tappa/SKILL.md` teaches Codex this
whole loop — plan, wireframes, brand, caller renders, review, iterate. Install
it once per machine:

```sh
mkdir -p ~/.codex/skills/tappa
curl -fsSL "$TAPPA_BASE_URL/agent/codex/tappa/SKILL.md" -o ~/.codex/skills/tappa/SKILL.md
```

(`$TAPPA_BASE_URL` is https://www.tappa.design unless your .env says
otherwise.) Codex picks it up on its next start.

## Re-rendering a screen you already built — `regen`

`build` renders screens that were **never** built. It skips every screen that
already has pixels — by design, so a re-run never silently re-spends. So when
you edit an already-built screen's `Shapes:`/`Layout:`/`Why:` bands and `push`,
the plan changes and the picture does not: that screen keeps showing the render
composed from the layout it had before.

`regen` is the missing half. It re-renders ONE built screen from its CURRENT
plan entry — the same prompt `build` would compose for that screen, so the
layout, brief, mood and journey you just edited are what drive the image.

```sh
node tappa.mjs regen checkout            # by plan screen id (the @id in plan.sketch)
node tappa.mjs regen "Checkout"          # or by screen name
node tappa.mjs regen checkout --anchor-self   # keep the current pixels as a base
node tappa.mjs regen checkout --fresh    # ignore the pending wireframe diff, redraw from scratch
node tappa.mjs regen checkout --json     # the raw payload
```

- **It spends** — one image render, on one screen. Get the creator's yes, same
  as `build`.
- A tall page is several images and can take five minutes or more; the command
  waits up to twelve. If it ends without an answer, the render may still have
  landed and been charged: `pull` and look at the screen before you run `regen`
  again.
- **Nothing is lost.** It renders onto the same screen, so the outgoing design
  moves to that screen's variation deck (and into history) server-side, and
  hotspots are re-detected on the new image — the plan's declared tappables
  and hand-placed zones alike, each keeping its target. One detection can't
  place keeps its old rect flagged needs_review; if detection fails outright
  the result carries `detectorError` — read it before trusting the links.
- Takes the **plan** screen id, not the built screen's id — `pull` shows both.
- A screen that was never built is refused with a message pointing at `build`.
- A pending WIREFRAME edit lands as only that change by default: the server
  diffs the wireframe the pixels were drawn from against the edited one, then
  edits just the changed area when it is small, or re-renders anchored on the
  current design with the changes named (the result's `layoutEdit` says
  which). Same price either way. `--fresh` redraws from scratch instead; with
  no wireframe edit pending the render is fresh anyway. `--anchor-self`
  conditions any render on the current pixels.
## Checkpoints, undo and stars — all free

Nothing here re-renders; the server moves designs it already stores.

```sh
node tappa.mjs checkpoint save "Before the rebrand"   # every screen + plan + brand (8 kept)
node tappa.mjs checkpoint list                        # checkpoints + recent batch ids
node tappa.mjs checkpoint restore <checkpointId> --yes
node tappa.mjs undo-batch <batchId>                   # revert one multi-screen run
node tappa.mjs star <screenId>                        # list that screen's versions + variations
node tappa.mjs star <screenId> --version <id>         # keep it past the 10-entry cap (--off to unstar)
node tappa.mjs history <screenId>                     # that screen's earlier designs, newest first, with image links
node tappa.mjs history <screenId> --restore <versionId> --yes   # put one back (the current one is saved first)
```

- Save a checkpoint before anything risky (a rebrand, a big re-render).
- `restore` replaces what is on the board — only when the creator asks. It
  prints a batch id: `undo-batch` with it puts the screens back. Then `pull`
  so plan.sketch matches the restored plan.
- `history --restore` puts ONE screen's earlier design back — only when the
  creator asks; it prints the undo command (the replaced design is saved
  first). Same route as the MCP `get_screen_history` /
  `restore_screen_version` tools.
- A multi-screen run (a re-render wave, a restore, "apply to similar") is one
  batch; `checkpoint list` shows the recent ones. An undo is itself a batch,
  so undoing it redoes the run.

## A tall page's sections — move, remove or add them (free)

A built page taller than one screen is made of sections (a hero, a logo
strip, a pricing band). Tappa finds where they meet on the page's pixels and
names them. Moving them restacks the page's own rows: nothing is redrawn and
nothing is charged.

```sh
node tappa.mjs sections <screenId>                                    # the sections, top to bottom: id, name, height, taps
node tappa.mjs sections <screenId> --order id3,id1,id2 --file <file>  # put them in this order
node tappa.mjs sections <screenId> --add [--after <id>] [--height 1]  # put an EMPTY section in
node tappa.mjs sections <screenId> --json                             # the same list as JSON
```

- `--add` puts in a strip of the page's own background, `--height`
  viewports tall (default 0.75, 0.25 to 1.5), after section `--after`
  (default: the end of the page, above its footer). Free; the rows below
  move down with their taps. It stays empty until a region edit fills it:
  the command prints the region. A one-viewport screen becomes a scrolling
  page.

- `--order` lists the ids that STAY, top to bottom. An id left out leaves
  the page, with the taps inside it. Only when the creator asks.
- `--file` is the file the list printed. With it, a page that changed since
  you read it is refused instead of moved; read the sections again.
- A section marked "stays at the top" or "stays at the bottom" holds a
  pinned bar and cannot move or leave.
- The design before the move goes into the screen's history; the command
  prints the `history --restore` line that undoes it.
- The move changes the built page, not plan.sketch.
- Same route as the MCP `get_page_sections` / `arrange_page_sections` /
  `add_page_section` tools and the editor's section handle and plus button.

## The story bible — correcting the shared world (free)

The story bible is the app's shared world: the recurring cast, vocabulary
facts, pinned entity values, component anatomy lines and per-screen
composition hints. Every render's SHARED WORLD line and pinned-data line are
read from it, fresh, at render time.

Authoring only ever ADDS to it: a bible your model submits (`author --submit`)
merges prior-wins (stored entries survive verbatim, new ones append), and
`push` carries the stored bible forward. So after a rename, a rebrand or a
wrong fact, correct it deliberately:

```sh
node tappa.mjs bible                                         # show it (renders read the first 4 cast / 5 facts)
node tappa.mjs bible set-cast "Mio" "Bubble, the prism mascot"  # new role, same slot
node tappa.mjs bible set-cast "Mio" --rename "Bubble"        # rename in place (--clear-role drops the role)
node tappa.mjs bible remove-cast "Old Name"
node tappa.mjs bible replace-fact "<old fact>" "<new fact>"   # add-fact / remove-fact
node tappa.mjs bible set-entity "Order #1042" "3 items; $84.20; shipped"   # remove-entity
node tappa.mjs bible replace-vocab "<old>" "<new>"            # add-vocab / remove-vocab
node tappa.mjs bible set-hint <planScreenId> "<hint>"         # clear-hint <planScreenId>
node tappa.mjs bible apply ops.json                          # a batch of edit_story_bible ops, all-or-nothing
```

- Matching is exact, ignoring case and spacing; a miss writes nothing and
  lists the closest stored entries.
- It changes FUTURE wireframes and renders only. Screens already drawn keep
  the old world until re-rendered (`regen`, with the creator's yes — it costs).
- Once stored, the same prior-wins merge protects your correction.
- The layout contracts are corrected with `bible apply` ops: `set_flow_header
  {flow, header, start_header?}`, `set_skeleton {role, header, title?}` and
  `set_tab_root_header {header, title, trailing?}` (plus `remove_flow_header`,
  `remove_skeleton`, `clear_tab_root_header`). The shared-part (atom) contract
  is not edited here (`set_shared_parts` owns it).

## Tab bars, nav style, and the App Map

Three real, shipped planning features that live OUTSIDE `plan.sketch`'s
PROTOSKETCH text (it only carries screens/hotspots), so they get their own
file: `nav.json`, pulled and pushed alongside `plan.sketch`.

```json
{
  "tabBar": [ { "label": "Home", "icon": "home", "toPlanScreenId": "home" }, ... ],
  "navStyle": "tabs",
  "appMap": { ... }
}
```

- `tabBar` — the app's bottom tab bar: 2-5 ordered `{label, icon?,
  toPlanScreenId}` entries. `null` = explicitly no tab bar. Omit the key
  entirely (don't write `"tabBar": null` unless you mean it) to leave the
  server's current value untouched on push.
- `navStyle` — how the nav shell renders (e.g. `"tabs"` vs a sidebar mode).
  Same omit-to-carry-forward, explicit-`null`-to-reset-to-device-default
  rule as `tabBar`.
- `appMap` — the complete-IA App Map: objects, tiered journeys, every
  screen the app COULD have (`plan.sketch`'s screens are the SELECTED
  subset that actually gets built). `pull` writes the server's current map
  here (or `null` if none exists yet); edit + `push` to replace it.
- Edit any of the three keys, then `push` — same save, same
  `version_conflict` (409) handling as a plan.sketch edit. Leaving a key out
  of the file means "unchanged"; the file starts as whatever `pull` last
  wrote, so a fresh `pull` before editing avoids stomping a change the
  creator or Mio made in the meantime.
- This is a raw read/write of the stored fields — no guided authoring flow.
  For an INSTANT, code-rendered tab bar built from a screenshot or a
  description, a generated top header / left sidebar / floating FAB
  (`create_chrome_set` + `add_chrome_variant`), editing an existing code
  bar's tabs in place (`edit_chrome_set` — preserves per-screen
  assignments), or per-variant / bulk chrome assignment (no re-render
  needed), that tooling exists only in Mio/the editor and over MCP
  (`create_tab_bar`, `create_chrome_set`, `add_chrome_variant`,
  `edit_chrome_set`, `assign_chrome`, `delete_chrome_set`) — point the
  creator there. For an INCREMENTAL edit of the PLAN-level `tabBar` (add
  or reorder one tab, or hide it on a screen) without hand-editing this
  JSON, `edit_tab_bar` exists over MCP/Mio too. Same for
  curating which App Map screens are IN the active plan (`select_map_screens`
  toggles scope with approval-reset semantics) — from here, editing
  `appMap.selected`/`plan.sketch`'s screen list by hand and pushing gets you
  most of the way, but the guided toggle lives in the editor/MCP.

## Approval — terminal and webapp are BOTH real

If the creator has the webapp open, Tappa also shows them a plan-review
chat card there — that's their parallel approval surface, not a competing
one. You don't need to wait on it: get your yes in the terminal (above) and
call `build`. Calling `build` (which approves the plan server-side) is what
SETTLES the webapp card too — the creator won't be asked twice, and a stale
card in their browser reflects your approval once you build.

## Image source + fidelity

The prototype has ONE image model + ONE quality tier, and BOTH the screen
renders and the brand-kit poster follow them. Two models are enabled:
`gpt-image-2.6-sunburst` (most capable, best edit precision; the default) and
`gpt-image-2.6-flare` (faster, same price). gpt-image-2 and the 2.5 pair are
retired: a prototype saved on one renders on 2.6 (2.5 Flare on 2.6 Flare, the
rest on `gpt-image-2.6-sunburst`), like any other id. `node tappa.mjs model` shows the
current pair, `node tappa.mjs model <id>` switches it (also settable at
creation: `init --model <id>`); `quality <low|medium|high|xhigh|max>`
changes the tier (also settable at creation: `init --quality <tier>`).

Leave `--model` off at `init` and the prototype starts on **the server's own
default** — `gpt-image-2.6-sunburst` unless that deployment has been pointed
at the other enabled model. The CLI deliberately doesn't guess: it omits the field so the
server answers. `node tappa.mjs model` (no argument) reports what the
prototype actually landed on, so read that rather than assuming.
Changes apply to FUTURE renders — built screens and an existing kit keep
their pixels until regenerated. Higher tiers cost more per image.

**`xhigh` and `max` are planning effort on top of `high`.** Ask for a tier a
model doesn't take and the server says no — it names the model and the
tiers it does take, and never quietly renders a cheaper tier instead. They also cost
real money: roughly 2× and 4× `high` per image, on provisional prices that
will be re-based once a metered render says what they actually cost.
OpenAI's own guidance is that `high` is the right tier for text-dense UI and
the two above it are for the cases where `high` demonstrably fails — so
reach for them on one screen that isn't working, not across a build.

**The default is `medium` everywhere.** A prototype created from the
terminal (`init`), by an MCP agent (`create_prototype`), or in the webapp
all start at `medium` — the tier the "beautiful screens" bar assumes. (This
changed: `init` and `create_prototype` used to start at `low`, so terminal-
made prototypes rendered a tier below everything else and came back visibly
softer for no reason the creator could see. A prototype created before that
change keeps its stored tier — `node tappa.mjs model` prints the pair.)
Pass `init --quality low` when you deliberately want the cheap tier for
structural iteration, and `node tappa.mjs quality <tier>` to change it
later. If the creator says a build looks soft or under-detailed, check the
tier before rewriting briefs.

**Light or dark.** `node tappa.mjs scheme dark` makes future renders use the
kit's DARK THEME (the design system's `themes.dark` tokens): the render
prompt's palette switches to it (the component sheet then gives type and
construction only). `scheme light` switches
back; `--screen <screenId>` sets one screen's override (`scheme inherit
--screen <id>` clears it); `node tappa.mjs scheme` shows where things stand.
A kit with no dark theme stays light and the command says so. Free — built
screens keep their pixels until re-rendered.

Every screen — scrollable or not — is exactly ONE image generation, so a
tall screen costs the same as a short one. How tall it can go depends on
the frame: about 3.3 viewports on phone and tablet, about 4.8 on a 16:10
desktop. Ask for more and the server clamps to that ceiling.

## `design` — one call, one on-brand screen, no plan

Everything above is the FLOW loop: plan a journey, build it, tap through it.
`design` is the other half of the product, and it skips all of that
ceremony. One command, one on-brand screen PNG in your repo, for when you
are writing code and need to SEE the thing you're about to build.

```sh
node tappa.mjs design "the settings page: profile, notification toggles, plan card, sign out"
node tappa.mjs design "a pricing page with three tiers" --device desktop --tall 2
node tappa.mjs design "a loyalty card" --aspect 5:8 --out design/refs --name "Loyalty card"
```

- **Run `node tappa.mjs brand` once first.** The call no longer refuses
  without a kit — it renders on Tappa's default one — but the kit is what
  makes repeat calls come back looking like ONE product instead of twelve
  unrelated mockups.
- Flags: `--device phone|tablet|desktop` (default `phone`),
  `--aspect W:H` or `--width PX --height PX` (either WINS over `--device`,
  valid range 1:3 to 3:1), `--tall 2|3` for a scrollable page (values above
  3 are clamped, with a warning), `--out <dir>` (default `design/tappa`),
  `--name X` (default: the brief's first clause), `--studio <prototypeId>`.
- It writes `<out>/<slug>.webp` (or `.png` — the extension follows the
  bytes) and prints the path plus the editor link.
  Iterate by re-running with the change folded into the brief:
  `design "the settings page, but the plan card moves above the toggles"`.
- **Where designs land, honestly:** in an initialized project (a
  `tappa.json` exists), they land in THAT prototype — the creator's live
  canvas — as extra screens, sharing its brand kit. They still do NOT touch
  `plan.sketch`, so `push`/`build` ignore them, but the creator WILL see
  them appear. With no project at all, the CLI creates a
  `<dir> Design Studio` prototype on first use and they land there. Pass
  `--studio <prototypeId>` to send them to a specific prototype instead —
  `brand --studio <prototypeId>` brands that same target.
- **It spends the creator's balance** — one image generation per call, same
  money rule as `build`. Tall pages are still ONE generation, so `--tall 3`
  costs the same as a short screen. A dropped connection mid-render does not
  double-charge silently: the CLI checks whether the screen actually landed
  before re-rendering, and says out loud when a retry is a second paid
  render.
- Curriculum: `node tappa.mjs skill design-on-demand`.

## Money — what actually spends

Editing `plan.sketch`, `validate`, `push`, `pull`, `watch`, `status`,
`open`, `share`, `comment`, `library-search`, `styles`, `plays`,
`canvas-map`/`canvas-place`, `traces`, `mio`, `skill`, `redesign-app`: FREE,
iterate all day.

These SPEND THE CREATOR'S BALANCE:

| command | what it spends on |
| --- | --- |
| `build` | one image generation PER PLANNED SCREEN — by far the biggest (`build --caller`: NO image on Tappa — your image tool draws the poster, every screen and the tab bar; the whole build costs only hotspot detection) |
| `submit-render` | hotspot detection for the screen you rendered (~2¢); every image itself is free on Tappa, and `submit-render poster` / `submit-render chrome` cost nothing (`--render-tall-on-server` renders a tall page no kit covers on Tappa at the build price) |
| `regen` | ONE image generation — re-renders one already-built screen from the plan |
| `design` | one image generation per call (tall pages included) |
| `kit` | a metered export: a flat fee per export (printed when it starts), whatever the screen count — `--screens` narrows the kit, not the price. Inside that fee, a logo/icon/avatar whose background matting can't lift is redrawn by the image model (one generation each, marked `regen` in the manifest) |
| `brand` | a vision/LLM extraction pass, plus the brand-kit poster render (and a page capture on `--from-url`) |
| `resynth` | re-synthesis + a new poster render — cheaper than `brand`, not free (`--kit` is free; `--submit` is the poster render only — your model synthesized; `--submit --caller` is free — you draw the poster) |
| `author` | a wireframe-authoring pass, charged per screen it authors (`--kit` / `--submit` are free — your model authors) |
| `seed` | the vision review of the screenshot, plus brand extraction when it creates a new prototype |
| `originals` | one vision review per screen it brings in (~2¢ each; captures are free), plus the code map on `--repo` (~2¢) |
| `review` | one vision review (~2¢) |
| `asset` | one image generation per asset (medium ~12¢, high ~30¢; + ~5¢ when transparency falls back to matting) |
| `svg` | one Quiver SVG generation, metered at Quiver's token cost + the usual margin (a few cents for an icon, more for a detailed illustration; ~25¢ is held while it runs), charged only when an SVG comes back |
| `remove-bg` | one matting pass (~5¢), charged only on success |
| `texture` | one medium image generation (~12¢) |

The hard rule is unchanged for the big ones: **`build`, `design` and `kit`
need the creator's explicit yes first.** Present the plan (filled sketch +
brand line) before `build`; say what a `design` or `kit` call will cost
before making it. Never build to "see how it looks".

The rest are small but not free — don't run `author`, `brand`, `resynth`
or `seed` in a loop to explore. `node tappa.mjs traces --cost` shows
where the balance actually went — the ledger rows, Mio's tokens, and a render
estimate read off the screens themselves (each active design plus the
alternatives on its deck, so a build's anchor candidates count too), priced
per image at the charged rate: each slice of a tall page and each automatic
review fix is one render. Below it come the kit, sheet, adaptation and nav-bar
images, then the clips (animated artboards, tap animations), which are
counted apart from the images.

## PROTOSKETCH grammar

One card per screen:

```
╭─ @checkout — Checkout · form ──────────────────────────────────╮
│ Flow: Purchase                                                 │
├────────────────────────────────────────────────────────────────┤
│ Why: One-tap purchase completion — the flow's money moment.    │
├────────────────────────────────────────────────────────────────┤
│ Layout: Order summary card up top (2 items, $48 total). Payment│
│ method row (Apple Pay selected). One accent CTA "Pay $48".     │
├── Hotspots ────────────────────────────────────────────────────┤
│ ▸ "Pay $48"  →  @success  [modal-up]                           │
╰────────────────────────────────────────────────────────────────╯
```

- Header: `@id — Name · archetype` with optional `(start)` on exactly ONE
  screen. Ids are kebab-case slugs; they're stable joins — renaming an id
  makes a NEW screen.
- More header flags, comma-separated in the same parens: `(dead-end ok)`
  (this screen ends the journey on purpose), `(no tabs)` (hide the app's
  bottom tab bar here) and `(tabs)` (keep it). In an app with a tab bar, a
  form · sign-in · onboarding · success · empty · error · overlay screen
  with neither flag (and no tab of its own) defaults to NO tab bar on push,
  so its bottom button never collides with the bar — write `(tabs)` to keep
  it. Example: `@review — Review booking · form (no tabs)`.
- Archetypes: home · list · detail · form · settings · success · empty ·
  error · loading · overlay · onboarding · sign-in · landing · other.
  (`landing` = a marketing page: desktop-sized, long scroll; read
  `skill landing-pages` before planning one.)
- `Flow:` — optional free-text semantic grouping ("Onboarding", "Checkout",
  "Main") — real and persisted (`PlannedScreen.flow`). Screens sharing a
  `Flow:` value are grouped into a flow band on the creator's Board view and
  get sequenced flow-step context (prev/next) during `author`. Omit it and
  every screen defaults to one "Main" flow; set it deliberately once a plan
  covers more than one distinct journey (e.g. onboarding + core loop).
- `Why:` — the screen's job in one or two sentences.
- `Layout:` — the content brief: REAL copy ("$48", "Pay $48"), concrete
  content top→bottom, ONE primary action. This is what the image model
  builds from — write it like you mean it. Generic briefs make generic
  screens.
- Hotspot rows: `▸ "visible label"  →  @target-id  [transition]`.
  Transitions: instant · dissolve · fade · crossfade · blur-fade · zoom-in ·
  zoom-out · pop · push-left/right/up/down · slide-left/right/up/down ·
  modal-up/down.
- The `Sketch` band in pulled files is a READ-ONLY diagram — the parser
  ignores it; don't edit it.
- The `Shapes:` band (pulled files) is the machine-readable wireframe —
  compact `[label, x, y, w, h, "flags"]` percent tuples. Keep the line
  intact to preserve a screen's authored layout; DELETE the band to make
  Tappa's own authoring pass re-layout that screen; hand-edit only when you
  deliberately own the layout (see `skill wireframes`). `PageHeight: 2`
  marks a screen 2 viewports tall (scrollable) — see "Image source +
  fidelity" for how tall a single render can actually go.
- The FLOW block at the bottom is derived — the parser rebuilds it from the
  hotspot rows; you can leave it stale.

## Screens you add

Write the `Shapes:` band yourself on every new card (skill: wireframes) —
you own FLOW, CONTENT, and layout. A card you leave with no `Shapes:` band
falls back to Tappa's own pass (Mobbin-grounded): the creator's open canvas
authors it automatically when it picks up the push, or from the terminal
(no webapp involved) run `node tappa.mjs author` after `push` to trigger
the same pass and see the filled wireframes before asking for approval.

## Skills

`node tappa.mjs skill <id>` before entering a new domain. All 17, the same
list `skill` with no arguments prints and the same guides an MCP agent gets
from `read_skill` — keep this list, `.tappa/skills.json`, and the setup
prompt identical:

planning · wireframes · references · brand · building · design-on-demand ·
product-thinking · ux-playbook · image-analysis · image-gen · svg-gen ·
patterns · image-to-code · taste · graphic-design · landing-pages ·
motion-design.

`node tappa.mjs skill mio/<name>` prints one of Mio's own playbooks, the
guides Tappa's in-app agent works from (`skill` with no arguments lists
them; MCP: `read_skill` with `skill_id: "mio/<name>"`).

## After a build — the verification loop

`pull` refreshes `screens/` (one image per built screen). Then run a real inspection pass, screen by
screen — accuracy beats speed, and "the build finished" is not "the design
is done":

1. Open EVERY pulled render and compare it against that screen's `Layout:`
   brief. Write a mismatch list per screen before editing anything —
   wrong/missing content first, then hierarchy, then polish.
2. Treat text as layout: garbled labels, truncated copy, or a wrapped
   heading that changes the composition are failures, not nitpicks.
3. Check the details a glance misses: every control named in the brief
   exists; icons/carets/status dots present; the start screen reads as an
   entry point; nothing important is crowded against an edge.
4. Fix by editing the `Layout:` brief (be MORE specific about what was
   wrong — name the exact copy, the exact order), re-push, and ask the
   creator before re-building changed screens.
5. Never tell the creator the prototype is "done" or "looking good" unless
   you actually pulled and inspected every render in this session. If you
   could not inspect (no pull yet, build still running), say so plainly.

**Hotspots with no position ("NOT tappable").** Tappa never asks you where a
control is — it detects each declared element in the rendered pixels. When the
detector grounds nothing for one AND the screen's `Shapes:` band drew no box
for it, the link is kept and the geometry is thrown away: that hotspot is
stored with a zero-size rect, which means it is invisible and cannot be tapped
in the player. It still counts toward every hotspot total, which is exactly how
a detection miss used to read as a finished screen. `status`, the end of
`build`, and `regen` now print those explicitly — `✗ @screen — 1 NOT tappable:
"Begin"`. Treat that as a defect, not a warning: say plainly which controls are
dead (never "it fell back to its planned position" — there was no position to
fall back to), then fix it by giving the detector something to find. Usually
that means naming the control's exact visible copy in the `Layout:` brief and
drawing its box in the `Shapes:` band, `push`, and `regen` that screen; the
creator can also place the rect by hand in the editor.

Deeper per-screen iteration (region edits, redesigns, variations) lives
with Mio and the creator in the editor — point them there
(`node tappa.mjs open`) rather than fighting pixels from here.

## Reviewer comments

The creator (or a teammate) can leave pinned feedback on a screen in the
webapp's reviewer sidebar. Read and act on it from here — same routes the
sidebar uses:

```sh
node tappa.mjs comment list                    # every comment: id, screen, author, text, resolved?
node tappa.mjs comment reply <screenId> "<text>" [--x 0..1 --y 0..1] [--kind note|request]
node tappa.mjs comment reply <screenId> "thanks, fixed" --reply-to <commentId>
node tappa.mjs comment resolve <commentId>      # mark addressed; --reopen to undo
node tappa.mjs comment delete <commentId> --confirm   # remove it + its replies, for good
```

`comment list` is READ-ONLY in intent as well as mechanism: seeing a comment
does not authorize acting on it. Reply to explain a change or ask a
question; only resolve a comment after you've actually addressed it (edit
`plan.sketch`/`Layout:` brief, re-push, maybe re-build) **and looked at the
result to confirm the change landed** — a re-render happening is not proof the
ask was met, and nothing on the server closes a comment for you. Anything you
didn't address stays open; say which. A `--reply-to` reply inherits the
parent's pin position automatically when you omit `--x`/`--y`.

`comment delete` is not a tidier version of resolve. Resolving keeps the record
of what was asked and what was done; deleting destroys it (and cascades the
thread's replies), so use it only when the creator explicitly asks for the
comment itself to be removed.

## Talking to Mio — `chat`

`mio "<note>"` leaves an activity row. `chat "<message>"` is different: it
puts your words in the prototype's chat bar **as the creator's own message**
and runs one real Mio turn on it — the same durable session the creator has
been talking to in the editor, the same tools, the same gates.

```sh
node tappa.mjs chat "the checkout flow feels thin — what's missing?"
node tappa.mjs chat "redo the empty states so they match the brand" --wait 90
node tappa.mjs chat "yes, direction 2" --json    # collector-shaped result, no streaming
```

Mio's reply streams to stdout as it arrives, with a line per tool call
(`✓ propose_plan (0.6s)` / `✗ name — error`), then a status line.

**Reach for it when the work wants judgment, not a specific edit** — a
critique, "what would you change?", a restyle described in words, or the
answer to a question Mio parked. For a change you can already name, the
direct commands (`push` a plan edit, `build`, `design`) are cheaper and more
predictable; they just don't go through Mio's head.

**It spends exactly when your message authorizes it.** The build gate is
stamped server-side from the words you send, the same way it is for a human:
a question costs tokens only, "build the approved plan" renders every pending
screen and charges for it. Never send the second without the creator's
explicit yes — the rule for `build` applies here verbatim.

**Mio's priced offers have their own yes.** When Mio's reply prices paid work
and waits for a go ("The three screens are about $1.62. Say go and I'll build
them."), the status line says so and prints the offer's id (`--json`:
`priced_offer: { id, text }`). Put that offer and its price to the creator;
only after they say yes, send:

```sh
node tappa.mjs chat --approve <offerId>   # the creator's yes to exactly that offer
```

It is the same yes as the editor's **Go ahead** button: it approves that offer
at its price, and nothing else. If the offer was answered or replaced since,
nothing runs, nothing is charged, and the command says so (`offer_changed`):
read where the conversation is and ask again. Never approve on the creator's
behalf. Typing their own words (`chat "yes, build them"`) still works too.

Endings that are not "done":

- `waiting` — Mio asked the **creator** a question. Relay it, get their
  answer, send it as the next `chat`. Don't answer for them.
- `running` — `--wait` (default: until the stream ends) ran out. The turn is
  **not cancelled**: it keeps going server-side and saves its reply either
  way. Run the `node tappa.mjs wait mio_turn <turnId>` it prints — that holds
  until the turn settles (no sleeping). Never re-send the same message — that
  runs the work twice.

Turns for one prototype are serialized server-side, so a `chat` you send while
the creator is mid-turn queues rather than colliding with it.

## When something went wrong — traces

`node tappa.mjs traces` prints what the session ACTUALLY did, from what the
server already recorded — no work is re-run and nothing is spent:

```sh
node tappa.mjs traces                 # transcript + tool calls, build steps,
                                      # bad renders, spend
node tappa.mjs traces --errors        # only what failed
node tappa.mjs traces --cost          # only the money
node tappa.mjs traces --deep          # + replay Mio's durable session, turn by turn
node tappa.mjs traces --json          # the raw payload, for your own parsing
node tappa.mjs traces --limit 200     # how many transcript messages (default 100)
```

Read it when a build came out wrong, a screen is missing, or the creator asks
where their balance went. The timeline shows each message with its tool calls
(`✓` / `✗` with the failure text), then per-run build steps with WHY a step was
skipped or came back partial, then screens whose render errored, then the spend
grouped by kind. `--deep` adds Mio's own turns — a session that compacted, or a
read that came back TRUNCATED, says so loudly; truncated means the trace is
partial, not that the session stopped.

## Handing off to a coding agent — the build kit

`pull` gets you screens + plan text for READING. When a coding agent (you,
or a separate one) is about to actually BUILD the feature, export the
heavier bundle instead: `node tappa.mjs kit [--out path.zip] [--screens id1,id2]` —
a zip with every screen's full-resolution image (in its real format — usually
WebP), extracted transparent-background assets (logos, icons, avatars —
matted, not just cropped), design tokens (JSON, CSS variables, a tailwind
theme.extend snippet, a fonts note), a `manifest.json` carrying per-screen
layout boxes / asset placements / hotspot geometry, and an `AGENT.md` build
brief (fidelity rules, build order, motion defaults, coordinate system, a
verify loop). It starts the export, prints what it costs, polls until done,
downloads the zip, and prints where it saved — unzip it and read AGENT.md
before writing any app code. Same money rule as `build`: it spends the
creator's balance (a flat fee per export), so get their yes first. Building
one page? `--screens <id>` exports just that screen (ids from `status`).
Re-running `kit` never double-spends: it joins a still-running export of
the same screens, or just re-downloads a finished one — pass `--fresh` to
force a new export after design changes.

Two honesty notes the kit carries: a screen's `layout` boxes are the PLAN's
intent, not measurements — the render may place things differently, so
measure from the screen image (a box's `renderBbox`, the hotspots and asset
placements ARE measured on the render). And `hotspots` are only
the taps the prototype WIRED: visible links and buttons with no destination
(nav and footer links, usually) are listed per screen under `unwired` — ask
the creator where they go rather than inventing a route.

The kit also carries the exact data a dev team builds from, so nothing has
to be guessed off pixels: `specs/<screen>.json` (every authored part with all
its fields — variant, icon, items, value / placeholder / field state, table
and chart data — its link, its token roles, the screen's states and whether
it's a screen, sheet or modal), `copy.json` (every string, with image-model
typos of the authored copy corrected and listed), `components.json` (each
recurring part once, with its construction and every instance), and the
composited chrome bars under `chrome/`. Screen PNGs now show the header /
tab bar / sidebar painted back in. Already have a component library? Pass
`node tappa.mjs kit --component-map map.json`, where map.json is
`{ "primary button": "@/components/ui/button#Button variant=default" }` —
keys are component ids, slots or names from components.json — and AGENT.md
tells the coding agent to import yours instead of rebuilding them. Ran
`node tappa.mjs manifest` first? Then this happens automatically and more
precisely: every bound component names its real file and ONLY the props it
declares (AGENT.md: "use your <ListRow> from src/ui/ListRow.tsx with props
title (label), subtitle (supporting)"), the project export imports it at its
real path, and codegen is told the same. A `--component-map` entry still wins,
and may simply name a manifest component (`{ "row": "ListRow" }`).

One screen's spec, free and instant, without exporting anything:
`node tappa.mjs spec <screenId|name> [--out spec.json]` (no argument lists
the screens). Same record as the kit's `specs/` file.

Handing the design to someone who works in Figma? `node tappa.mjs figma
[--out tappa-figma.json] [--no-embed]` saves the prototype as a file for the
Tappa Figma plugin (`figma-plugin/` in the Tappa repo) — free, nothing
rendered. The plugin builds one frame per screen: the render (locked), an
editable Structure layer made from the plan's parts (auto-layout frames and
text with the real copy, painted from the brand tokens), placed assets, and
hotspots wired as Figma prototype links — plus the brand
as color / number variables and text styles, and a Tokens page. Images are
inlined so the file imports offline; `--no-embed` keeps them as links the
plugin fetches with a personal access token. Same document as the MCP
`export_figma` tool and the editor's Export to Figma.

Just need the brand as tokens in the codebase? `node tappa.mjs tokens
[--format dtcg|css|tailwind3|tailwind4|swiftui|compose] [--out <file>]` prints
(or saves) the current brand kit as a design-token file — free, nothing
rendered. `dtcg` (default) is W3C design-tokens JSON, `css` is `:root` custom
properties, `tailwind3` a Tailwind v3 `theme.extend` config, `tailwind4` a
Tailwind v4 `@theme` block, `swiftui` a Swift file, `compose` a Kotlin file for
Jetpack Compose. It's the same export as the Design System panel's Export
buttons, so the values match what the screens render in.

## The component library — `components`

Every app has ONE component library: the list of its own parts (a cut row, a
status tag, a pricing card…) and ONE component sheet drawn from it in the
brand's exact tokens. Every screen render attaches that sheet as THE brand
reference, so plan and wireframe WITH these parts by name. It is seeded when
the brand kit is generated and grows as wireframes land (capacity 20).

```sh
node tappa.mjs components                                   # list + sheet status (free; --json)
node tappa.mjs components add --name "pricing card" --kind card --content "Pro · $12/mo · Start trial"
node tappa.mjs components add --file parts.json             # an array of { name, kind, content, states?, selected?, construction? }
node tappa.mjs components edit <id> --content "…"           # only the fields to change
node tappa.mjs components remove <id> [<id> …]
node tappa.mjs components redraw [--incremental]
node tappa.mjs components apply <id> [--screens s1,s2]      # update screens showing an OLD version ($ per region edit)
node tappa.mjs components link <id> <screen-id>             # free; unlink <id> <screen-id> too
node tappa.mjs components mark-current <id> --screens s1,s2 # free; screens you already updated another way
```

Once a brand kit exists, EACH change redraws the sheet — one image, billed like
the poster — so get the creator's yes first. An edit redraws only what changed
(the rest of the sheet stays as drawn). A refusal (invalid, duplicate, past
capacity, unknown id) changes and charges nothing. Same route as the MCP
`get_components` / `edit_components` tools.

Screens remember which components they show. An edit only TRACKS the screens
still showing the old version (it prints them); `components apply <id>` updates
them — it finds each instance on the screen and edits just that area to match
the new sheet: one region edit per instance ($), so get a yes first. It waits
(up to ~40s) for a sheet still drawing the edit, resumes itself across ~45s
slices under one batch id (undo_batch reverts the whole wave), and skips a
screen where the part can't be found (not charged) — `components link <id>
<screen-id>` fixes which screens use a part. Brought a screen up to date some
other way (region edits)? `components mark-current <id> --screens <ids>` records
that it shows the current version and clears the flag (free — only for screens
that really match).

## Real assets while you build — `asset`, `svg`, `remove-bg`, `texture`

When you turn the design into code, the screen renders are the SPEC, not a
source of final assets. Never crop a hero, photo or illustration out of a
render and ship it, and never ship a placeholder. Ask Tappa for the real,
isolated asset instead. Each command saves the file into `--out` (default
`assets/`). Reference that local path in code. Never hotlink a Tappa URL: the
unauthenticated link is not stable.

```sh
node tappa.mjs asset "sunlit ceramic mug on linen, soft morning light" --width 1024 --height 768
node tappa.mjs asset "hero: misty pine ridge at dawn" --width 2048 --height 1536 --quality high
node tappa.mjs asset "isolated sneaker, three-quarter view" --width 1024 --height 1024 --quality high --transparent
node tappa.mjs asset "the hero illustration, recreated" --width 2048 --height 1152 --quality high --ref-screen <screenId> --bbox 0,0.1,1,0.45
node tappa.mjs svg "a sprouting seed inside a circle" --view-box 64x64
node tappa.mjs svg --screen <screenId> --bbox 0.05,0.03,0.2,0.06
node tappa.mjs remove-bg team-photo.jpg
node tappa.mjs texture "warm recycled paper grain" --tiling both
```

- **`asset`**: one raster, sized for its layout slot. `--width`/`--height` are
  REQUIRED — any whole pixels, delivered at exactly that size (an off-grid
  size like 1200x630 renders on the provider's 16-px grid and is centre-cropped
  back; `rendered_size`/`fit_note` say so) — max edge 2048, aspect at most 3:1. Medium (the
  default) needs a min edge of 512 (512x512 avatars, 768x512 cards, 1024x768
  panels). High needs at least 655,360 pixels (2048x1536 hero, 1536x2048
  portrait, 816x816 smallest square). A bad size is refused with the rule and
  a suggested size, and nothing is charged. The prototype's brand palette and
  mood are added to your prompt automatically. `--transparent` (high only) asks
  for real alpha, for art that floats over other UI. The output says `alpha:
  native`, or `matted` when the provider couldn't do alpha and Tappa cut it out
  instead. `--ref-screen`/`--bbox` (high only) recreates a background or
  illustration that sits INSIDE a design, isolated at full resolution with no
  UI on it. Don't use it for avatars, products or icons, or to regenerate a page.
- **`svg`**: standard UI icons (arrows, chevrons, menu, close, search, social
  logos) come from your project's icon pack (Lucide etc.), so search it first.
  Text mode (a prompt plus `--view-box`) is for CUSTOM icons. Image mode
  (`--screen` + `--bbox` tight around it) is only for complex illustrations:
  a detailed logo mark, a badge, a decorative graphic. Never use image mode on
  small icons, because vectorizing icon pixels gives unusable results. If
  Quiver is unavailable (not configured, or out of credit) the command says so
  and charges nothing. Use the icon pack or hand-author the SVG.
- **`remove-bg`**: only for bitmaps you ALREADY have (a user upload, an earlier
  generation). For a new asset use `asset --quality high --transparent`
  instead. `--asset-url` takes a Tappa asset of this prototype. Other URLs are
  refused, so download the image and pass the file.
- **`texture`**: a 1024x1024 seamless tile, only for repeating
  photographic/organic surfaces CSS can't fake (paper grain, linen, concrete,
  wood, fabric, film noise). Flat fills, gradients and dot grids are CSS (`node
  tappa.mjs skill patterns`). `--tiling` is `both` (background-repeat:
  repeat), `horizontal` (repeat-x) or `vertical` (repeat-y). The edges are
  made to match after generation, and the command prints a ready `background:`
  line.

Each call takes about a minute (up to 3). Run several in parallel. On a
failure, retry: never fall back to a crop. These spend the creator's balance
(see "Money"), so agree the asset budget with them once for the build rather
than per asset. MCP clients have the same four as `generate_asset`,
`generate_svg`, `remove_background` and `create_texture`.

## Definition of done

A prototype is done when ALL of these hold — check them, don't assume them:
- every planned screen is built and you have looked at its render
- every hotspot row lands on a real screen; no dead ends the flow needs
  (`validate` warns on unreachable screens — a warning IS a bug here)
- exactly one start screen, and it's the natural entry point
- the per-screen mismatch lists are empty, or every open item is reported
  to the creator as a known limitation (with which screen and what's off)
- the creator has the editor + player links (`node tappa.mjs open`) — and
  you told them whether the player link is actually LIVE. Prototypes are
  PRIVATE when created, so `/p/<id>` shows "This prototype is private" to
  anyone who isn't a member; `open` prints which state it's in. If the
  creator wants to send that link to someone, `node tappa.mjs share --on`
  turns link sharing on (it then opens for ANYONE holding the link) and
  `share --off` revokes it. Never turn it on unasked just to make a link
  you pasted work.
