An agent-ready Aurora registry
How I rewrote Aurora's registry so coding agents read the product, not only the components — and what a quality review taught me about letting a script edit contracts.

Agents read the registry before they read the code
Aurora’s registry is a folder of machine-readable files that describes the design system: one contract per component, token metadata, composition patterns, product features, and page layouts. Coding agents and the reference gallery read it to decide what to build and how.
When I picked it up, the registry described components well enough for a person and loosely enough to mislead an agent. Props were missing or mistyped, token descriptions were generic, and the product itself — what a betslip is, who may place a bet — was not written down anywhere an agent was allowed to read.
My job was to curate it, folder by folder: all 36 component contracts, the token overlay, eight new files of global rules, the composition patterns, two product features, and three layouts.
| Folder | What it holds | What I did |
|---|---|---|
tokens/ |
Metadata for 265 theme variables, generated into inventory.json from a hand-written overlay |
Wrote the 126 missing descriptions and revised the rest |
components/ |
One contract per component, aggregated into component-registry.json |
Rewrote all 36 contracts and regenerated the index |
global-rules/ |
Rules that apply across components | Added eight files: 127 rules and 51 anti-patterns |
features/, layouts/ |
Product contexts and page shells | Wrote the betslip and casino-lobby features and three layouts |
Tokens: a role for every value
Aurora has 265 theme variables: surfaces, foregrounds, borders, fills, concept colours, CTA and inverse families, typography, and radius. An agent picking a colour sees only their names unless the registry says what each one is for.
The registry builds inventory.json from two sources: the theme’s own variables, and a hand-written overlay of descriptions. Where the overlay had nothing to say, the generator filled the gap with a sentence that described the mechanism, not the purpose. On main, 126 of the 265 tokens were in that state.
From generated filler to a role for every token

Every token now carries a role, a usage note, and only the Tailwind utilities that fit it.
I filled in the missing entries and reworked the existing ones, checking each against how the token is actually used. A few examples show what that means in practice:
fill-lowis the lightest neutral fill for tab strips, wells, and read-only fields — not a card background.alpha-backdropis the semi-dark layer behind dialogs, drawers, and sheets.odd-mutedis the default fill for an unselected odds chip, lighter than the selected state so the two cannot be confused.tone-jadealways stays jade, whatever the theme, because badges rely on it.
The quality review later caught places where I had moved too fast — a pressed-state token described as hover, utilities listed that did not fit — and those were corrected. The rule I kept: write each description for that token, never paste it from a neighbour.
Component contracts: one file per component
Each of the 36 components has a contract that answers four questions: which component to use and when not to, what can be set, how it behaves for keyboard and assistive technology, and where its source of truth lives in Storybook, code, and Figma.
One contract per component, written for two readers

Shortened from components/button.json. The same file serves a designer choosing a component and an agent writing the code.
The prose fields are written for designers first. Button’s whenNotToUse, for example, grew from two sentences to guidance on not restyling it for other purposes, not changing its opacity, keeping to the two action radii the tokens define, and not inventing states the component already has. Props, by contrast, are checked against the component’s source — a lesson the review taught me the hard way.
After editing contracts, I regenerated component-registry.json and validated every contract against its schema, so an agent always reads one consistent index.
Global rules: decisions no single component owns
Some decisions belong to no component: which token pairs meet contrast, what an inverse area is, how dark mode differs from inverse, how copy should sound, when a dialog becomes a drawer on a phone. Before this work, the folder held three short files. I added eight.
127 rules and 51 anti-patterns no single component owns

Each rule has an ID, a one-line summary, a severity, and what is expected instead. Anti-patterns name the mistake and its fix.
Every rule follows the same shape so an agent can act on it: an ID, a one-line summary, a description, a severity of blocker, should-fix, or nit, and what is expected instead. 45 of the 127 rules are blockers. The anti-patterns are written from real mistakes: a fill token used as a card background, primary-foreground text on a ghost button, an inverse region used to fake dark mode, a dialog whose buttons only say OK and Cancel.
The files also point at each other instead of repeating themselves. Inverse territory is defined once in inverse-areas.json; accessibility and semantic tokens link to it. That habit became one of the rules I wrote down after the review: one owner per rule.
A component contract answers one question. A product needs more.
A contract tells an agent which props a component exports. A betslip asks different questions: who is looking, whether they can place, what a leg is compared with a parlay, and which surface only feeds the slip.
I wrote those answers into feature files. The betslip file carries a short glossary and a set of user states, each with display rules. A guest sees login and join actions instead of Place Bet. A logged-in user gets balance-aware validation, and placement still waits for the server. Pending bets live in My Account, not in the slip.
What an agent must know about a betslip

Typeset from the registry file. An agent asking whether a guest can place a bet finds the answer in one rule, not in a design file.
The casino lobby got the same treatment, with a different shell: a full-width browse page with a page header and navigation tabs, not the account layout the betslip uses.
Layouts an agent can choose between
Agents also need to know which page shell a feature lives in. I curated three account layouts and wrote each one around when to use it:
| Layout | Use it for | Shape |
|---|---|---|
| Type A | Dashboard-style account pages with parallel panels | Left navigation and a two-column widget grid |
| Type B | Picking from a list, then reading the detail | Left navigation, a 300px list, and a flexible detail panel |
| Type C | Three peer panels | Left navigation and three equal columns |
Each layout lists its required sections and the mistakes it is meant to prevent, such as dropping the left navigation. Writing them against the live Storybook stories exposed one stale rule: Type A still described cards and KPI tiles that the shipped layout no longer used.
The review that changed how I worked
Part of the component work was done with a script that normalized every contract in one pass. A quality review of the branch found what that cost:
- Sub-component props lost their names.
TabsList.variantbecamevariant, which now described the wrong component. - Some props were invented, written from design intent instead of the code.
- Real props disappeared in the name of simplicity. Select lost
value,open,disabledand others. childrenwas added to components that render a native input and cannot take children.
One stripped prefix, a different meaning

Left: a simplified reconstruction of what the bulk script produced. Right: the restored contract. The values are the same; only the owner changed, and that is the part an agent needs.
I checked every claim in the review against the source code and fixed the contracts over five commits. The fixes went beyond props: dialog rules now match the shipped story on button order, token descriptions say what each state actually is (a pressed state is not a hover state), and patterns no longer point at patterns that do not exist.
Rules for the next person, or the next agent
The most useful output was a short list of rules for anyone editing the registry, human or agent. The first one is the one I needed: the code is the truth. Before writing a prop, a value, or a default into a contract, open the component and confirm it.
The others follow from the mistakes: never bulk-rewrite contracts with a script, never invent or silently delete props, keep sub-component names intact, give each rule one owner so it cannot drift into three wordings, and never reference something that does not exist.
What is still open
Not everything was fixed, on purpose. A few token descriptions and a chip radius still disagree with the code, the navigation tokens have two candidate sources of truth, and some contrast gaps — the primary button among them — need a decision beyond the registry. The test I most want does not exist yet: one that fails when a contract names a prop the package does not export.
How the work was done
I curated the registry with AI coding agents doing much of the editing, and I reviewed and corrected their output. The registry’s tooling — the MCP server and the agent workflow — was a team effort; my part was the content those tools serve.