Making a Figma design system usable in every AI chat

ZBrain’s design system lived in Figma, where an AI chat can’t see it. I updated it for the components the product needs today, then rewrote it as a Markdown guide and an HTML reference that any AI project can load, so every designed screen and generated prototype comes back looking like one product.

Product
ZBrain Design System 5.0
Role
Updated the Figma design system; wrote the Markdown guide and built the HTML reference
Team
Shared with the ZBrain product team
Status
In use for AI-assisted prototyping, with refinement ongoing
The ZBrain design system specimens from the HTML reference, as a collage: the type scale, the data table with its states, charts, spacing, status badges, forms, feedback, icons, the component inventory, elevation and motion.

The context

The rules were in Figma. The prototyping had moved to AI chats.

The team explores ideas by prompting. Every new chat had to guess the brand, so every prompt came back a little different, and the older Figma system no longer covered the components the product now used.

A model can generate a screen. It needs the system in its context to generate a ZBrain screen.

The problem

Two chats, two different products

Figma is read by designers. A chat is read by a model. Without the system in its context, each chat invented its own look for the same product. The design task was to put something between them that both can use.

Chat 1“Can you make a Spaces page for our admin console? I need a table with the space name, the policy attached to it, how many models it uses, monthly budget and status. Add search, a provider filter and a button to add a new space.”

Chat 2“Need a Policies screen for the ZBrain admin. Show each policy with the spaces it applies to, its models and monthly limit, and how many overrides it has. Should be easy to filter by space and create a new policy.”

The approach

Update the source, then make it portable

Three artifacts, one set of values.

The updated Figma system: I brought it up to date with the components the product needs today: 120 variables, 11 component families and 17 text styles. It stays the source of truth.

The Markdown guide: Tokens as copy-ready CSS and Tailwind, every component with its sizes and states, plus a starter prompt and a review checklist.

The HTML reference: All 23 sections rendered as live UI: a visual target for generated screens, built from the same values as the guide.

  • TokensPrimitives, semantic, radius, spacing
  • ComponentsVariants and states
  • NamingOne grammar for everything
The guideMarkdown + HTML
  • Written rulesRoles, sizes, recipes
  • Starter promptPasted into every chat
  • Review checklistChecks what comes back
What the Figma system held on one side, what an AI chat needs on the other, and the guide that translates between them.
1# ZBrain Design System6**Purpose of this file:** a single reference an AI model (or a person) reads before generating any screen, prototype or component, so every output looks like the same product.⋯11## 0. Instructions for the model151. **Use only the values in this file.** No hex code, font size, spacing value, radius, shadow or duration may appear in output unless it is listed here. …162. **Blue means action.** `--action-primary` (#2563EB) is used for primary buttons, links, selection and focus, and for nothing decorative.173. **Purple is for AI only.** `--ai` (#7C3AED) marks machine agency: AI actions, model output, agents, copilots and the *Processing* status. Never use it for anything a human does.⋯115  --text-primary:     #0F1115;  /* 18.90:1 on white */125  --border-default: #E5E7EB;  /* card, table and outline-button edges, table row lines, dividers */130  --action-primary:         var(--color-blue-600);139  --ai:         var(--color-violet-600);  /* 5.70:1 on white */⋯736## 11. Review checklist for generated screens740- [ ] Only hex values, sizes, radii, shadows and durations from this file741- [ ] Blue only on actions, links, selection and focus; purple only on AI743- [ ] One primary button per region; the destructive action is last and confirmed746- [ ] Radius matches the family (8 controls, 12 menus and tables, 16 cards, 24 dialogs)

Design decisions

Five rules a model can resolve, not just read

Each one removes a kind of guesswork from a generated screen.

  • Tokens are the contractNamed values, never a guessed hex or size.
  • One naming grammarPeople and models call a thing by the same name.
  • Constraints over instructions8-pt grid, 17 type styles, 10 radii, 6 elevations.
  • Color carries meaningBlue acts, purple is AI, status means state.
  • Accessibility in the tokensContrast, focus and targets decided once.

In practice

