Design systems for coding agents: how to prepare one

by Luigi Greco
To get artificial intelligence (AI) coding agents to respect your design system, you have to make it explicit and machine-readable: design tokens in a standard format, components documented with correct and forbidden uses, rules written in files the agent reads in the repository, and an automated check before release. The agent follows what it finds.
In this guide we look at why agents drift away from the system, the four layers of an agent-readable design system, how to check generated code, and who should own the work across design and development.
Why coding agents drift away from your design system
A coding agent such as Claude Code, Cursor or GitHub Copilot works on the code in the repository and on the instructions it receives. It does not open the Figma file, and it was not in the meeting where the team agreed on one primary button per screen. When it cannot find a token or a component to reuse, it makes up something plausible: a blue close to the right one, spacing by eye, a new button that looks like the others.
At first glance the result looks right, so nobody fixes it. Each choice the agent makes on its own is small, but they add up, and over time the product ends up with three different border grays and two versions of the same search field. If the system is already inconsistent, with different names in Figma and in code or duplicated components, the agent copies the inconsistency and spreads it faster than a team of people would.
This guide assumes you already know what a design system is and focuses on one question: how to make it readable by an agent.
What an agent needs to know about your product
An agent needs three things that usually live in people’s heads: product principles written so they can be checked, a list of what is never done, and a clear instruction on what to do when the component it needs does not exist. Without them, the agent falls back on the most common habits in the code it has seen, and those are not yours.
Product principles you can actually check
“Modern and clean” helps nobody, least of all an agent. A sentence you can verify by looking at the screen works better: one primary button per view, field labels always visible above the field, error messages that say how to fix the problem. When we write these principles with teams, we often find that some of them were never really decided, and it is worth deciding them before handing them to an agent.
Constraints and anti-patterns
Agents learn a lot from prohibitions, as long as they are concrete: “don’t hard-code colors, use the tokens”, “don’t create button variants outside the component”, “don’t put text inside images”. Next to each prohibition, write the alternative to use. Otherwise the agent follows the rule to the letter and finds another way out of the system.
When the component doesn’t exist
This is the situation that produces the most off-system code. The rule we recommend is that the agent never invents: it tries to compose the solution from existing components and, if that is not enough, it stops and flags it. That way the request reaches whoever looks after the design system, and the decision stays with a person.
The four layers of an agent-readable design system
A design system becomes readable by agents when you work on four layers: design tokens in a standard format, components documented for reuse, instruction files in the repository, and design context passed to the agent through the Model Context Protocol (MCP). You need all four: together they are the same material you would give a new colleague.
Design tokens in a standard format
Design tokens are the system’s basic decisions, such as colors, spacing, typography and radii, stored as named data. Since 28 October 2025 there has been a shared format for exchanging them between tools: the Design Tokens Format Module 2025.10, published by the Design Tokens Community Group of the W3C (World Wide Web Consortium). It is a Community Group final report, not an official W3C standard. For an agent it is still useful, because a file in a known format can be read without guesswork.
Names matter too. A token called “primary action” tells the agent when to use it. One called “blue 500” only tells it the color, and the agent will end up using it wherever a blue seems to fit.
Components documented for reuse
Each component needs a name, a purpose, variants, states and usage examples, both correct and wrong. It also needs a link between the component designed in Figma and the one in code; otherwise the agent reads the design and rebuilds a button that already exists. Figma Code Connect is one example of that link: it maps components in the file to components in the repository.
Instruction files in the repository
Agents read instruction files stored in the repository. AGENTS.md is an open format read by several tools. Claude Code uses CLAUDE.md and can also read AGENTS.md; Cursor has its own project rules in .cursor/rules and accepts AGENTS.md as an alternative; GitHub Copilot uses repository instructions and also recognizes AGENTS.md.
Our advice is to keep a single source for the rules and have each tool’s file point to it, rather than maintaining three copies that sooner or later drift apart. The best instructions are short and specific, and they refer to tokens and components instead of repeating their values: if a color changes, it should change in one place only.
Design context through the Model Context Protocol
MCP is an open protocol that connects agents to external tools and data. The Figma MCP server brings the file’s variables, components and layout data into the agent’s environment, so the agent works on the design system rather than on a picture of the screen. Figma’s documentation recommends structuring files well, with consistent components, variables and names, and adding custom rules that tell the agent how to use them. We won’t cover setup here: it depends on the team’s tools and changes often.
Example: how to write a rule the agent follows
A rule works when it is short, can be checked and says what to do instead. Below is an excerpt from an instruction file made up for this article: it does not come from a real project, and the token package is simply called “package X”.
Made-up example: design system instructions for a coding agent
- Use only the colors, spacing and fonts from token package X. Don’t hard-code values.
- Use components from the product library. Before creating a new one, check whether it already exists.
- Each view has a single primary button. Other actions use the secondary variant.
- Text meets the minimum contrast set by the Web Content Accessibility Guidelines (WCAG) 2.2, level AA.
- Field labels always sit above the field, never only as placeholder text.
- If the component you need doesn’t exist, don’t invent it: compose it from existing ones, or stop and flag it in the change description.
Every line can be checked by looking at the code or the screen, and none repeats a value, because values live in the tokens.
How to check that generated code respects the system
Code written by an agent should be reviewed like code written by a person, with a few more automated checks. Before merging, check that only approved tokens and components are used, run accessibility tests and compare the screen with the design reference; then comes the design and development review. These checks reduce the risk of recurring errors, but some still get through.
Much of this can be automated: a code analysis tool that flags hard-coded values, tests that fail when a component from outside the library appears, a visual comparison between the generated screen and the reference. Human review stays, but it moves to what an automated check cannot see, such as whether a flow makes sense or the tone of a message.
For accessibility, WCAG 2.2 belongs inside components and rules, not in a check at the end: an error in the system, for example a contrast that is too low in the secondary text token, repeats on every screen the agent generates.
Who owns it: governance between design and development
Agent instructions are part of the design system and are managed the same way: they have an owner, go through the same review as components, and have a version and a changelog. The work is usually shared between whoever looks after the design system and whoever leads front-end development, because the rules affect both.
The problem we see most often is that agent rules are born inside a single team, perhaps written in a hurry by someone who wanted to fix less code, and nobody updates them when a component changes. Over time they describe a system that no longer exists. Product decisions, meaning what to show, to whom and with what priority, stay with people.
From web to TV: what we learned designing multi-platform and multi-brand design systems
When the same language has to live on the web, on mobile and on TV, or across many brands that share one architecture, unwritten rules stop holding up. Whoever wasn’t in the room applies only what is written down: a new team, another platform, and today an agent too. That is why multi-platform work confronted us early with the same problem agents raise today.
Tokens on several levels
We separate base values, such as the color scale and measurements, from meanings, such as primary action, secondary text or raised surface, and from brand or platform variants. That way, changing brand or theme doesn’t touch the components, which only use meanings. An agent working with semantic tokens respects the brand without even knowing which one it is.
One source, many destinations
The handoff from Figma to code can be automated with scripts and plugins, and it is the most visible part of the work. What gets neglected is the map of the chain: design files, plugins, repositories, packages, apps. If nobody keeps it up to date, no one, person or agent, knows where a value comes from.
Rules written as if for a new colleague
Agent instructions work when they read like the onboarding for a designer or developer who has just joined: short, with examples, and with the prohibitions explained. A rule that wouldn’t help a new person probably won’t help the agent either.
How Conflux works on this
We help teams make their design system readable by the agents they already use. We start from research and an audit of the design system, Figma files and code, with our Evidence based design™ method. Then we define tokens, rules, anti-patterns and accessibility criteria with the team, and we prepare the instructions for its coding agents. We work from our offices in Milan and Rome; details are on our design system page.
We are developing Conflux DS (Design System) Engine, which today turns a Figma design system into code for the web (React), verified before release. Use by AI agents is in development.
Frequently asked questions
Why doesn’t an AI agent respect my design system?
Because it works on the code and the instructions it finds. If tokens, components and constraints are not made explicit in the repository, the artificial intelligence (AI) agent picks values that are plausible but foreign to the product, and if the system is inconsistent it replicates the inconsistency.
Is there a standard format for design tokens?
Yes. On 28 October 2025 the W3C (World Wide Web Consortium) Design Tokens Community Group published the Design Tokens Format Module 2025.10, a format for exchanging tokens between tools. It is a Community Group final report, not an official W3C standard.
What is the difference between AGENTS.md, CLAUDE.md and Cursor rules?
They are instruction files for coding agents. AGENTS.md is an open format read by several tools; CLAUDE.md is Claude Code’s file, and Claude Code can also read AGENTS.md; Cursor uses project rules in .cursor/rules and accepts AGENTS.md. It is best to keep a single source of rules that the other files point to.
Do we need to rebuild our design system from scratch to use agents?
Usually not. You start with an audit: consistency between Figma and code, token names, duplicated components. You fix what causes the most confusion, then write the agent instructions and keep them updated along with the system.
Does an agent-readable design system replace human review?
No. It reduces recurring errors, but generated code still needs automated checks and design and development review, including accessibility against the Web Content Accessibility Guidelines (WCAG) 2.2.
If your team already uses coding agents and is seeing off-system code, we can start together with an audit of what is there.
Book a first meeting, no commitment
About the author
Luigi Greco is the founder and CEO (Chief Executive Officer) of Conflux. For more than 25 years he has worked on emerging technologies, from User Experience (UX) to agentic artificial intelligence. Read his bio.
We also recommend


