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_tokens returns 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_guidelines returns 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_candidates finds repeated structures that are not components yet. create_component turns one into a component, and a replace_with_instance edit swaps the copies for instances of it.
  • Import with components kept. When an agent writes a page as HTML, an element with data-component comes 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?
Expose them as data the agent can list and must reference, for example over MCP, and reject values that are not tokens. A token list in a prompt or a PDF is advice the agent can skip.
How do I give it my components?
Keep each component in one place, with a name, and let the agent place instances of it instead of redrawing the parts. In Wonderblok, components live on the components board and the agent places and edits instances over MCP.
How do names stay the same between design and code?
Name tokens and components the same in both. Where the codebase uses a different name, record the exception once with set_code_names, and every spec and code export uses the code name.
What if my tokens already live in code?
Point the design system at that file as its tokens source. Canvas edits to those tokens are then refused, and the agent syncs them from code with set_tokens, so code stays the owner.
Can the agent find components I have not made yet?
Yes. component_candidates lists repeated structures that are not components yet, biggest first. The agent turns one into a component with create_component, then swaps the copies for instances.
Does this work outside Claude Code?
Any agent that speaks MCP and can run a local server can use it. Claude Code, Codex and Claude Desktop are the ones we test and document.

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.