A repeatable starting point for each AI chat

Every chat starts from the same rules, and every result is checked against the same source.

Set up once: the Figma system becomes the Markdown guide, and the guide goes into the AI project folder.

Every prototype: a prompt in the project, a prototype generated from the shared tokens and components, then a review against the HTML reference and Figma.

Until it ships: anything that needs work goes back as the next prompt, with the same rules. Approved work is delivered as the final result, with the functionality in focus.

A Claude Code session in ~/zbrain/prototypes. The guide is attached with @ZBrain-Design-System.md and the prompt is the same Spaces request from the problem: a table of spaces with policy, models, budget and status, plus search, a provider filter and an add button. Claude reads the 733-line guide, works through five to-dos from its data-table recipe, writes spaces.html from the guide's tokens, opens it, and reports the review checklist: no values outside the guide, one primary button, 52px rows, focus rings and all three states. It offers the Policies page next.

The result

Two chats, one product

The same two pages, built in Claude with the guide attached. These are the prototype screenshots, straight from the chats.

Chat 1 · guide attachedSpaces

Spaces, built in Claude with the guide attached: the ZBrain sidebar, one blue Add Space button, and a table of spaces with their policy, models, budget and an Active status.

Chat 2 · guide attachedPolicies

Policies, built in Claude with the guide attached: the same sidebar and blue action, and a table of policies with their spaces, base grants and scoped overrides.

Inside Figma, too: Figma’s own AI reads the same library. Asked to update the tabs and table on the Models page, it searched the components, styles and variables first, then kept the original UI.

Figma’s AI panel, asked to update the Models page’s tabs and table and keep the original UI. It lists its steps: discovered top library assets, searched for components, searched for styles, searched for variables. Beside it, the ZBrain Admin Console Models frame with Pending and History tabs and a table of models with tokens, cost, requests, last used and budget limit.

What changed

One quality bar across the product team

Two weeks after launch I talked to the team about how they were using it.

  • 27 peopleon the ZBrain product team prototype from the same guide
  • One lookPrototypes come back uniform across people and prompts
  • ~60% less timespent fixing design elements: generated frames come out about 80% accurate, so time goes to making the functionality work

The system

Twenty-three sections, three shown in full

Four groups: foundations, components, AI patterns and the rules that hold them together. 120 variables, 86 component variants and 120 icons. The three sections below are the live UI; the other twenty live in the HTML reference.

Color system

Semantic first, decorative never

Color in the system is functional. One blue carries every action, purple is reserved exclusively for AI, and everything else is neutral. Each role ships with a contrast recommendation so accessible pairings are the default, not a review comment.

ROLE
HEX
RGB
HSL
USAGE
CONTRAST
Primary / 600
#2563EB
37 99 235
221deg 83% 53%
Primary actions, links, focus rings
5.17:1 on white - AA
Secondary
#475569
71 85 105
215deg 19% 35%
Secondary buttons, muted emphasis
7.58:1 on white - AAA
Neutral
#5B616E
91 97 110
221deg 9% 39%
Body copy, secondary text, icons
6.21:1 on white - AA
Success
#16A34A
22 163 74
142deg 76% 36%
Positive states, confirmations
3.30:1 - AA large text only
Warning
#D97706
217 119 6
32deg 95% 44%
Cautionary states, pending items
3.19:1 - badge & icon only
Error
#DC2626
220 38 38
0deg 72% 51%
Destructive actions, validation
4.83:1 on white - AA
Information
#0284C7
2 132 199
200deg 98% 39%
Informational banners, hints
4.10:1 - AA large text
AI Accent
#7C3AED
124 58 237
262deg 83% 58%
AI actions, model output, copilots
5.70:1 on white - AA
Background
#FFFFFF
255 255 255
0deg 0% 100%
Page canvas
-
Surface
#FAFAFB
250 250 251
240deg 11% 98%
Cards, panels, wells
1.04:1 vs background
Border
#E5E7EB
229 231 235
220deg 13% 91%
Hairlines, input outlines
1.24:1 - hairline, not a boundary
Hover
#1D4ED8
29 78 216
224deg 76% 48%
Primary hover & pressed
6.70:1 on white - AA
Disabled
#9AA0AC
154 160 172
220deg 10% 64%
Disabled text & icons
2.6:1 - non-interactive only
Overlay, 64%
#0F1115
15 17 21
220deg 17% 7%
Modal scrims, dimming layers
Scrim - never direct text
Primary token scale
base: primary/600, 11 steps
50
#EFF6FF
100
#DBEAFE
200
#BFDBFE
300
#93C5FD
400
#60A5FA
500
#3B82F6
600
#2563EB
700
#1D4ED8
800
#1E40AF
900
#1E3A8A
950
#172554

