Every screen of AI Next Studio had been prototyped with AI. The UI elements were all there, and they looked right, but nothing was named, nothing was shared and every screen had invented its own values. So every new AI prototype drifted a little further. In eight hours of focused execution, built on prior familiarity with the product, I directed an AI agent inside Figma and gave the product its own design system: every element named, every value a role, every component documented, and a React library mapped back to it. The goal was simple: the same prompt should give the same, on-brand outcome every time.
AI Next Studio helps enterprise teams map an As-Is process, reimagine it with AI, then design, specify and build the result. Its UI had been prototyped quickly with AI tools, and the result was a complete library of 136 components in ten sections: tags and pills, messages and composers, panel chrome, tables, flows, workspaces and modals.
The elements were never the problem. The problem was that each screen had been generated on its own, so the library had no shared language. I audited every layer of the file:
reimagine/…, feedback/…, discovery/…, catalog/… or flow/…. The brand purple alone had 6 different names, and 26 colours were defined more than once.Why it mattered: an AI agent prototyping the next screen can only reuse what it can read. Here it read status/neutral/surface on a chat bubble and a text-link colour on an avatar, so it guessed, and each guess drifted further from the product. We didn't need more screens. We needed a design system made for this product, so AI prototyping would produce the same outcome every time.
The brief had two audiences. People: designers and engineers who need one trustworthy source. Machines: the AI agents that already generate our prototypes, and will only stay on-brand if every element has a name, a role and a rule.
I used Google's Material Design 3 as a benchmark for depth: every component on its own page, full variant matrices, real states, documentation. I was explicit that it was not a style to copy. The product's purple, its type and its density had to survive intact.
Every colour, radius and type size comes from the existing UI, deduplicated. Only the completeness bar is borrowed.
Nothing gets a raw hex value. Primitives feed semantic roles, and components only ever see roles.
Size = Extra small, never XS. If a property reads clearly to a person, it maps cleanly to code and to a model.
Patterns are built from components, and templates from patterns. Change a button once and every modal updates.
Every component carries a usage description, and every value is bound to a variable an agent can resolve.
AI output looks finished before it is. Automated tests check every variant; my eyes check intent.
I organised the file the way people look for things: start here, learn the rules, find the part, see it in context. Each layer only uses the layers above it, so the structure itself teaches how the system works.
Three layers keep decisions where they belong. Primitives are hidden from designers so nobody picks "purple 600" by accident; they only pick a role such as action/primary/bg, which can change underneath without touching a single component.
The raw palette extracted from the product: 128 unique values from 165 variables, near-duplicates merged.
167 colour roles (text/, surface/, border/, icon/, action/<style>/<state>, status/<tone>/<role>, interaction/) plus 21 spacing, 13 radius, 3 border-width and 22 typography variables.
Fills, strokes, spacing and type bound to roles. 532 variants; 99% of colours, 92% of radii and 86% of gaps are tokens.
| Layer | Convention | Example |
|---|---|---|
| Variables | Group / role / state | action/secondary/bg-hover · status/warning/text |
| Text styles | Role / Size Weight | Body/12 Semibold · Paragraph/12 Regular · Overline/12 Bold |
| Variants | Full words, Title case | Style = Secondary · Size = Extra small · State = Focused |
| Booleans + slots | "Show X" + "X icon" | Show leading icon + Leading icon (instance swap) |
| Layers | What it is, not what it was | Title row, Status pill slot, never Frame 123 |
I worked with Claude in Cowork, connected to Figma through the Figma MCP server. It could read the source file, write Plugin API scripts and build directly in our design-system file. My job was the brief, the structure, the taste and the review.
Why eight hours was enough. The hours were execution, not discovery. I already knew the product, its users and its screens from working on it; the UI elements already existed; and the agent did the repetitive building while I made the decisions. The thinking behind the system took far longer than the eight hours it took to build.
Read the whole source frame, catalogued 147 components, and pulled every hex value, font size, radius and spacing value into a deduplicated palette.
My brief said "M3-level". The agent read that as "make it look like M3" and produced a polished Material clone with Material colours. I caught it on review, clarified that M3 was a benchmark for depth only, and we deleted every M3 page, collection and style. The lesson about precise briefs shaped everything after.
Built our own tokens: 103 primitives, 167 semantic colour roles including interaction states the product never defined (hover, pressed, focus), plus spacing, radius, border and typography variables and 57 text styles.
Every primitive in the product became a component with real variant matrices. Button alone is 10 styles × 4 sizes × 5 states = 200 variants, each documented.
Cards, tables, panel chrome, flow diagrams, discovery panels, conversations, modals and workspaces, rebuilt from component instances instead of drawn shapes.
Six pieces of critique, each traced to a root cause and fixed system-wide. Details below.
Tested design-to-code on real components, generated a dashboard from a one-line prompt, then built a 26-component React library and wrote Code Connect mappings back to Figma.
Each component page follows the same template: what it is, when to use it, anatomy, the full variant specimen and usage examples. Consistency is what lets a new designer, or an agent, learn one page and understand all of them.
This was the real test of the architecture. The workspace, the conversation panel and the modals below contain no hand-drawn buttons, tags or icons; every one is a live instance. Change the Button component, and every screen in the product follows.
The first pass looked finished. Then I started using it the way a designer would: clicking into variants, typing long labels, swapping icons. That is where the real work was.
Show tile icon switch, off by default, so the template matches the product exactly.Then I made the checks automatic. Every component was instanced, switched through every variant with custom text and swapped icons, and stretched with long labels. The test ran until it found zero failures, so "it looks right" became "it is right in every state".
"AI-friendly" isn't a style. It's whether an agent reading the file gets the same answer a senior designer would. Five properties make that possible, and each one is checkable.
surface/brand, not #6E30F2, so generated code inherits the token, not a guess.Title row, Status pill slot, Focus ring: the layer tree explains itself.The real test of the system is what an AI agent receives when it reads a design. Same component, same tool, before and after.
I asked the Figma MCP server for the design context of the AI Message component in the original file and in the design system. This is what an agent gets to build from (trimmed; brand names removed).
// layer "Frame" › "g" › "AiAvatar" › "Container" › "Image" avatar bg: var(--colour-tokens/text-colors/color-text-link) radius: 16777200px title font-['Inter:Semi_Bold'] text-[11px] // hard-coded text, no prop time text-[10px] row gap: 8px stack gap: 6px bubble bg: var(--status/neutral/surface) padding: 12px radius: 8px message text-[12px] leading-[1.4] // description: none
// layer "Title row" › "Avatar slot" › Avatar(Type=AI) avatar bg: var(--surface/brand) radius: var(--radius/full) title Label/11 Semibold · prop title time Label/10 Regular · prop timestamp row gap: var(--space/8) stack gap: var(--space/6) bubble bg: var(--surface/muted) padding: var(--space/12) radius: var(--radius/lg) message Paragraph/12 Regular · prop message // description: "Message from Studio AI: avatar, author, // timestamp and message bubble (surface/muted)."
| What the agent receives | Before | After |
|---|---|---|
| Design values that are tokens | 5 of 13 (38%) | 13 of 13 (100%) |
| Tokens used for their intended purpose | 3 of 5 | 13 of 13 |
| Text with a named style | 0 of 3 | 3 of 3 |
| Usage description | None | Yes, for the component and its avatar |
Counted from the raw Figma MCP responses for node 1:430 (original) and 146:129 (design system). One component is a small sample; the file-wide audit in section 01 shows the same pattern at scale.
With the system in place I ran two prototyping experiments. In both, the prompt was short; the fidelity came from what the agent could read.
The agent read the AI Message and Composer components, pulled their variables, and generated React. Left is the Figma render; right is the code it produced, rendered live on this page from the component library.
What it got right: every colour, spacing value, radius and font size matched the Figma variable it was bound to, and the component descriptions came through as code comments. What needed me: the first preview rendered blank because it relied on a CDN, and icons were first redrawn as stand-ins because the sandbox couldn't download them. Exporting the SVGs straight from Figma fixed it.
The agent asked two questions (format and subject), read the relevant patterns (AI Summary Card, Metric Card, Build Row, Filter Bar, Workspace Action Bar), exported the real icons, and produced the page below. An automated check confirmed it uses no colour that isn't a design-system variable and no undefined token.
Live render, scaled to fit. The filter chips work. Sample data is illustrative.
Generated code that matches the design is good. Generated code that uses our components is better. So we started the codebase from the system itself.
The library is React and TypeScript with CSS Modules. Tokens are generated from the Figma variables with one command, so a colour change in Figma is one re-export away from production. Component props mirror Figma properties word for word: tone, size="extra-small", leadingIcon, selected. Hover, pressed, focused and disabled are real CSS states, just as they are variants in Figma.
Rendered live from the React library on this page. Every value comes from the generated token file.
To show the whole chain, I took part of the Share Feedback modal and generated it from the design system. Every element of the generated JSX is one of our components, chosen from its Figma counterpart, and rendered live below.
// Generated from Modal / Share Feedback, using our component library <TabList variant="pill"> <PillTab selected>All</PillTab> <PillTab>Landing Page</PillTab> … </TabList> <Select label="What is this feedback about?">…</Select> <SectionHeader tone="positive">What worked well</SectionHeader> <SectionHeader tone="improve">What can be improved</SectionHeader> <Button size="small" disabled>Submit Feedback</Button> <Button size="small" variant="ghost">Cancel</Button>
| Figma component | React component | Code Connect mapping |
|---|---|---|
| Pill tab · Selected = true | <PillTab selected> | figma/layout.figma.tsx |
| Select · Show label | <Select label=…> | figma/inputs.figma.tsx |
| Section header · Tone = Positive / Improve | <SectionHeader tone=…> | figma/layout.figma.tsx |
| Button · Style = Primary, State = Disabled | <Button disabled> | figma/actions.figma.tsx |
| Button · Style = Ghost | <Button variant="ghost"> | figma/actions.figma.tsx |
The feedback chips in this modal aren't in the first 26 coded components yet, so they're left out of the generated code rather than faked. Dev Mode will show these snippets once the mappings are published.
Code Connect tells Figma which code component each design component is. I wrote mappings for all 26 components and all 52 icons, so Dev Mode, and any AI agent reading a design, gets our real component with the right props instead of reconstructed markup.
What it changed in practice: writing the mappings forced a one-to-one vocabulary, and that audit surfaced two inconsistencies in Figma: a Secondary icon button whose icon was grey although its documentation said purple (the source confirmed purple), and descriptions still using the old size shorthand. Both are fixed.
Honest status: the mappings are written and type-checked. Publishing them needs the repository on GitHub, which is in progress.
// figma/actions.figma.tsx figma.connect(Button, FILE + "130-1123", { props: { label: figma.string("Label"), variant: figma.enum("Style", { Primary: "primary", … }), size: figma.enum("Size", { "Extra small": "extra-small", … }), leadingIcon: figma.boolean("Show leading icon", { true: figma.instance("Leading icon") }), }, example: ({ label, variant, size, leadingIcon }) => <Button variant={variant} size={size} leadingIcon={leadingIcon}>{label}</Button>, }); // What a developer (or an agent) now gets from the design: <Button variant="secondary" size="small" leadingIcon={<Icon name="plus" />}>Decide for me</Button>
I ran every test on matching pairs: the same component or screen in the original AI-built file and in the design system. The counts come straight from the Figma files.
Yes. Across the same four screens, the off-system values an AI prototype needed fixing fell from 256 to 25 (−90%), and a fresh one-sentence prototype came out with zero colours outside the system.
In AI prototyping, correction work per set of screens fell from about 4.3 hours to 25 minutes. In build effort, the six screens below need 59 fewer hand-built elements today (about 2 hours less) and 399 fewer once the patterns are coded (about 13 hours less).
Engineering hasn't consumed the system in production yet, but the system successfully generated React + TypeScript components and Code Connect mappings from Figma. That validated that the naming, token architecture and component structure were implementation-ready, and could be translated into code with minimal manual interpretation.
End-to-end delivery metrics haven't been measured yet, but design iteration speed improved immediately. Component, token and documentation changes are applied once and propagate across every screen, eliminating repetitive updates and reducing maintenance effort.
Production adoption is still in progress, but the system already generates implementation-ready React components and Code Connect mappings, demonstrating engineering readiness. More importantly, it turned screens from isolated designs into reusable system compositions, reducing maintenance overhead, improving consistency and creating a scalable foundation for AI-assisted design and development.
A fix is any value an agent receives that isn't a system token (a raw colour, size, radius or gap), or a token named after another screen, such as feedback/text-subtle on a workspace. Each one has to be corrected by hand before the prototype matches the product.
| Screen or component | Tokens · before | Tokens · after | Fixes · before | Fixes · after |
|---|---|---|---|---|
| AI Message | 5 of 13 | 13 of 13 | 8 | 0 |
| Composer | 4 of 6 | 6 of 6 | 2 | 0 |
| Build table row | 10 of 22 | 24 of 24 | 17 | 0 |
| Share Feedback modal | 102 of 255 | 261 of 286 | 229 | 25 |
| Total | 121 of 296 (41%) | 304 of 329 (92%) | 256 | 25 |
Time converts the fix count at one minute per fix: 256 minutes before, 25 after. The 25 remaining fixes are raw values inside the feedback modal's content area, the next cleanup target.
Before, there was no code library, so every visible layer had to be built as markup. With the library, each coded component is a single element. The 26 core components already cut the work; coding the patterns is where the big drop is.
| Screen | Before · no library | Today · 26 core components | Next · patterns coded |
|---|---|---|---|
| AI Message | 9 | 1 | 1 |
| Composer | 6 | 1 | 1 |
| Build table row | 16 | 10 | 1 |
| Share Feedback modal | 94 | 80 | 5 |
| Agent detail modal | 64 | 58 | 3 |
| Reimagine workspace | 223 | 203 | 2 |
| Total | 412 | 353 (−14%) | 13 (−97%) |
At two minutes per hand-built element, these six screens take about 14 hours to build without the library, under 12 hours with today's 26 components, and under 30 minutes once the patterns are coded.
Share of every template layer that comes from a design-system component instance: Conversation 95.9%, Workspaces 96.8%, Modals 88.3%.
The Workspaces templates use 82 different components, Modals 47 and Conversation 35. Change a Button once and all three follow.
26 components and 52 icons are coded and mapped back to Figma with Code Connect, with props named exactly like the Figma properties.
“The design system's semantic naming, token architecture, and documented components made code generation predictable and easier to review. Generated React closely matched intended behavior, reducing translation effort and implementation ambiguity.”Developer · Engineering team
“The system demonstrates strong design-systems thinking through scalable foundations, component governance, and clear information architecture. Naming, documentation, and tokenization significantly improve consistency, maintainability, collaboration, and future AI-readiness across products.”Product designer · Peer review
| Before | After | |
|---|---|---|
| Structure | 1 page, 1 frame, 10 sections of AI-generated UI | 36 pages: start, foundations, 17 component pages, 7 patterns, 3 templates |
| Tokens | 165 colour variables named by screen, 26 duplicated values; no spacing, radius or type tokens | 329 role-based variables in 6 collections, 57 text styles, 5 elevation styles and a focus ring |
| Components | 136, mostly copies; the composer existed three times | 158 components, 532 variants, stress-tested in every state |
| Icons | Font glyphs, not swappable | 52 icon components, swappable in every slot |
| Naming | 21.3% of layers generic ("Frame", "Vector") | 0.17% generic; full-word properties everywhere |
| Documentation | 2 of 136 components described | 210 of 210 components described; a page template for every component |
| Screens | Drawn | Assembled from live instances |
| Code | None | React + TypeScript library: 26 components, generated tokens, 52 icons |
| Design ↔ code | Hand-off by eye | Code Connect mappings for 26 components and 52 icons, ready to publish |
| Engineering readiness | Every screen re-interpreted into code by hand | Implementation-ready: React + TypeScript generated from Figma with minimal manual interpretation, confirmed by a developer |
| Design iteration | The same change repeated screen by screen | Changed once in a component, token or doc, and propagated to every screen |
| AI prototyping | 256 off-system values to fix across four screens | 25, with new prototypes coming out on-brand |
With an agent doing the making, the quality ceiling is set by how precisely I describe intent, constraints and what "done" means.
Property and token names are the interface for designers, developers and models at once. Clear names gave the biggest accuracy gains of the whole project.
AI can generate convincing screens quickly. It can't, on its own, give them a shared language. That part was design work: deciding what each thing is called, what each value means, and what the rules are.
Prompt quality barely mattered in the prototyping experiments. Descriptions, variables and real instances did.
I spent the execution time on architecture, critique and judgement rather than drawing. The taste calls, such as purple versus grey or blank versus filled, were still mine to make.
Before any production use, generating working code and mappings from Figma proved the system was implementation-ready. It gave engineering a reason to adopt it, not just a request to.
Deciding what to test, and turning every critique into a rule, is what made the system trustworthy rather than merely impressive.
The speed was the least interesting part. What surprised me was how quickly my job turned into the parts I value most: deciding how the system should be organised, noticing when something was subtly off, and explaining why. The agent was tireless and fast, but it was also confidently wrong at times, and the work only became good once I treated it like a talented junior designer who needs a clear brief and honest, specific feedback.
The moment that changed my mind was the dashboard. One sentence produced a page that used our colours, our spacing and our components, and that wasn't luck: it was the structure underneath. That's the case I'd make to any team: invest in making your system legible, and AI becomes a multiplier instead of a source of drift.
The system is validated and implementation-ready. The next phase turns readiness into production use, and the measured gains into delivery numbers.
Set up the repository, run the library in the product codebase and publish the Code Connect mappings so Dev Mode shows real components.
Cards, table rows, modal parts and workspace sections, in batches of ten. This is where hand-built elements drop by 97%.
Track sprint UI build time, component reuse in code and fixes per AI prototype, so the first production sprint confirms the gains in delivery time.