/ui:design-componentfrom Diorama UI
Designs component states as a token-based contract before implementation, using Paper or Figma. Ensures every visual value is a design token and surfaces missing tokens by drawing states side by side.
Ships in Diorama UI. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This is the step before add-component. Its output is a contract
diff (§ 8) that an implementer can build from without guessing, a sheet in
Paper or Figma that illustrates it, and the design gaps it surfaced. The
contract lives in code (ADR 0032); the sheet never defines it.
CONVENTIONS.md and AGENTS.md win over anything here.
One rule governs the sheet.
Draw only what the contract can say. Every value on it will be
transcribed by someone who cannot see your intent — so a value that is not a
token, or a state that is not drawn, becomes an invention at implementation
time. add-component's § 1 tells implementers that raw hex on a sheet is a
design bug. This skill is how you avoid shipping them.
Corollary: the sheet is where a missing token gets discovered. Designing
Table found two — a selected-plus-hover fill that no role expressed, and
--ui-bg-hover and --ui-bg-selected resolving to the same value in light,
which makes a hovered row and a selected row indistinguishable. Neither is
visible from code. Both are obvious the moment the states are drawn side by
side, which is the whole reason this step exists.
get_guide({ topic: "paper-mcp-instructions" }) once per session, before
any other Paper call. get_basic_info for artboards and dimensions.create_artboard for the spec. Never
edit the references — the user is still reading them.reference/handoff-sheet.md before you draw the sheet. It has the
measured values. A sheet that looks unlike its neighbours reads as a draft.griddy-icons-in-paper
skill is the method (public in bydiorama/skills; Diorama installs it as
bydiorama:griddy-icons-in-paper). A drawn approximation looks close enough to approve and
is not what ships, and an icon layer called SVG has lost the one thing the
sheet knew: which glyph it is.pnpm design:primitives [name…] prints the size, radius, variant and
prop-default maps straight out of registry/ui/*.tsx. Run it before drawing
any Button, Input, Textarea, Tabs, Badge, Select or Accordion, and draw the
numbers it gives you.
Tokens are not enough, and one sheet proved it: Buttons drawn as pills, fields
with a 1px border-control edge, segmented rows at 32px — every value a legal
token, not one of them what ships. shape defaults to soft; a Button's
edge is an inset ring-hairline (the 1.5px --ui-stroke-hairline), not a border; secondary carries no
fill; a field's resting edge is a 1.5px border-subtle hairline because
the focus ring — not the border — carries SC 1.4.11.
Never transcribe those numbers into this file. A table here is a second
copy of button.tsx that goes stale the first time someone edits the real
one, and a sheet built from the stale copy still looks approvable. The script
reads source at run time and so has nothing of its own to drift.
An off-scale value inside a component is the component's, not yours. Tabs
insets its track p-[2px] and says in a comment why the scale cannot express
it. "Correcting" that on a sheet is drift wearing compliance; match it and
leave the gap recorded where it already is.
Before drawing an app frame, read reference/screen-chrome.md: Header,
Sidebar, Nav Rail and Patterns --- Navigation have sheets, and
design:primitives does not cover them.
A component whose job is movement — something arriving, a number changing, a
label swapping — has no sizes and often no colour, so the sections below do
not fit it. Read reference/motion-sheets.md first: filmstrips per phase,
a motion-levels table, and every frame value computed with
scripts/motion-frames.mjs from the real curve and duration, never drawn by
eye. It also lists the decisions such a sheet surfaces, which belong to the
user, and the Paper traps this work hit.
In Figma, bind to variables imported from packages/tokens/dtcg/theme-zero/
(light and dark modes); never type a hex. Paper's token list is light-only. A flat file cannot hold a
light-dark() pair (design/paper/README.md), so the dark column of any
sheet is a mock and the resolver owns the real values. Dump both schemes
before drawing anything:
// run from the repo root: node --experimental-strip-types <file>.mts
import { resolveThemePair } from "./packages/tokens/src/resolve.ts";
import { THEME_ZERO, resolveZeroPairOptions } from "./packages/tokens/src/themes/zero.ts";
const pair = resolveThemePair(THEME_ZERO, resolveZeroPairOptions);
console.log(pair.light["--ui-bg-hover"], pair.dark["--ui-bg-hover"]);
Skip the mood-and-palette brief the Paper guide asks for — the design system already is the brief. Say so in one line and start.
Use var(--ui-*) for every colour in the light half. It documents the role at
the same time as drawing it, and get_computed_styles will hand the
implementer the token name rather than a hex.
Sections that earn their place, in this order:
| Section | Why it is not optional |
|---|---|
| Anatomy | The lane system — fixed slots and which column flexes |
| Sizes | sm/md/lg: row height, inline padding, body size, radius |
| States | Every state the component can enter, one per row, labelled |
| Data states | Loading and empty — the frame must not collapse |
| Dark | The states matrix and the sizes, again |
| Token map | part → role token → light value → dark value |
The token map is the section that actually gets implemented from. Build it.
One write_html call per visual group. For anything repeated — rows, header
variants, spec lines — write one, then duplicate_nodes and restyle from
the returned descendantIdMap, batching into a single update_styles. Seven
row states cost one row of HTML and two batched calls this way.
Repeated rows need fixed-width slots with flexShrink: 0, never gap
alone (the Paper guide's vertical-lane rule). It is what lets three sizes of
the same table stay comparable.
CSS custom properties do not cascade in Paper. Re-declaring --ui-bg-base
on a frame changes nothing for its children — Paper resolves tokens at the
document level. A cloned light section dropped into a "dark portal" frame
renders exactly as light, and looks like it worked until you screenshot it.
So: clone the light section, then apply the resolved dark hex node by node in
one batched update_styles, grouped by role (all primary inks, all muted
inks, all hairlines, …). Grouping by role is what keeps it reviewable.
The surface scale inverts between schemes (add-component § 2), and the
consequence for a ramp is sharper than for a single role: put the container
on the wrong ground and hover steps darker while pressed steps lighter, so the
two states straddle their own background. Both values were correct in
isolation.
Draw the dark container on --ui-bg-surface (#1E1B18) over a
--ui-bg-base page (#171411), and read the ramp as a sequence — resting →
hover → pressed must move one direction, in both schemes. Since the
2026-11-03 warm-ink ramp every dark step goes UP from the page; the old
mid-grey page sat above its own cards, which is where the straddling came
from. Dump the values from the resolver (§ 2) — never copy them from an older
sheet, whose dark half may still show the mid-grey ramp.
get_screenshot after every section, against the guide's checkpoints. Use
scale: 2 for anything under ~4px: a 2px selection edge read as absent at
1x and was there.design/ and put its URL in the doc's design
field: provenance for the ledger, an optional link in the MCP view. Anything you could not
resolve goes to the user and into the doc's needsDesign, which
pnpm design:gaps collects.reference/paper-traps.md
§ Assets that will not download before you redraw anything.finish_working_on_nodes when done. Never leave node IDs in user-facing text.Sweep the board before you call it done — a screenshot cannot see any of
this. Run the find_nodes queries in reference/paper-traps.md § The
sweep; each must come back empty, and each is a defect that shipped on a
sheet that looked finished. No dashed or dotted lines, ever — a codified
decision covering borders, rules, legend swatches and SVG strokes; a
secondary line is a lighter role, never a dash. Report the counts — "verified
0" is evidence; "looks right" is not.
What the sheet settled goes into code, and review happens on that diff:
the typed doc's anatomy and states (one line per state, token names and
sizes, CONVENTIONS § 11), new tokens in packages/tokens, and the geometry
contract <item>.geometry.json — read reference/geometry-spec.md
first: the calls, and the traps that make Paper's coordinates lie.
Read reference/placeholder-data.md before you type a name, a status or
an email on a sheet.
| Trap | Rule |
|---|---|
fontFamily set once on the artboard | Font does not cascade from the artboard. Every text node needs its own font-family: var(--ui-font-body), or all of them render system-ui — the whole board in the wrong face, and nothing looks broken. Sweep it: find_nodes for font-family: "system-ui, sans-serif" must return 0 |
| Reaching for mono for numbers or token names | There is no mono face (ADR 0011). Numeric alignment is font-variant-numeric: tabular-nums; token strings get a bg-sunken / radius-sm inset in the body face |
| A label at 11px because it "reads as a caption" | 12px is the floor and --ui-text-caption is 12px. ADR 0009 §2 records the 11px specimen as an annotation error — do not re-derive it |
Every other trap this work has hit is in reference/paper-traps.md.
Read it when Paper does something unexpected: a blank screenshot, a
gradient that does not appear, a clone that collapses.
The contract diff: states, tokens, geometry · every state drawn · all three sizes · both
schemes, with the interaction ramp checked as a sequence · every colour a
role token or a named new one · every icon extracted from the set and its
layer named for the export · a token map section · a Gaps section
mirroring the doc, one badge per row · new tokens and unresolved gaps
reported to the user · exported to design/ with the Paper URL ·
finish_working_on_nodes called.
A sheet missing any of these is a mood board, whatever it looks like.
reference/geometry-spec.md (opens in a new tab)reference/handoff-sheet.md (opens in a new tab)reference/motion-sheets.md (opens in a new tab)reference/paper-traps.md (opens in a new tab)reference/placeholder-data.md (opens in a new tab)reference/screen-chrome.md (opens in a new tab)scripts/motion-frames.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
design-spec, component-design, design-tokens, handoff, figma, paper
npx claudepluginhub bydiorama/ui --plugin ui8 skills in this plugin
/animate-app-interactionsAnimate state changes in an app that consumes Diorama components. Use when a count, label, icon or list should animate, a transition does not replay, or an interaction must respect reduced motion./apply-effectsApply glass, grain, sheen, glow, shimmer, ink or shaders to Diorama components. Use when adding texture, emphasis, a gradient ground or a loading halo without changing the component API./build-demo-pageTurn a screen design into a scripted, interactive demo page. Use when storyboarding a UI walkthrough, animating a Paper mockup, or preparing component snippets and compositions for capture.Other plugins' skills for the same job