Tokens and guidelines

Tokens hold the values of your design system. Guidelines are the rules your agent must read before it edits. Together they keep every screen on your system.

Tokens

A value that starts with $ is a token. Layers use tokens for paint, fonts and lengths, so changing a token changes every layer that uses it. Your agent lists them with get_tokens.

color
A color, such as the fill or stroke of a layer.
string
A font family.
number
A length in px: spacing, radius or a font size.
text
A text style: weight, size, line height and font in one value.
get_tokens (shortened)
{  "ink": { "type": "color", "value": "#1A1A1A" },  "space-4": { "type": "number", "value": "16" },  "text-body": { "type": "text", "value": "normal 16/1.5 $font" }}

Paint and fonts must use tokens (why this matters for agents). A hex value that equals a token is snapped to it, and any other hex is rejected, so an off-system color cannot slip in. A token can also have a value per mode, such as dark. In the app, find your tokens in the Design system panel on the components board, or on the Variables page.

Design system status

get_guidelines also reports how complete your design system is. It is ready when the file has all five of these, thin when it has three or four, and empty when it has fewer.

  • At least 4 colors
  • At least 1 font
  • At least 3 text styles
  • At least 4 spacing tokens
  • At least 2 radius tokens

When it is not ready, your agent runs setup_design_system. That adds a 4px spacing scale (4, 8, 12, 16, 24, 32, 48, 64), radius tokens and a type scale on your first font. Colors and fonts are your brand's, so the agent proposes them or asks you.

Guidelines

Wonderblok ships built-in rules that apply to every file. The short version:

  • Colors and fonts come from tokens, and spacing sits on a 4px grid.
  • Reuse components before drawing new ones.
  • Hierarchy comes from size and weight: at most 5 text sizes and 2 or 3 weights per screen.
  • One primary action per screen, and no decoration for its own sake.
  • Real copy, with buttons that say what they do.
  • Text contrast of at least 4.5:1, or 3:1 for large and bold text.
  • Screens that show data also show empty, loading and error states.
  • Names in code match names in Wonderblok.

After each edit, Wonderblok checks the screens it touched for what a machine can see: too many text sizes, placeholder copy, low contrast, a card inside a card, missing empty or error states, and fonts that are not available. The findings come back as lines that start with guideline:, and the agent fixes them before moving on.

Rules before edits

Every edit has to carry the hash that get_guidelines returns. Without it, or with an old one, the edit is refused. The hash covers Wonderblok's rules and your project rules, so changing either one pauses edits until the agent reads them again.

Edit refused
edits need `guidelines`: read the design guidelines first (get_guidelines),follow them, and pass the hash it returns

Your project rules

Add your own rules in the Design system panel on the components board. Under Guidelines for agents, write them in the Project rules field, for example that cards use 12px corners. They are saved in the file and appear after Wonderblok's rules in get_guidelines. Agents also follow them in code they build from your design. See the get_guidelines reference.

Rules are checked when the agent edits, not when you do. You can always draw something that breaks them by hand.

Was this page helpful?

Edited Nov 8, 2026