# Design round-trip — orchestration guide *Substance file per the portability protocol. Vendor wrappers (e.g. `adapters/claude/commands/design.md`) point here; this guide is self-contained and written as plain prose any orchestrating agent could follow. This is also the authoritative definition of the `design/` folder convention that `/new-project` scaffolds and the `design-checker` agent audits against — both point here.* You run the **design round-trip** for a repo that has (or will have) a user-facing interface: you establish the look — by scoping a fresh design, importing prior guidelines, or extracting the de-facto design already in the code — then (optionally) take it through an external visual tool (Anthropic's **Claude Design** in the cloud is the default front-end, but Figma or a plain conversation feed the same contract), and distill the result into a small set of **durable, vendor-neutral, on-disk design artifacts** that every future agent reads before building UI. You run in the **main thread** — establishing a look is an interactive, iterative conversation, not a delegated job — so you talk to the user and react to what they show you. Do not behave like a subagent. The arc: **read the situation → establish the design intent → (optionally) round-trip through the cloud tool → distill into the repo → promote what you learned.** The principle underneath: the cloud tool is an interchangeable front-end; what lives in the repo is a `DESIGN.md` brand brief plus a `tokens.tokens.json` token file, and *those two files are the contract*. Never let the repo depend on a proprietary export format — if Claude Design vanished tomorrow, the on-disk contract and everything that reads it must still stand. ## Posture (how to run the conversation) Be a collaborator drawing out a look the user may not be able to name yet. **Lead with inspiration, not specification.** The user often won't know exactly what they want — that's fine and expected. Invite them to show you references: "drop any screenshots of apps/sites whose look you like into `design/inspiration/`, or paste them here." React to each concretely (what about it works — the restraint, the density, the palette, the type?), build a shared vocabulary, and converge. Propose a draft direction and let them correct it rather than interrogating them. At most a focused question or two per turn. **Scale the ceremony to the surface:** a single admin panel needs a light brief; a public landing page or a consumer app deserves the full walk. And push back — if two references pull in opposite directions, or a stated brand value contradicts the inspiration, name it. ## The on-disk contract: the `design/` folder Every repo with a user-facing surface carries a `design/` folder. This is the layout you create and maintain (folder name is `design/`, not `brand/`): ``` design/ BRIEF.md # pre-flight: the scoped input packet handed to the cloud tool (fresh/redesign runs) DESIGN.md # the durable brand brief — the contract agents read before UI work tokens.tokens.json # W3C DTCG design tokens — the machine-readable value source inspiration/ # reference images + UI screenshots the user likes (first-class input; kept in git) brand/ # logo.svg, fonts, generated palette.css and other delivered assets _imports// # raw export bundles / prior guidelines, dated (kept in git for provenance) ``` `DESIGN.md` + `tokens.tokens.json` are the **contract**; everything else is scaffolding and provenance. `inspiration/` and `_imports/` are **kept in git** — the references record *why* the look is what it is, and the raw imports record *where* it came from. And the repo's `AGENTS.md` carries one line so every tool honors the contract: > **Design:** before building or changing any user-facing UI, read `design/DESIGN.md` and > `design/tokens.tokens.json` and conform to them. ## Phase 0 — Read the situation, pick the on-ramp Before anything, determine which of four situations you're in — it sets the whole run: - **Refine** — `design/DESIGN.md` already exists. You're updating an existing contract; skip to the phase that fits the change. - **Import (Case A)** — no contract, but the repo (or the user) has **prior design/branding guidelines** in some ad-hoc form (a doc, an HTML brand page, a Claude Design export). Go to Phase A → *Import*. - **Extract (Case B)** — no contract and no guidelines, but there's an **existing user-facing UI** whose look grew organically. Go to Phase A → *Extract*. - **Fresh** — no contract and no UI yet (a new or pre-UI project). Go to Phase A → *Fresh*. Also settle the posture with the user up front for backfills: **document-as-is** (cheaply turn what exists into a contract) vs **redesign/elevate** (take it through the cloud tool to improve the look first). Document-as-is skips Phase B; redesign runs it. ## Phase A — Establish the design intent Pick the branch from Phase 0. All three converge on Phase C (the contract). **Fresh — inspiration-first scoping → `design/BRIEF.md`.** Produce the packet the user walks into the cloud tool with, so they never start from a blank canvas. Work it out *with* the user, inspiration-first: 1. **Gather inspiration.** Ask for reference images / UI screenshots; save under `design/inspiration/`. For each, capture in one line *what* the user likes about it, so the intent survives as text, not just pixels. 2. **Draft the brief** in the five-part structure the cloud tool responds to: **Goal**, **Layout**, **Content**, **Audience**, **Reference pattern** (the inspiration, named), plus a **~200-word brand description** (voice, mood, what it is *not*). 3. **Assemble the input checklist** — a repo **subdirectory to point at** (never the whole monorepo), files to **upload** (logo, fonts, inspiration images, any existing contract), and **live URLs** to web-capture. 4. **Write `design/BRIEF.md`** with the brief, brand description, inspiration list + notes, the input checklist, and a **copy-pasteable prompt block**. **Import (Case A) — locate → map → gap-fill → reconcile.** 1. **Locate** the prior guidelines — search the repo (branding docs, HTML brand pages, an exported bundle) and ask the user where they live or to paste/re-export them. Drop the raw artifact into `design/_imports//` for provenance. 2. **Map** their content onto our nine-section `DESIGN.md` structure and DTCG tokens — this is reformatting, not reinvention; preserve the actual values. 3. **Gap-fill** — flag every section our ideal contract wants that the prior artifact doesn't cover (often: spacing scale, component states, responsive rules, do's/don'ts), and fill from the deployed UI or by asking. 4. **Reconcile** the guidelines against what the product *actually* renders (landing, app, admin) — where the code diverges from the stated brand, surface it for the user's call. **Extract (Case B) — inventory → reconcile → (then formalize in Phase C).** 1. **Inventory the as-built design.** Read the user-facing code and produce a *descriptive* record of what the design currently is: every color used, type styles, spacing patterns, component treatments, depth/elevation — **including the inconsistencies** (the three almost-the-same blues, the four heading sizes). A read-only `design-checker` cannot do this (it needs a contract to check against), so inventory here in the main thread, optionally delegating a read-only reader to gather the raw values. First **enumerate every styling surface** — there is often more than one (a second stylesheet, a separate auth/landing page, *CSS embedded in a string literal* that ships a self-contained export); a grep over one `