How coding agents should discover, read, follow, update, and verify a .design file.
Portable procedure: skills/design/SKILL.md.
Activate when:
- UI generation, restyle, design review, or brand consistency is requested
- A
.design/*.designfile exists - User asks to bootstrap, remix, sync, lock, unlock, or verify design
flowchart TD
A[Discover nearest .design] --> B[Resolve extends]
B --> C[Read agent.instructions → intent → constraints → policy → tokens → voice → components]
C --> D{Task type}
D -->|generate UI| E[Follow APPLY trees]
D -->|design changed| F[Update in place]
D -->|sync / audit| G[Verify drift]
E --> H{shadcn enabled?}
H -->|yes| I[Apply css_vars + prefer ui/*]
H -->|no| J[Map tokens into project stack]
I --> K[Cite tokens/components used]
J --> K
F --> G
agent.instructionsoverview/intent(includingdirection,signature,treatment)constraintspolicy/decisionstokensvoicerationale(on demand for the task at hand)components/patternsintegrations(e.g. shadcn)exampleslockedwhen updating
For files too large to load comfortably in one pass, read in tiers (SPEC.md §8.1):
| Tier | Sections | When |
|---|---|---|
| Normative core | schema, agent, intent, constraints, policy, decisions, tokens, components, locked, themes, voice |
MUST load before generating UI |
| Judgment | overview, rationale.*, patterns, examples |
SHOULD load; defer sections irrelevant to the task |
| Tooling | integrations, exports, assets, sources, provenance |
Load when performing that operation |
If UI work is requested and no .design exists, offer to bootstrap — do not invent an untracked system. Before proposing anything, scan adjacent design signals: design notes in AGENTS.md / CLAUDE.md, an existing DESIGN.md, globals.css / theme files, Tailwind config, components.json, Storybook. Extract the full visual vocabulary — density, elevation language, motion character, copy tone — not just hex values, and record what was scanned in sources. Bootstrap follows the plan → critique → confirm → write process (lifecycle.md).
Before walking the tree, calibrate treatment for the surface: patterns.<name>.treatment > intent.treatment > request type (internal tool / dashboard → utilitarian; landing / marketing → editorial). Utilitarian surfaces get restrained product craft; only editorial surfaces run the distinctive-identity register. Concentrate boldness in intent.signature; keep everything around it quiet.
flowchart TD
Need[Need UI] --> Match{components.* match?}
Match -->|yes| Dec[Walk decisions.*]
Dec --> Bind[Bind tokens — no raw hex if token exists]
Bind --> When[Obey when / when_not]
Match -->|no| Miss[policy.if_missing]
Miss -->|ask| Ask[Ask user]
Miss -->|nearest| Near[Closest component + note]
Miss -->|invent_with_note| Inv[Invent once + update catalog]
When --> Pat[Apply patterns.*]
Near --> Pat
Inv --> Pat
Pat --> Con[constraints.always / never]
Con --> Craft[CRAFT.md defaults where silent]
Craft --> Stack[Project styling system]
Stack --> Shad{integrations.shadcn.enabled?}
Shad -->|yes| Pref[Prefer shadcn + write CSS vars]
Shad -->|no| Done[Implement]
Pref --> Done
After Follow, agents apply skills/design/references/CRAFT.md for hierarchy, surfaces, motion, and a11y only where .design does not already decide. Detailed trees: skills/design/references/APPLY.md.
Voice: apply voice.* to all UI copy with the same force as tokens (SPEC.md §13C) — the register, casing default, terminology map (end-user vocabulary, never system terms), action_naming continuity, and the errors style rule.
Before finishing any UI task, check and report inline:
- Every
constraints.neveritem absent;constraints.alwaysitems present - One primary emphasis per view; boldness only in
intent.signature - No raw hex/spacing/radius where a token exists
- Both theme modes legible (or
themes.singledeclared) - No catalogued default look (CRAFT "Default looks to avoid") claimed by accident
Edit YAML in place. Bump version and provenance.last_reviewed when meaningful.
| Situation | Action |
|---|---|
Path in locked |
Ask first |
| New approved pattern | Add under patterns / components |
| Token rename | MAJOR if consumers break |
| Sync from Figma / Claude Design | Merge; ask before overwriting locked keys |
Never add proposed_changes or in-file changelogs.
- Compare
tokens↔ CSS variables / Tailwind theme / token files - Compare
integrations.shadcn.css_vars↔globals.css - Compare
components↔ real imports - Flag hardcoded values that should be tokens
- Report per token group as added / removed / modified, with a regression flag when anything consumers may rely on was removed or changed; update
.designonly when asked
Checklist: skills/design/references/REVIEW.md.
- Explicit user prompt (this task)
- Nearest
.design designskill- Generic taste skills
- Model defaults
After generating UI, cite:
- Token paths used (
tokens.color.primary, …) - Component catalog keys
- Whether shadcn CSS vars were written/updated