Buttons

Thirteen variants, six states, zero ambiguity

Every button resolves from the same recipe: one height scale, one radius token, one focus ring. Variants change intent and states change feedback. Nothing else is allowed to vary.

DEFAULT
HOVER
PRESSED
FOCUSED
LOADING
DISABLED
Primary
Continue
Continue
Continue
Continue
Continue
Continue
Secondary
Preview
Preview
Preview
Preview
Preview
Preview
Ghost
Dismiss
Dismiss
Dismiss
Dismiss
Dismiss
Dismiss
Outline
Export
Export
Export
Export
Export
Export
Destructive
Delete
Delete
Delete
Delete
Delete
Delete
Success
Approve
Approve
Approve
Approve
Approve
Approve
Text
Learn more
Learn more
Learn more
Learn more
Learn more
Learn more
AI Action
Generate
Generate
Generate
Generate
Generate
Generate
Loading
Saving...
Saving...
Saving...
Saving...
Saving...
Saving...
Icon
Split
Publish
Publish
Publish
Publish
Publish
Publish
FAB
Segmented
Day
Week
Month
Day
Week
Month
Day
Week
Month
Day
Week
Month
Day
Week
Month
Day
Week
Month
SIZE SCALE
Button
xs, 24px
Button
sm, 28px
Button
md, 36px
Button
lg, 44px
Button
xl, 52px

AI components

Purple means machine agency

AI work gets its own visual grammar. Purple marks machine agency, and every agent shows its reasoning, the tools it used and its sources.

PROMPT BOX, VARIABLES, VOICE
Summarize Q4 revenue for
{{customer}}
and flag anomalies
Claude 5
Listening... release to send
SUGGESTED PROMPTS
Draft a renewal email for at-risk accounts
Explain this quarter's churn spike
Build a dashboard from invoices.csv
Generate insights
AI CHAT, REASONING, STREAMING, CITATIONS
Why did enterprise churn spike in March?
Reasoned for 4.2s
Churn concentrated in 14 accounts on legacy pricing. Three signals stand out: support ticket volume doubled in February, usage of the reporting module fell 61%, and all 14 renewals hit the new seat-minimum policy ▍
1
churn_q1.csv
2
pricing-policy.pdf
3
support-log
Ledger Agent
agent/finance, v2.4
Running
Reconciles invoices, drafts follow-ups, and escalates anomalies above $10K to a human.
search
sql
email
escalate
RUNS TODAY
142
SUCCESS
99.1%
ESCALATIONS
3
Memory
Prefers tables over prose summaries
Fiscal year starts in February
Reports currency: EUR
TOOL CALLING
search_invoices(q="Q4")
240ms
generate_chart(type=bar)
1.2s
draft_email(to=finance)
running...
AI WORKFLOW BUILDER
TRIGGER
New invoice received
AGENT
Classify & extract fields
REVIEW
Human approval over $10K
ACTION
Post to ERP
CONTEXT WINDOW
64K
of 200K tokens
System
12.4K
Tools
9.8K
Memory
7.2K
Conversation
34.6K

What I learned

Designing for a second kind of reader

A model audits what was never written down: anything the team knew but hadn’t documented showed up as drift.

Naming is the interface: a component nobody can name precisely can’t be requested or reused.

Fewer legal values beat more guidance: a bounded scale gives a model clearer choices than “stay on brand”.