Design System · AI · B2B  |  MarketingOS, Kissterra · Sole product designer · 56 components, ~1,050 tokens

How I made a design system AI agents can build from

15 → 2 · design questions after doc format v1.1 Minutes, not hours · Figma → repo sync

Figma · Claude Code skills · Figma MCP · DTCG tokens · consumed by Cursor & Claude Code

My role

Sole designer and owner of the system. I diagnosed the problem, designed the documentation format, and built the AI workflow that keeps Figma and the repo in sync.

Context

Engineers started shipping with AI agents

MarketingOS is Kissterra's dense B2B analytics and campaign platform. I built its design system as the sole product designer. Then the frontend team moved to AI-assisted development: Cursor and Claude Code implemented features straight from Figma and specs, and those agents read my design system literally.

The system

56 components, every state accounted for

The library covers the full range of a data-dense product: from atomic controls (Button, Checkbox, Switch, Input) to complex composites (Analytics Table, Mega Chart, Date Range Selector, the filter system). Every component is specified across each size, style and state, and every value is mapped to a token.

Primitives~280

color, spacing, radius, type

Semantic~150

surfaces, interactive states, status

Components~620

per-component properties

Three collections in the DTCG format, with every alias chain resolved in the docs, from component token to semantic to primitive to the final value. System intent stays visible instead of hiding behind raw hex.

Problem

Design became the bottleneck of a pipeline built to be fast

The system was written for humans. An experienced developer fills gaps from context: what a table shows while loading, what closes a dropdown, who owns the empty-state copy. An agent reads the spec literally and fills every gap with a plausible guess. The result looked almost right, and "almost right" is the expensive kind of wrong. Every guess turned into a question for me, and the feature stopped until I answered.

The system drifted. Figma kept changing (renamed tokens, new props), the docs didn't. A stale token name in a spec becomes a wrong CSS variable in generated code, silently.

Insight

Tokens said how it looks. Nothing said how it behaves.

The questions weren't about missing details. They were about missing categories of information. After the Analytics Table shipped, developers came back with 15 questions. I sorted them:

8behavior edge cases 2consumer vs component 2accessibility strings 3tokens, sizes, spec authority

None of these had a place in the doc template. Careful writing couldn't fix it. The template had to change, and something had to keep it true as Figma moved.

Key decisions

Documentation as an interface for a new kind of user

One component, two contracts

Each component got a compact, structured description in Figma, written for agents to parse (anatomy, props, tokens, a11y in a fixed syntax), and a full Markdown spec in the code repo for developers. Figma's "Link to documentation" points straight to the repo doc. Rejected: one long doc for everyone. Agents lose precision in prose; developers lose context in a terse contract.

In Figma · compact contractThe component description, about 600 characters in a fixed syntax. Agents read it through Figma MCP.

ToastComponent
Description
Updated: 2026-05-20 · Node: 3223:162
Anatomy: icon · title · description? · primary-action? · secondary-action? · close
Props: Status(Warning|Info|Success|Error=Info) · Description?(bool=true) · Actions?(bool=true) · State(Default|Hover=Default)
Tokens: bg→toast/bg-color · border→toast/border-color · indicator→toast/indicator-color/{status}
A11y: role=alert · aria-live=assertive(Error|Warning) · polite(Info|Success)
Link to documentation

In the repo · full specThe .md file the description links to. Developers and their agents read it while building.

docs / components / toast.md

Toast

Updated: 2026-05-20 · Node: 3223:162

States

StateEntry conditionVisual
VisibleToast shown5s timer active
DismissingTimer elapsed or dismiss firedSlides out right

Behavior

Dismiss affordances

TriggerCloses?Notes
× button✓Always present
Auto-timer✓5s, no persistent mode
CTA click✓Both actions dismiss
Escape✕Non-blocking
Click outside✕No backdrop

Token Mapping · Accessibility · Implementation Rules

A doc format driven by real failures

Every question category became a section. States: entry condition and visual for loading, error, empty. Behavior: a dismiss matrix for overlays (×, Escape, click outside, CTA, timer). Consumer contract: what the component owns vs what the developer must provide.

