← work
case 02 · design system · part 1 of 2
FREN

Nirio design system

ongoing

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.

585 components audited · 27 decisions · 3 skills · 19 pull requests
Two dot charts: described components before and after
role
Lead, in a design team of two. I ran the audit, set the rules with my tutor and rebuilt the components with Claude. We designed the target architecture together.
context
Work-study at Nirio, in a product team of five
timeline
October and November 2026, still running
tools
Figma and its MCP server, Claude Code, GitHub

Every figure on this page comes from a dated report in the team repository. Shown with the agreement of my tutor.

the short version
problem

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.

decision

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.

result

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.

01 / context

A system written for people who already know it

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.

585
components: 129 sets with 1,057 variants, and 456 single components
96.6 %
of them without a description
235
variables, most of them without a code name
54
pages audited, mostly one page per component

What an agent reads

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.

my hypothesis

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.

02 / method

Rules first, then measurement, then construction

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.

1 / 9 October
Inventory

Read only. Pages, components, variables, what has no description.

2 / 13 October
Standard

13 closed questions, each with options and their measured impact.

3 / 13 October
Pilot

Three components audited by script, to calibrate the rules.

4 / from 20 October
Passes

One subject, one branch, one report with a measure before and after.

Thirteen closed questions

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.

A register, not a memory

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
NamesButton, show icon, compte plusLowercase 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.
PropertiesProperty 1, Layout (Nb page), Selected indexOne 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.
Tokens99 of 145 semantic colours without a code nameTwo layers, primitive and semantic, no component layer. A code name on every semantic token.The same name in Figma and in the code.
DocumentationDocumentation frames on the canvas, some still in lorem ipsumThe 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.
FileOne page per componentOne 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.

A description written for an agent

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.

the eleven keys, translated from French
Role: what it does, in one sentence
When to use: the use cases
When not to use: and what to use instead
Variants: each property, its values, their role
States: the values and what triggers them
Behaviour: interaction, keyboard, long content
Accessibility: role, label, target size, contrast
Tokens: the main semantic tokens
Related components: parts, alternatives
Code: a dash until the Storybook exists
Status: stable, to review, or deprecated
03 / proof

Three components, measured before and after

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.

15 → 0
blocking, major and minor findings, counted as 1, 9 and 4 before
81 → 96
Button variants, out of 96 possible combinations
79 s
for the scripted audit of one component
13 min
to rebuild and check the three in Figma, in 19 calls
before · 81 variants
The Button set before: the destructive column is incomplete
after · 96 variants
The Button set after: every combination exists
The only blocking finding of the pilot: the destructive button had no disabled state on a light background. It did not exist at all on a dark one.

What you cannot see in the picture

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 pilot corrected the rules too

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.

The navigation bar set before: five tabs on the left, three tabs on the right
One set, two different bars.

Two findings a script cannot make

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.

what this does not prove

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.

04 / scale

From three components to the whole file

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.

25 → 2
pages marked “in progress” in the file
1 → 21
components with no blocking or major finding, out of the first 38, in one pass
0 → 401
icons with a description, out of 401

The unfinished pages

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.

Icons: meaning, not drawing

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.

Tokens: the developers’ words

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.

one group of tokens, before and after
background-primary-light-default
background-primary-low
background-primary-medium-default
background-primary-medium
background-primary-high-default
background-primary-high
#CBCBE1, a raw value used six times
background-primary-low-pressed
no hover state
background-primary-medium-hover

The name says the intensity, then the state. It stays true in dark mode, where “high” can be a light colour.

← work Part two: components, the repository and working with AI →