Making a component library readable by an AI agent.
I wanted Claude to build and repair components in our Figma library. It could not, because the library was written for people who already knew it. This page covers the audit, the rules and the proof. Part two covers the components, the shared repository and how I worked with AI.
Every figure on this page comes from a dated report in the team repository. Shown with the agreement of my tutor.
On 9 October 2026, 565 of the 585 components in the library had no description, and names followed several conventions. A designer who knew the file could work with it. An agent could not.
Fix the rules before the components. First a written standard, decided question by question. Then scripts that measure the file against it. Only then let Claude build, on a copy, with a human decision at fixed points.
On the first three components, audit findings went from 15 to 0. All 401 icons are described, against none. 19 pull requests merged in a month. The time saved is not measured: we never timed a manual audit.
The library feeds every screen of the Nirio app. Two designers maintain it. Each of us works with Claude Code and the Figma MCP server, which lets an agent read a file and write in it. The first inventory, read only, gave the starting point.
An agent does not look at a component the way a designer does. It searches the library by name, reads the description of what it finds, then sets properties by their names. A property called Property 1, a layer called Frame 2760 or an empty description is a dead end. All three were in the file.
What helps an agent also helps a new designer and a developer: names that follow one rule, one source per subject, and a description that says when not to use a component. So the work is worth doing even if the agent part fails.
I did not ask Claude to clean the file. An agent that corrects without a written rule applies its own taste, and nobody can check the result. So nothing changed in Figma before the rules existed.
Read only. Pages, components, variables, what has no description.
13 closed questions, each with options and their measured impact.
Three components audited by script, to calibrate the rules.
One subject, one branch, one report with a measure before and after.
Claude read the file and wrote the questions, each with its options, the measured impact of each option and a recommendation. My tutor and I answered. Nine answers became rules. We discarded four questions on purpose, for example a maximum number of variants and an imposed language for names.
Every rule in the standard points to a numbered decision, with its date. The register holds 27 of them, and each new decision now gets its own file. When Claude starts a session, it reads the rules. When a rule surprises one of us, we can go back to the day it was decided.
| subject | found in the file | rule | what it changes |
|---|---|---|---|
| Names | Button, show icon, compte plus | Lowercase with hyphens everywhere. A slash for levels, an underscore for private parts. Booleans start with show-. | A name can be guessed from the rule, and a script can check it. |
| Properties | Property 1, Layout (Nb page), Selected index | One vocabulary. state or status, with enabled at rest, and current for the current item. | The agent sets a state by its name, without reading every variant first. |
| Tokens | 99 of 145 semantic colours without a code name | Two layers, primitive and semantic, no component layer. A code name on every semantic token. | The same name in Figma and in the code. |
| Documentation | Documentation frames on the canvas, some still in lorem ipsum | The description of the component is the only documentation. One model with eleven keys. | One place to read, and one place to keep up to date. |
| File | One page per component | One page per family, each component in a card: public parts on the left, private parts on the right. | 58 empty pages deleted. 10 family pages, 47 cards, 137 components, none outside a card. |
The model has eleven keys, always in the same order, one to three lines each. A key with nothing to say stays, with a dash. Scripts check that the keys are there and that every variant and state named in the text exists in the component.
The key that matters most is the third one. A design system usually says what a component is for. An agent also needs to know when to pick something else.
Before touching the whole file, I tested the method on three components: a divider, the Button and the bottom navigation bar. The scripts read each one and listed 15 findings: 1 blocking, 9 major, 4 minor, 1 for information. Then Claude rebuilt the three as copies on a demo page, next to the originals, and the same scripts measured again.
In the loading state, the old Button removed its label layer. A label typed in an instance was lost each time the button went through loading. Now the 96 variants share one structure and the label is hidden, not removed. The pressed colour was a raw value, used six times: it became a token with a code name. And 384 corner bindings pointed to a variable that had been deleted.
The first run flagged the contrast of disabled buttons. The accessibility standard asks nothing of an inactive control, so the script now exempts them: 18 texts on the Button. A missing combination is blocking only when the rest or the disabled state is missing. Contrast is checked in light mode only, because the app does not use the dark one.
Most findings are mechanical: a missing combination, a raw colour, a default layer name. Two came from judgement, and I had to confirm them myself.
The navigation bar mixed two bars in one set: five tabs for one offer, three for the other, and 6 combinations out of 14 that meant nothing. It is now one bar per offer, with a single property for the current tab.
The Button handled dark backgrounds twice, with a variant and with a theme mode. In dark mode, the secondary button showed white text on white. We kept the variant and wrote down that the dark mode is not used.
79 seconds is the scripted audit alone: reading, analysis, capture, judgement. We chose not to time the same audit done by hand, so I cannot state a time saved. And the rebuilt components are copies on a demo page. Their fixes enter the library pass by pass: the Button in the library still had its 81 variants when I added its hover state on 20 November. What the pilot proves is narrower: the measure is repeatable. Two runs of the analysis give identical files.
After the pilot, the work went subject by subject. Each pass starts with a measure, lists the questions Claude cannot answer alone, records my answers, then measures again.
On 20 October, one pass covered the 38 components of the pages marked in progress. Accessibility set aside, blocking findings went from 13 to 4 and major ones from 71 to 32. Claude wrote 31 descriptions and replaced 82 orphan instances, whose main component had been deleted. It left a list of questions. We answered eight the same day, and a second pass applied the answers.
Do icons need documentation? I asked for research first. Carbon, Atlassian and Lucide document a family with rules and each icon with a few words, never with the full model of a component. So each icon got two keys: its meaning in the product and keywords in French. The meaning is the use, “delete an item”, not the drawing, “bin”. 90 names were off the convention and five drawings existed under two names.
After a meeting between developers and designers, we aligned the variables on Tailwind 4, the framework the developers use. Spacing and radius tokens took Tailwind names, every code name took the Tailwind format, and a new collection holds its 13 default containers. No value moved on screen.
On 24 November I simplified the colour levels. Five words, lighter to higher, became three: low, medium, high. The suffix for the rest state disappeared. 86 variables read, 46 renamed, no collision. The identifiers do not change, so components and screens follow the new names without any work.
The name says the intensity, then the state. It stays true in dark mode, where “high” can be a light colour.