Your design system has a new user: an AI agent

AI, 05.12.2026

An AI agent can't look at your Figma file and get the idea. It reads what you give it and guesses the rest. What I built on top of a design system so an agent can use it, what worked, and a checklist.

Topics
AIProduct design
Published
Reading time
5 min read
Author
Piotr Brzeziński
"Your new user is an agent" in white on black, its Y in blackletter, beside a blank plaster interface tablet crossed by a red scan line

Yesterday I wrote about rebuilding a design system in Figma: Omni 2.0, which replaced the product's old library, Splash. This post is about its other user. Omni 2.0 is also built for an AI agent to read when it assembles screens in code, and an agent can't look at a Figma file and get the idea. It reads what you give it and guesses the rest.

So on top of the components I built a package for agents. It isn't wired into the product yet, so read this as a build log, not a case study with results.

01

What does an agent need from a design system?

  • A contract for each component: properties, allowed values, defaults, events and slots. I used one JSON Schema per component.
  • A job for each component: one sentence on what it's for, so the agent picks a banner over a toast for a reason, not by its name.
  • Composition rules as data: which children each slot takes and which combinations are forbidden. A sentence gets skipped; a list the validator checks doesn't.
  • Only the tokens it may use, with their roles. Of about 300 variables, a screen may write 92.
  • A rules file, like AGENTS.md or CLAUDE.md: the non-negotiables, short, always loaded.
  • Examples of whole screens in code. Agents copy structure well.
  • A validator that says what's wrong in a form the agent can act on.
  • A way to say "this doesn't exist" without inventing a component.

02

What did I build?

Omni 2.0's components are web components. Everything else is generated from the manifest their code produces: React and Angular wrappers, a JSON Schema for each of about a hundred components, and the agent's context. If the delivery format changes, I change one generator, not the library. A schema, simplified:

{
  "title": "ds-badge",
  "x-job": "Labels a row or card with a short status word.",
  "properties": {
    "tone": {
      "enum": ["neutral", "info", "success", "warning", "danger"],
      "default": "neutral"
    }
  },
  "additionalProperties": false,
  "x-children": { "default": { "text": true, "elements": [] } },
  "x-example": "<ds-badge tone=\"success\">Live</ds-badge>"
}
badge.schema.json (an invented example, not the real file)

The whole context, about 200,000 tokens, is too big for every request, so it comes in layers: a core file of rules is always loaded, with a 25,000-token budget the build enforces, and the rest loads on demand.

Then the validator. It checks the agent's code against the schemas and rules: unknown components, wrong values, raw colours, children in the wrong slot. Each finding carries an id, what is allowed and a fix:

Card.tsx:9   [enum]  <ds-badge tone="purple">
             allowed: neutral, info, success,
             warning, danger
Card.tsx:14  [slot]  <ds-icon> inside <ds-badge>
             ds-badge takes text only
Card.tsx:21  [space] margin-top: 13px
             use a spacing token
Validator findings (an invented example)

The repair loop is built to send back only the findings. It stops after two attempts, or sooner if the same findings return, and a person looks.

03

What worked?

  • Letting the agent admit a gap. A placeholder component stands for "needed, but not in the library"; the rules forbid inventing anything else. An agent given only the package (about 56,000 tokens of it) built a project overview from a prototype frame: a header with the project's status, two headline numbers, four phase cards that switch a three-level task table below, and the project's details. It marked one gap: a selectable phase card with progress. The next day it became a new component.
  • The validator as a first reviewer. On that page its first run found 21 problems, mostly one complaint repeated (the layout CSS lived in the wrong place); after the agent's fixes, one false alarm was left. The page still needed several rounds of my review in a browser.
  • Testing the documentation like code. An agent that could read only the package answered 36 questions, each several times. First run: 31 of 36. All five keyboard questions failed: the agent said "not documented", which was true. Once keyboard behaviour went into the schemas as data: 36 of 36, though a few answers still cited their sources loosely. A run costs about $3.
  • Writing MUST, not should. Agents read "should" as optional, so I rewrote 27 prohibitions in the rules as MUST, MUST NOT or NEVER.

A caveat: I wrote those questions and their answers, so this shows the docs are complete, not that screens get better.

04

What would I do differently?

  • Start from the consumer's format. I built all this before seeing how the product's agent loads components. Format, token budget and their repair loop were the first questions to ask.
  • Test the examples in a browser too. One check found the app-shell pattern had no main landmark, and the validator forbade both ways of adding one. Pattern and validator agreed, and were both wrong.
  • Run screen evals early. The harness for scoring generated screens is built but has had no model run yet.

05

A checklist for your design system

01
Generate schemas, wrappers and agent docs from one source.
02
Give the always-loaded rules a size budget.
03
Read the gap reports; they are your backlog.
04
Test the docs with questions, and rerun them on every change.
05
Ship one version for components, schemas and rules, so the agent never reads docs for a release it isn't running.

None of this is new: it's the documentation a design system always needed, made exact enough for a machine to check. When I vibe-coded a large app, the agent built well on foundations and badly on guesses. If you want your design system ready for agents, this is work I do.

Need a website, app or SaaS designed?