docs/component-doc-format.mdv1.0 → v1.1 · 3 sections added · 2 extended · 4 unchanged
# Component Doc Format
> Version: 1.1 · Updated: 2026-05-20
## Purposeunchanged
<1–3 sentences. What it is, and what it is not.>
## Variant API3 questions · Figma or spec?
| Prop | Type | Default | Options | Source |
+Source: Figma · or Behavior, agreed with the designer
## Anatomyunchanged
1. part-name
2. part-name (optional)
## States8 behavior questions
+| State | Entry condition | Visual |
+| Loading · Error · Empty | … | … |
## Behavior8 behavior questions
+**Dismiss:** × · Escape · Click outside · CTA · Auto-timer
+**Multi-instance:** stack · replace · queue
## Consumer contract2 questions · who owns it
+| Responsibility | Owner | Notes |
+| sorting · empty-state copy | Consumer | prop / slot |
## Token Mappingunchanged
| `component/token-name` | `{alias}` |
## Accessibility2 questions · aria strings
- `role=rolename` · Keyboard · Focus
+- `aria-label` default "string", or dynamic: <condition>
## Implementation Rulesunchanged
- Use component tokens for all colors
Every difference gets a name

The goal was never zero drift; Figma is supposed to change. The goal was that no change goes unnoticed or unnamed. Every difference is classified by risk before anything is written. Critical: a token or prop removed or renamed. High: a value changed. Low: something new added. Nothing is applied without my approval. Rejected: fully automatic sync. A rename can break code; a person should see it first.

Drift reportrun d460cccb · Table token restructure
7 critical26 low33 changes
criticalrenamedtable/row-color/default → table/row/bg-color/default
criticalrenamedtable/row-color/hover → table/row/bg-color/hover
criticalrenamedtable/row-color/active → table/row/bg-color/active
criticalrenamedtable/table/padding-x → table/padding-x
criticalrenamedtable/table/row-gap → table/row-gap
criticalremovedtable/row-color/total
criticalrenameddate-picker/action-bar-color → date-picker/action_bar-color
lowaddedcolor/bg-interactive-selected
lowaddedtable/row/bg-color/selected
lowadded+ 22 tokens (table-filter, dropdown) · 2 descriptions
Your call: nothing is written until you decide
Generated vs curated sections

Props and token mappings are regenerated from Figma. Purpose and implementation rules are written by hand and never overwritten. Automation keeps facts fresh without erasing judgment.

docs/components/table.mdds:update · Token Mapping regenerated · 3 hand-written kept
## Purposehand-written · untouched
- Use for ordinary product tables: designers control columns,
widths and the cell pattern in each column.
- This is not the analytics table family.
## Variant APIfrom Figma · no changes
| columns | slot | — | — |
## Token Mappingfrom Figma · regenerated
table/table/padding-x8pxrenamed
table/table/row-gap4pxrenamed
table/row-color/default{color.bg-interactive-default}renamed
table/row-color/hover{color.bg-interactive-hover}renamed
table/row-color/total—removed
added
## Accessibilityhand-written · untouched
- `role=grid` · columnheader + aria-sort · gridcell
## Implementation Ruleshand-written · untouched
- Use table/indicator-color/* tokens for row status indicators

AI workflow

Agents keep it current. Agents build from it.

The system runs as two loops. In the first, agents keep Figma and the repo in sync, and I approve every change: component docs, Figma descriptions and the token files in the repo update together. In the second, coding agents build from two layers of documentation (the compact spec in each Figma component's description and the full .md doc in the repo) and from tokens that always match Figma. Whatever they still can't answer improves the format.

ds:audit

Reads every token and component prop from Figma through the Figma MCP, compares them with the last approved baseline and writes a risk-rated drift report.

ds:sync

Runs the audit, shows me the report and waits for my approval. One command for the whole cycle.

ds:update

Applies what I approved: the token files in the repo, the affected doc sections, and the compact description on each Figma component. Developers always have the current token set at hand.

An agent that interviews the designer. When a component doc is created or updated, the agent runs the v1.1 checklist. For every missing section it asks me targeted questions in a fixed order: behavior, then states, then accessibility strings, then the consumer contract. I answer; it writes and validates the section. Docs get complete without me starting from a blank page.

Impact

Agentic development stopped waiting on design

15 → 2design questions: 15 on one complex feature, 2 across the next two after v1.1
Minutes, not hoursto sync docs and repo tokens after a Figma change, with one command
7 breaking changescaught and reviewed before reaching code (9 audits in 16 days)
56 · ~1,050components and tokens, one format for people and agents

Coding agents built from complete, current specs and from tokens that always match Figma, instead of guessing. The two features after v1.1 produced 2 design questions combined, both product copy decisions no spec could answer. Audits caught a table restructure with 7 breaking token changes (six renames and a removal) before it reached an engineer.

Reflection

Agents are the fastest way to find ambiguity in a design system. Every gap they hit was a decision we had never written down.

A component spec is no longer something a human might read someday. It's a contract parsed at implementation time. Documentation quality turned out to be a structural problem, not a writing problem, and that is a design problem. Next: a pattern layer above components (how parts compose into a settings page or a filter bar), scheduled weekly audits, links to Storybook stories.