Give a coding agent your tokens and components
Hand your design system to the agent as data it has to use: tokens it must reference, components it places instead of redrawing, and the same names in design and code. Here is how, and how Wonderblok does it over MCP.
The short answer
Put your tokens and components somewhere the agent reads them as data, make them required, and keep their names the same in the design file and the codebase. Then ask the agent for a screen: it draws with your tokens and your components, and builds it in code with the same names. A style guide pasted into a prompt does not do this, because nothing stops the agent from picking its own blue.
Tokens: make them required
- Define the basics by role: colors (ink, surface, primary, danger), one font, text styles, a 4px spacing scale and two or more radii. The design tokens guide lists what to start with.
- Let the agent list them. In Wonderblok,
get_tokensreturns every token with its value per mode, such as dark. - Refuse what is not a token. Paint and fonts must use tokens. A hex equal to a token snaps to it, and any other hex is rejected.
- Make the agent read the rules first.
get_guidelinesreturns your rules with a hash, and every edit must carry that hash.
Components: place them, do not redraw them
- One home for each component. A Wonderblok file has a components board. Every top-level layer there is a component, and changing it updates every instance.
- Turn what is already drawn into components.
component_candidatesfinds repeated structures that are not components yet.create_componentturns one into a component, and areplace_with_instanceedit swaps the copies for instances of it. - Import with components kept. When an agent writes a page as HTML, an element with
data-componentcomes in as an instance of that component, not as loose layers.
Same names in design and code
The handoff breaks when the design says primary and the code says brand. Name tokens and components the same in both. Where the codebase differs, record it once:
set_code_names { stack: "web", names: { "primary": "brand", "Button": "UiButton" } }After that, get_spec and get_code for that stack use the code names. get_code writes values that hold a token as the token (bg-brand, var(--brand)), so the screen lands in code on your system, not as raw hex.
When code owns the tokens
If your tokens already live in a file in the repo, set it as the tokens source with set_design_system. Canvas edits to those tokens are then refused, and the agent syncs them from code with set_tokens. To share the system with other tools, get_design_md writes it as a DESIGN.md: tokens as YAML, plus your README and rules as prose.
The loop, end to end
get_guidelines rules + hash get_tokens the values to use draw the screen instances of your components, tokens only get_spec / get_code build it, named as in your code
Guides per agent: Claude Code, ChatGPT and Codex. Every plan has MCP access; see pricing for the call allowance.
Questions
How do I give a coding agent my design tokens?
How do I give it my components?
How do names stay the same between design and code?
What if my tokens already live in code?
Can the agent find components I have not made yet?
Does this work outside Claude Code?

Start on Free.
Your agent can join
when you are ready.
Get the app for macOS, Windows or Linux. Android and iOS tablets are coming soon. No card needed.