Design
Take product design work from brand identity through a design system, accepted Compositions, and quality-checked Variant Rounds in the real app to committed Design-Owned UI Code and a delivery brief
$design-phase takes product design work from brand identity to UI code that lives on the real route, passes the Quality Gate, and is committed by Promote. It is explicit-only and ships in the frontend surface pack.
The flow builds on product truth: routes, components.json, theme files, components, content, screenshots, and brand evidence limit what the agent may propose. It ends when it presents the delivery brief and stops. Only the user invokes $delivery-phase, which then adds logic and data to the committed UI.
- Use this when: a page or flow needs a brand, a design system, or a new look, and the result must become real app code, not a reference.
- It gives you: a Brand Kit, a
DESIGN.mdapplied as the app theme, accepted Compositions, a Motion Plan, quality-checked Variant Rounds on the real route, one promote commit of Design-Owned UI Code, linked backlog identities, and a delivery brief. - It does not: build standalone HTML, a
prototype/<slug>branch, or an isolated prototype route; fall back to code when image generation is unavailable; infer approval from artifacts; create new Stories or Tasks; or start delivery.
Terms follow the design-phase redesign glossary. The Design Phase Redesign spec holds the accepted requirements.
Runtime Graph
Every gate writes its outcome to the design handoff and re-enters the design router, which recomputes the next route from durable evidence. The arrows show the order the router derives on a normal run. Hexagons are the three human checkpoints.
Route Contract
Every entry, cold resume, and direct request for one gate starts at the router. The router discovers the design handoff, inspects evidence in authority order (the user's current message, the repository and running app, fresh workflow artifacts, committed handoff entries, then any suggested route), and returns exactly one output:
- gate: load one flat gate file;
- checkpoint: restate the pending brand, compose, or verdict decision with its durable links, then stop;
- blocked: name the missing evidence or conflict, then stop;
- terminal:
human_steering_required,requirements_phase_return, ordesign_complete.
The router evaluates its precedence table top to bottom:
- An unanswered
human_steering_requireddecision, an unclear target (goal, surface, or spec folder, or several matching handoffs), or a same-authority evidence conflict stops the run. - A pending checkpoint without a reply stops at that checkpoint. A reply routes to the gate that owns the checkpoint.
- Otherwise, the first gate whose evidence is missing or stale runs: intake, grill, brand, design-system, compose, motion-plan, variant-round, quality-gate, verdict, promote, backlog, delivery-handoff.
- A fresh delivery brief returns
design_complete.
Brand is skipped when intake recorded fresh brand artifacts; the router writes a route-trace row that names them. Before it loads a gate whose latest outcome is blocked, the router checks whether current evidence resolves the blocker. For image_generation_pending, it first reads the recorded Codex task with task_status.
Evidence is stale when scope, route, theme, components, content, brand constraints, accepted constraints, Verdict, backlog ids, or target surface changed after it was produced. DESIGN.md is stale when the Brand Kit changes. Compositions are stale when DESIGN.md or their scope unit's layout changes. A Motion Plan is stale when its Composition changes. An open round is stale when its Compositions, DESIGN.md, or Motion Plan changed after it started.
Re-entry rule. A later visual change re-enters the design flow, never delivery. A layout change marks that scope unit's Compositions stale and routes to compose. Any other change makes a new round due and routes to variant-round. A reject reason follows the same rule.
Every router output appends one Route Trace row: timestamp, output, evidence, and rejected alternatives.
Gates
Intake
Intake records the Design Target: surface (expo when the target app depends on expo, otherwise web), existing-UI intent (improve-existing only when the user clearly asks to rework existing UI, quoted; otherwise new-ui), one scope unit per user-visible page or flow with its real route, components.json state, DESIGN.md and theme paths, brand artifacts with freshness, screenshots, and evidence gaps. It changes no app code.
Intake is low-confidence when it holds fewer than the routes plus one style, component, or content source. Then it asks one concrete question or requests one screenshot, and blocks. Later decisions never rest on a silent blank-slate design system.
Grill
Grill is the only gate that activates $requirements-grill. The grill is lean: goals, page or flow scope, constraints, conflicts with existing evidence, hard requirements, content ownership, target surface, and non-negotiables, by default one branch per page or flow. Visual choices stay with brand, compose, and variant-round.
Brand
Brand activates $brandkit to write a board brief, generates the boards through the image generation ladder, and gets durable links through $repo-asset-management. Human checkpoint: the user accepts the boards, which become the Brand Kit, or names changes for a new attempt. Acceptance comes only from the user's explicit words.
Design System
Design-system fills the design-phase DESIGN.md template (Google Stitch format) from the Brand Kit and writes it in the target app root, or updates an existing one in place.
- Web: it activates
$shadcnand itsdesign-system.md. Whencomponents.jsonis absent, it runsnpx shadcn@latest initin the existing app root, never with--template. It adds missing components that a recipe targets, maps tokens to the theme and recipes tocvavariants, and builds the design system page. - Expo: it writes the NativeWind theme config from the
DESIGN.mdtokens, with$expo-tailwind-setupwhen NativeWind is missing. The Expo component library is parked.
A browser check must pass: typecheck, no console errors, no horizontal overflow at 375px and 1280px, and dark mode toggled once. The gate shows screenshots and the shadcn "Report back" summary, and continues without a stop.
Compose
For each scope unit without accepted Compositions, compose activates both $imagegen-frontend-web and $imagegen-frontend-mobile, unless the user named one surface. It appends three parts to every brief, in order: the full DESIGN.md, the shadcn-Primitive Directive, and the copy lens paragraph. Images come from the ladder and get durable links. Human checkpoint: the user accepts the Compositions per scope unit, or names changes.
Motion Plan
Motion-plan activates $find-animation-opportunities on the accepted Compositions, the route code, and the DESIGN.md motion tokens. Each opportunity becomes one Motion Plan entry. An entry becomes accepted when its element is in the Composition, it uses DESIGN.md tokens, it obeys the Do's and Don'ts and accepted constraints, and the user has not declined it. A Composition with no accepted entry records "no motion" and the reason.
Motion Plan states are proposed → accepted → built → verified, with one writer each: motion-plan, variant-round, quality-gate.
Variant Round
Variant-round writes "Round N started" before any code edit, then builds 3 variants by default, up to 5 on request. Each variant has a name and a divergence axis (layout, density, personality, motion, or interaction model); no two variants share one. A riff diverges around the named variant; a combine joins the named parts.
$prototype-variants builds every variant in the real app, on the real route, on the working branch, behind a dev-only ?variant= switch. The route without ?variant= renders the current committed UI, and production builds ignore the switch. Variants use mostly the shadcn components in components.json. The craft skills run autonomously on each variant:
$design-taste-frontend, always: its page run covers landing pages and its app-screen run covers dashboards and other app screens;$image-to-code, with the accepted Compositions as its design images;$emil-design-eng, as the craft bar;$animateon web or$animate-expoon Expo, for everyacceptedMotion Plan entry;$mobile-native, mandatory for responsive web;- for existing-UI intent
improve-existing,$design-taste-frontendruns its route "Redesign, restyle or review of an existing page or app screen".
Each variant must render, respond, keep a clean console, and not overflow at 375px and 1280px. The round record holds each variant's ?variant= URL, build identity, and screenshot links. A repair rebuilds only the failing variants in the same round; the round counter increases only for a new round.
Quality Gate
Quality-gate runs five checks on every variant of the current build and records pass or fail with evidence:
- light
$break-ui: one worst-case dataset behind its dev-only toggle, at 375px and 1280px, with zero open "What broke" items; - the
$mobile-nativechecklist on web (not applicable on Expo); $review-animations, with decision Approve;- the copy lens on every visible string, with zero hits;
- Motion Plan conformance, which sets matching entries to
verified.
A variant passes only when all five pass. Failures route back to variant-round for repair in the same round. Only passing variants reach the Verdict.
Verdict
Verdict presents one row per passing variant: name, axis, when it is the right choice, its cost, its ?variant= URL, screenshot links at both widths, and its open "Decisions for you". Human checkpoint: the user gives exactly one Verdict:
riff <variant>with a direction, orcombine <variants>with the parts to join: a new round;keep <variant>: the approval, which routes to promote;rejectwith a reason: the router re-derives under the re-entry rule.
keep is the only approval. Variants, screenshots, or passing results never imply it.
Promote
Promote follows exactly one recorded keep:
- It runs the full
$break-uiworkflow with fixes: every applicable catalog row; the real container width, 320px, and the widest layout; 200% zoom; dark mode and RTL when supported; the empty, one, and huge cases. Pass needs zero open breaks and every "Decision for you" closed by the user; an open decision stops the run ashuman_steering_required. - It rewrites the kept variant in place as production code on the real route, removes the
?variant=switch and the losing variants, and keeps the worst-case fixtures and toggle dev-only as the regression test. - It verifies typecheck, both widths without
?variant=, a clean console, and a production build without the switch or toggle. - It commits the design-owned files on the working branch. This promote commit holds the Design-Owned UI Code.
- It writes the approved artifact contract, with the promote commit SHA and file list.
Backlog
Backlog does not create backlog items. It reads the canonical glossary in the requirements-grill status first. Its prerequisite is an authoritative agent-ready SPEC.md with a verified stable blob URL that links the fresh approved artifact contract.
- Evidence that needs new Stories or Tasks, or a missing spec prerequisite, is retained and returned to Requirements Phase (
requirements_phase_return), which alone authorizes new delivery-depth projection. See Brainstorming Requirements And Backlog. - Evidence that fits is attached through
$repo-asset-management, with its repo-provider fallback. The promote commit and the contract link to the existing backlog identities, which stay unchanged.
Delivery Handoff
Delivery-handoff builds the delivery brief: the promote commit, backlog identities, approved artifact links, target surfaces, scope units, constraints, acceptance checks, browser or screenshot expectations, and before/after PR evidence guidance with durable links. The brief states the delivery boundary:
- the UI is committed, and its Design-Owned UI Code is accepted input;
- delivery adds logic, data, and the rest of the requirement;
- delivery changes a design-owned file only as a recorded defect fix.
It presents the brief, tells the user to invoke $delivery-phase explicitly, and stops. $delivery-phase records each defect fix in its Phase Result, and $implement-spec puts the rule in every worker brief that touches design-owned files and records each fix in IMPLEMENTATION-NOTES.md. See Implementation.
Image Generation
Brand and compose take every image from Codex through one ladder. A gate accepts only images that the ladder produced; there is no fallback to code or HTML. The first step whose condition holds runs; a failed step is recorded and the next step runs.
- The agent is Codex: it uses its own image generation tool.
- Inside T3: when
orchestrator_capabilitieslists providercodexwith cross-provider child tasks, the gate callsdelegate_taskwithmode: "wait",isolation: "shared", a complete standalone brief that names the image skill and its installedSKILL.mdpath, and a stableclientRequestIdper attempt. A wait timeout blocks asimage_generation_pending, with thetaskIdrecorded for resume. codexCLI installed:codex exec --sandbox workspace-writefrom the repository root.- None: blocked
image_generation_unavailable, with each step and its reason recorded.
Each brief names one output directory per gate, scope unit, and attempt. Before any image is recorded or presented, the gate verifies that every returned path exists in that directory, is image data, matches the brief count, and shows what its reply line states.
Design Handoff
One durable design handoff per design target holds the state the repository cannot rebuild. It lives beside SPEC.md in the resolved spec folder, for example <specs-root>/<domain>/<folder-name>/DESIGN-HANDOFF.md. When no SPEC.md exists yet, the folder is reserved as create-architecture does, and SPEC.md stays absent.
Its sections, in order: Design Target, Round State (round counter, variants, quality results, Verdicts), Motion Plan, Artifact Index, Approved Artifact Contracts, Route Trace, and append-only Gate Outcomes. Every declared gate exit writes one outcome entry. A local image path is pending evidence until $repo-asset-management gives it a durable link or records an upload blocker.
Discovery: a named spec folder selects its handoff. Otherwise the router searches the spec folders for a Design Target whose scope units or routes match the request. One match is the handoff, none starts a new one, and several block as design_target_unclear.
Skills Used
Child skills are gate-local. The $design-phase entrypoint activates none of them itself.
| Skill | Gate | Purpose | Invocation | Pack |
|---|---|---|---|---|
$requirements-grill | grill | Lean accepted constraints, with durable grill log and status. | Model | requirements |
$brandkit | brand | Brief for brand-guideline boards that become the Brand Kit. | Model | frontend (surface) |
$shadcn | design-system, variant-round | Init in the existing app, map DESIGN.md tokens and recipes to theme and cva variants, add missing components. | Model | shadcn (detected; frontend installs it) |
$expo-tailwind-setup | design-system (Expo) | Set up NativeWind when the Expo app lacks it. | Model | expo (detected) |
$imagegen-frontend-web | compose | Website Composition images, one per section. | Model | frontend (surface) |
$imagegen-frontend-mobile | compose | App-native mobile Composition images in phone mockups. | Model | frontend (surface) |
$find-animation-opportunities | motion-plan | Readonly search for motion opportunities with exact values. | Model | frontend (surface) |
$prototype-variants | variant-round, promote | Build divergent variants behind the dev-only ?variant= switch, then integrate the kept one. | Explicit; the gate loads it by path | frontend (surface) |
$design-taste-frontend | variant-round; copy lens source | Anti-template direction for every variant, landing page or app screen; its redesign route serves improve-existing; its references/copy.md holds the copy rules. | Model | frontend (surface) |
$image-to-code | variant-round | Implement each variant from the accepted Compositions. | Model | frontend (surface) |
$emil-design-eng | variant-round | The UI polish and craft bar. | Model | frontend (surface) |
$animate | variant-round (web) | Build every accepted Motion Plan entry. | Model | frontend (surface) |
$animate-expo | variant-round (Expo) | Build every accepted Motion Plan entry in React Native. | Model | expo (detected) |
$mobile-native | variant-round, quality-gate | Native feel on phones for responsive web; its checklist is a quality check. | Model | frontend (surface) |
$break-ui | quality-gate, promote | Light worst-case pass per variant; full pass with fixes before promote. | Model | frontend (surface) |
$review-animations | quality-gate | Approve or flag each variant's motion. | Explicit; the gate loads it by path | frontend (surface) |
$repo-asset-management | brand, design-system, compose, variant-round, backlog, delivery-handoff | Durable visual links, backlog attachments, and repo-provider fallbacks. | Model | planning, requirements |
The copy lens also reads the copy-tell lists of both imagegen skills.
Blocked Results
The flow stops with one named outcome:
- Router:
design_target_unclear(one concrete question) ordesign_state_conflict(the conflicting evidence). - Gates:
intake_low_confidence,constraints_open,image_generation_unavailable,image_generation_pending,design_system_check_failed,motion_plan_input_missing,round_build_failed,quality_check_unavailable,promote_check_failed,attachment_blocked, ordelivery_brief_input_missing. - Terminals:
human_steering_required(for example, an open "Decision for you" at promote, or a repair that cannot make a check pass) andrequirements_phase_return.
Validation
Report the design handoff path, the route trace, intake confidence, accepted constraints, the accepted Brand Kit and Compositions with the user's quoted words and durable links, the Motion Plan states, each round's variants with ?variant= URLs and quality results, the recorded Verdict, the full break-ui report, the promote commit and its file list, linked backlog identities or the Requirements Phase return, and the delivery brief.
Known Gaps
- Expo component library parked. The choice between
react-native-reusables,expo-ui, and plain NativeWind waits for the first Expo design run. Until then, design-system writes only the NativeWind theme config, the shadcn-Primitive Directive names serve as layout vocabulary, and the$mobile-nativecheck is not applicable on Expo. - Codex child image tool not yet runtime-verified. The T3
delegate_taskstep of the image ladder is specified, but no run has yet proved that a Codex child writes image files into the shared checkout. A failure falls to thecodex execstep, then blocks visibly. - The grill gate activates
$requirements-grilldirectly, while repository guidance names Requirements Phase as the owner of Requirements Grill.