_DESIGN SYSTEMS_ # What an agent (and humans) needs from your design system A design system an agent can read without guessing is also one a designer, a developer or a Product Owner can use without asking. What it needs, where it should live, how it connects to Figma and why it holds up better to big changes. Javier González · 13 Nov 2026 · 9 min read ## Why prepare it for agents and for people An AI agent doesn’t ask when it’s unsure: it fills the gap with whatever is most likely. People do ask, and that conversation has a cost we rarely count: message threads, reviews, the same question about a margin or a colour again and again. That’s why I like this test: **if an agent can’t use your design system without guessing, a new person on the team probably can’t either**: . What one is missing is what the other is missing: rules written down in a place they can read. Preparing the system for agents and organising collaboration between design and front-end turn out to be the same work. ## Where it should live, and why: in a repository In many organisations the design system lives in Figma, and that limits it. Only people with a licence can consume it, and it isn’t an open format. It’s common to see front-end developers without Dev Mode access, because of licence costs, who end up inventing measurements and colours with no consistency or link to what was designed. Figma is open to AI through MCP, but that leaves everything the AI extracts to interpretation. The alternative is for the system to live in a **repository**: (GitHub, Bitbucket or another), in open formats, with change history and review by branch and pull request. Figma, React, Storybook, the content manager and the AI agents all read from there. Anyone in design, development or brand can consume the system from their own stack, with no licence or specific tool.A real example: the public primer/primitives (https://github.com/primer/primitives) repository on GitHub (MIT licence). The tokens are JSON in a repository, with versions, branches, review and even an AGENTS.md for agents. ## What it is made of - **Tokens.** The basic visual decisions: colour, typography, spacing, sizes. There are primitives (the values) and semantic ones (what they mean). They mean nobody has to write a value by hand. - **Component contracts.** A document in an open format, such as JSON, that describes a component at a functional level: behaviour, properties and design. It doesn’t explain the component: it bounds it. - **Components.** The implementation in React, with its twin in Figma. Storybook displays them and a JSON lets a content manager such as Storyblok consume them. ## A contract, from the inside FigmaJSONRuleLabellabelText, not empty. Required.StatestateText, any value. Required.icon (layer)iconIcon name. Optional.(not in Figma)id · componentid unique on the screen; component is ActionTile. Fields in the schema - **required** component, id, label, state - **optional** icon - **other fields** not allowed The contract{ "format": "design-contract/0.1", "type": "ActionTile", "version": "0.1.0", "status": "Draft", "figma": { "names": ["Actions / Tile"] }, "properties": [ { "figma": "Label", "json": "label" }, { "figma": "State", "json": "state" } ], "nested": [{ "figma": "icon", "json": "icon", "as": "icon" }], "schema": { "required": ["component", "id", "label", "state"], "additionalProperties": false } } A valid use{ "component": "ActionTile", "id": "open-settings", "label": "Open settings", "state": "Enabled", "icon": "settings" }Simplified example of a contract: the Figma → JSON map with its rule, the schema and a valid use. Format in draft (0.1). A contract has three layers, and both a person and an agent can read all of them: - **The map between Figma and the JSON, with its rule.** The Figma property Label is the field label: text, required and not empty. State is state. The icon, a layer in Figma, is the optional field icon. The id and the component name don’t exist in Figma: only in the JSON. - **A schema that rejects anything not listed.** Required fields, optional ones and no others allowed. If an agent tries to add an invented field, the schema rejects it. - **The behaviour.** How the component wraps on small screens, what happens when the text is long, how each state looks. A contract isn’t written in one go: it carries a version and a status, and it’s iterated with the people who will use it. The one in this example is at 0.1.0, in draft, and neither design nor front-end has approved it yet. ## Anatomy of a component - **Padding** 16 · space.400 - **Title** Body/M Bold 16/24 · font.primary - **Gap** 16 · space.400 - **Radius** 12 · shape.radius.300 - **Fill** background.container - **Gap between tiles** 12 · space.300Anatomy of a component: each visual decision with the token it is tied to. The anatomy annotates every visual decision with the token it is tied to: the fill, the padding, the radius, the title style, the gap between elements. Measurements aren’t written by hand; they’re linked to a token. Documenting it this way exposes what a person usually solves from memory: a padding that reuses another component’s token, or two states with different text styles. An agent has no such memory: if it isn’t written down, it repeats it as is or invents it. ## How AI, design and front-end consume it Proposals Design council Design · Front-end · Brand Repository Tokens Contracts Componentshistory · review · open formats Consumers **Figma** variables and documentation **React + Storybook** tokens, contracts, components **Content manager** JSON **AI agents** via MCP server (proposed)Proposed architecture: decisions live in the repository and are consumed by Figma, the front-end, the content and the agents. Dashed: the proposed piece. - **AI**: reads tokens, contracts and the list of available components to generate interfaces with business rules already defined, instead of inventing them. In the architecture I propose, it does so through an MCP server that exposes the repository. - **Design**: consumes it from Figma: variables are generated from the tokens, and each component carries its documentation with the contract. A plugin can check that what is designed doesn’t leave the UI kit. - **Front-end**: consumes everything, as explained below. ## Figma: yes for tokens and variables, no for components Figma’s tokens and variables can be connected. A plugin or connector generates the variables from the system and exports them to the formats the front-end consumes. What is done in Figma and what shows up in the front-end is exactly the same. That has a practical consequence: **a change in the tokens or contracts repository can automatically control an existing design, without touching code**: . You change the value of a semantic token, the connector updates the Figma variables and the screens that use them change by themselves; the front-end reads the same token and changes too. A contract works similarly: if a rule changes, what is validated and what tools and agents generate follows the new rule. With components there is no connection. A Figma component and a React component are two ways of building the same thing, with different materials, which is why Figma components have to be designed to measure for Figma. Each component has a **twin**: , and the contract is what keeps them aligned: it carries the map between Figma properties and JSON fields. ## Front-end consumes everything Front-end teams can consume the whole system: tokens, contracts and components, exactly as they come out of the repository. They need neither Dev Mode nor a licence. And there is nothing new to learn: it’s npm, Git and TypeScript, the tools they already use. - **Tokens as variables.** The repository publishes the tokens in the formats each stack needs (CSS variables, JavaScript or TypeScript constants, JSON), generated from the open format with a tool such as Style Dictionary. The front-end writes var(--space-400) instead of a value. - **Components as a package.** The React components are published as a versioned package, and Storybook serves as the live reference: every variant and every state is there to see. - **Contracts as types and validation.** The contract’s schema validates data before rendering and lets you generate TypeScript types. If a field arrives that the contract doesn’t allow, it fails in continuous integration, not in production. - **Screens from JSON.** A content manager such as Storyblok, or an API, delivers the structure of the screen (which components, with which properties). The front-end renders it, and the contract guarantees its shape. - **Versions and updates.** The system uses semantic versioning and a changelog. An update arrives as a pull request: the team reviews what changes, and a change that breaks a contract shows up in the review, not afterwards. Tokens · CSS.tile { padding: var(--space-400); border-radius: var(--shape-radius-300); background: var(--background-container); } Component · Reactimport { ActionTile } from "@org/design-system"; Contract · TypeScriptimport Ajv from "ajv"; import contract from "@org/design-system/contracts/ActionTile.json"; const validate = new Ajv().compile(contract.schema); validate(data); // additionalProperties: falseHow the system reaches the front-end: tokens as variables, a component from the package and a contract that validates the data. The result is that questions are settled in the contract, not in a message thread, and that an AI agent writing front-end code follows exactly the same path: it reads the same tokens, uses the same components and goes through the same validation. ## Why a decentralised system holds up in the medium and long term Two situations put any design system to the test: - **Big redesigns.** If the look lives in semantic tokens and the behaviour in contracts, a deep visual change is made in one layer, not component by component. - **Stack changes.** Today it’s Figma and React, tomorrow it may be something else. Tokens and contracts are open formats that belong to no tool, so they survive. What gets rebuilt are the consumers, not the decisions. That’s the advantage of a system that isn’t a tool’s file but a set of written decisions. ## What design and front-end gain by working in sync Sharing tokens, contracts and components means speaking the same language: - Design validates before handing over, not three weeks later. - Front-end receives structure, not an image with measurements. - Questions about margins, paddings and colours stop repeating. - Product has the decisions written down and versioned. - Newcomers understand the system from day one. What doesn’t change is who decides: the agent explores, builds and checks; people review and decide.