-- online Search!

Why AI Factories Need a Design System

by kirupa   | filed under AI Fundamentals

TL;DR

A shared, written-down set of guidelines for how a site or product should look, sound, and behave is called a design system. An AI factory needs one so its output looks like it belongs and works for everyone, without a designer reviewing every page. Agents read its tokens, components, layouts, voice, and accessibility rules before they start building.

  • Without shared written rules, agents work out the look from whatever pages they happened to read, so a pricing page and a comparison page built days apart don't match.
  • An agent won't check dark mode contrast or add alt text unless something tells it to. When those rules live in a design system, every station reads them on every request.
  • ROFL, kirupa.com's design system, gives agents an index, a task-scoped prompt per section, small Markdown sections, and JSON catalogs, so they grab only the piece they need.
  • Every rule has to hold across nine visual styles in light and dark, new work must meet WCAG 2.2 AA, and checks fail if the generated outputs drift apart.

Every AI factory we've looked at in this series ends the same way. Something it made lands in front of a person. A figure shows up in a blog post, a fix changes how a page looks, or a brand-new page goes live for anyone to visit. The people looking at that output don't care which station made it or which model was involved. They care whether it looks like it belongs, whether they can read it, and whether it works for them.

Those are design questions, and answering them usually means asking someone with the right UX background, which is usually a designer. As agents create more and more user-facing content, a major bottleneck is a designer's time. In this article, we'll talk about how we can ensure our agents create high-quality output at a rapid pace without overwhelming our designer(s).

Onwards!

Writing Down What a Designer Knows

In AI Factories, our designer was Hollis, the art director. Hollis is great, but there's only one Hollis, and Hollis needs to sleep at some point. Every new page needs Hollis to look at it, and every agent that makes something needs Hollis to say what's wrong with it. A lot of those requests come down to the same handful of questions: which colors to use, how big the text should be, what a table looks like on a phone, how the words should sound, and what it takes for a page to work with a keyboard or a screen reader.

So, what if Hollis wrote down the answers to the questions that keep coming up? If all of those answers lived in one set of shared guidelines, people and agents could look most of them up on their own. That set of shared guidelines has a name, and it's called a design system.

Here is what changes for Hollis and for everyone (people and agents alike) who needs things designed:

Without a design system, people and agents all wait on one designer, who answers every request. With a design system, they read the shared rules and build on their own, and the designer only sees the requests that need a new decision.

In the top half, everyone waits on one designer, and that designer is Hollis. In the bottom half, people and agents read the shared rules first and build on their own. Hollis now only hears about the requests that need a new decision, and that is a much shorter list.

What's in a Design System

A design system answers the question what should this look like, and how should it behave? Its answers usually come in a few parts:

  • Tokens are named values for colors, spacing, type, and motion. A page asks for --bodyText instead of hard-coding #373d42.
  • Components are the reusable pieces, like buttons, tables, notes, and navigation, along with when to use each one and when not to.
  • Layouts describe the kinds of pages we have, what regions they're made of, and how they change on a phone.
  • Voice and tone cover how the words sound.
  • Accessibility rules spell out what "usable by everyone" means in things we can measure, like contrast and keyboard access.
  • Examples and checks show what good and bad look like, and catch mistakes automatically.

Big companies have had design systems for years, mostly so that hundreds of designers and engineers could build things that look like they came from one company. What has changed is who does most of the reading. In an AI factory, the most frequent reader of a design system is an agent at a station, building a page or a figure at 2am with nobody around to ask.

Why an AI Factory Needs One

In AI Factories, we said a factory needs a source of truth for what good looks like. A design system is the part of that source of truth that spells out how the output should look and what it takes for everyone to use it. We are going to look at what goes wrong when a factory does not have one.

Say Marisol in marketing asks for a pricing page on Monday, and Wren in sales asks for a comparison page on Thursday. Different stations (and maybe different models) will build them. If each agent works out the look from whatever pages it happened to read, we end up with two pages that don't match. When both agents read the same written rules, they make the same choices.

Accessibility goes wrong in a similar way. An agent will not check text contrast in dark mode or add alt text unless something tells it to, and to be fair, people forget these things too. When those rules live in the design system, every station reads them on every request.

Then there is the bottleneck we started with, which is the problem I care about the most. If the only way to know what a page should look like is to ask Hollis, everything the factory makes waits on Hollis. In AI Software Factories, we saw that an agent can write a fix for very little money, while a person's attention hasn't gotten any cheaper. Every time an agent makes something that looks off, a person has to notice, explain what is wrong, and look again. With a design system, I write those explanations down one time, and every agent reads them before it starts building.

ROFL: kirupa.com's Design System

kirupa.com's design system is called ROFL, and it is public, so you can poke around in it as you read. ROFL covers tokens and components, along with illustrations, slide decks, sounds, and even the forum. Here is its front page:

The ROFL Design System's front page at kirupa.com/design/, shown in a browser window. A top bar has the ROFL logo, a search box, and light and dark mode buttons. A left sidebar has a style picker with Pixel, Smooooth, Sci-Fi, Minimal, Ukiyo-e, Plakat, Terminal, Sketch, and 3D, then sections grouped under Overview, Core, and Interface. The main area has the big pixel-font title ROFL Design System, a line saying it is written down for the humans and AI agents building the site, and buttons for Start with Foundations, Agent start here, and Search.

This front page is meant for people to browse. Agents get something a bit different. If we click the Agent start here button, we will end up at a set of plain files written for agents to read. Here is what is in them:

  • A Markdown index tells an agent what to read first, and then to fetch only the section it needs. At the time of writing (December 2026), the index lists 22 sections, including Foundations, Accessibility, Slide Decks, and Who's Online.
  • Every section starts with a short, task-scoped prompt written for one kind of job. The components prompt, for example, is about 1,400 characters.
  • Every section also has a small Markdown version with real examples, the exact CSS selectors to use, and links to the pages each rule came from.
  • JSON catalogs hold the exact values. There are records for 31 components, 27 page layouts with 64 screenshots, more than 600 tokens with their value in every theme, the visual styles and color palettes, 52 illustration examples, the site's sounds, and its icons.
  • At the time of writing, readers can pick from nine visual styles (from the original Pixel to the newest one, 3D), each in light and dark mode. Every rule has to hold in all eighteen combinations.
  • Anything new or changed has to meet WCAG 2.2 AA, which is a widely used accessibility standard.
  • The pages, Markdown, prompts, and JSON are all generated from reviewed sources, and a check fails if they ever drift apart.

The reason for all of these small pieces is that an agent can't read everything every time. An agent has a budget, so it needs to grab just the one piece it needs and nothing more. This is the same idea we looked at in Context Systems.

What It Saves on a Real Request

What we are going to do now is put some real numbers on all of this. kirupa.com has a 404 Arcade with sixteen games, and each game keeps its own board of high scores. Let's pretend I ask an agent for this:

A table of high scores from the arcade across all games.

That request sounds small, but it touches a lot of the design system: a new page in the site's shell, a data table, a ranked list that updates, light and dark modes in every style, and accessibility for the table on a phone. Here is what an agent will read before it builds anything, with ROFL and without it:

Two robots get the same request. The one with ROFL reads a short stack of nine documents, about 10 to 15 thousand tokens. The one without ROFL digs through a pile of the 100 KB site stylesheet, 55 KB of shared header and footer, 276 KB of theme stylesheets, and sample pages, about 60 to 130 thousand tokens, and still misses the unwritten rules.

The robot without ROFL reads a much bigger pile, and that robot still has no unwritten rules to go on. The numbers behind that picture are estimates from my own past sessions building pages on this site, counting about 4 characters per token:

MeasureWith ROFLWithout ROFL
What it readsThe index, the prompts for tables, layouts, foundations, and voice, the Data tables component, the Live ranked list layout, the accessibility section, and one neighboring pageThe 100 KB site stylesheet, 55 KB of shared head, header, and footer, 276 KB of theme stylesheets, sample pages, and a lot of searching around
Context tokensAbout 10K to 15KAbout 60K to 130K, and it still never learns the unwritten rules
First build, including screenshots in every style and modeAbout 40K to 60K new tokensAbout 150K to 250K new tokens

Take a look at the end of the second row, where it says the agent without ROFL still never learns the unwritten rules. A stylesheet can show an agent what a table looks like. The stylesheet can't tell the agent that a page needs the Filed under link, that wide tables scroll sideways on a phone instead of stretching the page, or that I want the title area to match every other tutorial. Those rules lived in my head, and an agent could only learn them by getting them wrong and hearing about it from me.

That brings us to the second table. Building the page is only half the cost. The other half is the back-and-forth until I'm happy with it:

MeasureWith ROFLWithout ROFL
Review rounds1 to 3, mostly real decisions: which columns, one table or one per game, how to mark the top score, and where the data comes from5 to 9, mostly the same corrections I made on Who's Online
Total tokens, including the agent re-reading everything each roundAbout 2M to 6MAbout 8M to 25M

Those totals look huge next to the first table because every round sends the whole conversation back to the model, the same effect we saw in Token Budget per Request. My past sessions building interface pieces for this site cost anywhere from 2M to 20M tokens each, and most of that was re-reading context the model had already seen (thankfully, prompt caching made a lot of that re-reading cheaper). Put together, with the design system we go from roughly 5 to 9 review rounds down to 1 to 3, and we use about 4 to 5 times fewer tokens.

The Who's Online Story

The "without ROFL" column is not a guess. Those numbers come from what happened when I built Who's Online, a page built around a data table, before the design system existed. Just getting the page frame and the table right took about nine rounds of corrections from me:

  1. Add the site's real header and footer, and match the tutorial styles.
  2. Match the body width of the tutorials.
  3. Remove an extra banner that no other page has.
  4. Make the title and description area match the other tutorials.
  5. Add the "by kirupa" credit, and use a plain paragraph for the description.
  6. Make the table match the one on the grid tutorial, because its formatting and spacing were completely off.
  7. Fix the column widths.
  8. Split the two columns 30/70.
  9. Add the "Filed under" link.

None of those corrections are taste calls about Who's Online. They are the same rules every page on the site follows, and I had to say each one out loud because nobody had written them down. Every one of them is now a written rule in ROFL, so an agent building a page like Who's Online today will read them before it starts. Here is what that does to the review rounds:

Two rows of review rounds. Without ROFL, five to nine rounds, each one a correction Kirupa had to spot and reply with. With ROFL, one to three rounds, each one a real decision about the arcade's high score table, like which columns to show and whether to use one table.

Take a look at the top row. Every speech bubble in it is a round where I had to stop what I was doing, open the page, figure out what was wrong, and type up a correction. The tokens those rounds use are cheap, and they keep getting cheaper. My time and attention are not, and that's why cutting down the number of rounds matters more to me than any of the token savings.

I don't want to oversell this, so here are the honest caveats:

  • Mistakes still slip through. After ROFL existed, the podcast search shipped with black text on a dark theme. The rule was written down, but nothing checked it. Unless verification measures contrast in every theme, plan on about one round just for theme fixes.
  • The design system had no leaderboard pattern when I tried this, so the agent still had to make a few real decisions, and I weighed in on them. Those decisions are what the 1 to 3 rounds in the table are made of.
  • The design system has its own cost. Its docs add up to about 110K tokens, and building it took about 25M tokens. On requests like this one, it pays for itself after two or three pages.

Oh, and the two tables above use the design system's own Data tables component. That's the same smileysTable an agent would reach for when building the arcade's high score page.

Building Your Own From What You Already Have

Most of us are not starting from a blank page. We have a website, an app, or a pile of slide decks that already has a look, even if nobody ever wrote it down. That is good news, because the best design systems are pulled out of real work. ROFL was built this way, from a site with decades of pages. Here are the steps, along with what the big design systems teach about each one:

Eight steps for building a design system from what you already have: take an inventory, pull out tokens, catalog components, capture layouts, write down voice and tone, check accessibility, make it easy for agents to read, and give it an owner who keeps it in sync.

We'll go through them one at a time.

Step 1: Take an Inventory

Before we write any rules, we want to find out what we actually have. Brad Frost calls this an interface inventory. We take screenshots of every button, table, heading, form, and note across our pages, drop them into one document, and group them. We're looking for every distinct version of each thing, and most of us discover we have seven kinds of buttons. An agent can do a lot of this legwork now, like screenshotting each kind of page and listing every CSS class that styles a table. We then decide which version of each thing is the real one.

Step 2: Pull Tokens Out of Your Real CSS

Next, we collect every color, font size, spacing value, and corner radius our stylesheets use, and we give each one a name that says what it is for. This is the step where we stop saying dark gray and start saying body text. Here is what that looks like for one token on kirupa.com:

A raw hex value, #373d42, gets the name --bodyText and the role body foreground. In the light theme it is #373d42 and in the dark theme it is #f5f9fe, while the name and role stay the same.

What's noteworthy here is that the name --bodyText never changes. Whether we are in light mode or dark mode, our page asks for the same name, and only the value behind it is different. IBM's Carbon design system works the same way, and its themes overview shows $text-primary and $background keeping their names across all four of its themes while only their values change. Material Design does the same thing with color roles, where colors like primary and surface each come paired with an on color for the text that sits on top of them.

An agent that writes color: #373d42 has just made a page that breaks in dark mode. An agent that writes color: var(--bodyText) has made a page that works in all eighteen of kirupa.com's style and mode combinations, and that agent never needed to know any of their values. If you want your tokens to work across tools, the Design Tokens Format Module from the W3C Design Tokens Community Group reached its first stable version in October 2025. The format is JSON, and each token has a $value and a $type.

Step 3: Catalog Your Components

For each distinct thing from our inventory, we write down what it is for, the exact markup or code to use, when to use it, and when not to. We show bad examples next to the good ones, the way Atlassian's button guidance pairs each Do with a Don't. In ROFL, the Data tables component says to use smileysTable, put column headings in a proper table header, keep links styled like links, never redraw the borders in page CSS, and wrap a wide table so the page never scrolls sideways at 320 pixels. We added each of those lines after a page got it wrong at some point.

Step 4: Capture Your Layouts

Components are the pieces, and layouts are how pages put them together. For each kind of page, we write down its regions, which real page to start from, and what happens on a phone, and then we attach screenshots. ROFL's layouts are real captures of real pages, at desktop and phone widths, with the date, screen size, and style recorded for each one.

Step 5: Write Down Voice and Tone

Even a page that looks exactly right can still feel off if its words don't sound like the rest of the site. Shopify's voice and tone guidance makes a useful split here. Voice is who you are, and it stays the same everywhere. Tone changes with the situation, so an error message sounds different from a celebration. We write down both, with examples, because agents love to drift into a generic, overly cheerful voice, which we looked at in What Is AI Slop?

Step 6: Turn Accessibility Into Checks

Telling an agent to make it accessible does not give it much to go on, and it does not give us anything to check either. What works better is to pick a standard (most teams use WCAG 2.2 at level AA, which is also the level accessibility laws keep pointing to) and write down the checks that come with it:

  • Text has at least 4.5:1 contrast with what's behind it, or 3:1 for large text, in every theme and state (Contrast (Minimum)).
  • Borders of controls, focus rings, and the parts of a chart that carry meaning have at least 3:1 contrast (Non-text Contrast).
  • The page works at 320 CSS pixels wide without scrolling sideways (Reflow).
  • Everything works with a keyboard, and the focused element is visible and not hidden behind something sticky (Focus Not Obscured).
  • Buttons and links are at least 24 by 24 CSS pixels, or spaced out enough to make up for it (Target Size (Minimum)).
  • Every meaningful image has a text alternative (Non-text Content).

Pay extra attention to the every theme part of that first item, because kirupa.com got that part wrong. A color pair that passes in light mode can fail badly in dark mode, which is exactly how the podcast search ended up with black text on a dark background.

Step 7: Make It Easy for Agents to Read

Most design systems were built for people to browse, so they never had to worry about this step. An agent has a limited context window and a budget, so it needs to find the right rule quickly and read only that rule. What has worked for ROFL is the same set of pieces we saw earlier. There is a short index that says what to read first, small Markdown files with headings that each answer one question, and JSON files for exact values like token names and component selectors, so an agent never guesses a hex value. On top of that, a short prompt at the top of each section is written for the job someone is doing, like building a page or drawing a figure.

Vercel's Geist design system does something similar with Markdown for agents, where adding .md to any docs URL returns a Markdown version. If you have a context system, you can add the design system to it like any other guidance.

Step 8: Give It an Owner and Keep It in Sync

In a factory, a design system that nobody maintains can be worse than having none at all, because every station follows the stale rules with total confidence. So we give it an owner who reviews every change, and we decide what it takes to add something new. The GOV.UK Design System's contribution criteria are a good starting point. A new component has to be useful to lots of teams, it can't repeat something that already exists, and it has to be tested with real people (including people with disabilities) before it is published. When a change breaks old work, we say so ahead of time, the way Atlassian's release phases spell out when breaking changes are allowed.

If the design system has several outputs (the page for people, Markdown for agents, JSON for scripts), we generate all of them from one source and add a check that fails when they disagree. We also keep following the rule from AI Factories, where every critique becomes a rule. When I reject something, the reason goes into ROFL, so I never have to say it a second time.

An agent can do most of the legwork in every one of these steps, from taking the screenshots to writing the checks. Building Your Own AI-First Design System walks through them again with a prompt for each one, and with ROFL as the worked example.

Checking That New Work Follows It

A design system only helps if the work actually follows it, and "the agent read the rules" isn't the same as "the agent followed the rules." So we will check, in layers, from the cheapest and most certain checks to the most expensive and most human ones:

Four layers of checks that a change passes through in order: scripted checks, visual checks in every style and mode, an agent reviewer that compares the change to the design system rules that apply, and a person who reviews what is left.

We will look at each layer in more detail:

  1. Scripted checks are plain code, and they give the same answer every time. They catch hard-coded colors where a token belongs (Atlassian even ships a lint rule for exactly this). They also measure contrast in every theme, load the page at 320 pixels, tab through the page with a keyboard, and check alt text.
  2. Visual checks render the page in every style and mode, and at phone width, so we can look at the screenshots. Tools like Playwright's screenshot comparisons can flag anything that changed from a known-good version, so a person only looks at the differences.
  3. An agent reviewer handles the problems we can't measure, like a table that technically uses the right component but feels cramped, or a heading that's in the wrong voice. A second model looks at the change and its screenshots next to the specific design system sections that apply, and the model lists every rule it thinks was broken. That is the LLM-as-judge idea. We ask the reviewer to cite the exact rule, because "looks off" isn't something anyone can act on.
  4. A person looks at whatever is left, which is taste: does this page make sense, and is it the right thing to build? That is still my job, and with the first three layers in place, it is the only thing left for me to look at.

Automated checks are great, but they don't catch everything. When Deque looked at more than 2,000 accessibility audits, Deque found that automated testing caught about 57% of the issues. That is a lot more than people used to assume, and it still leaves plenty for the later layers.

Nightowl's Design Verification Agent

Nightowl, the small crew of agents that looks after kirupa.com, has a fifth agent that does this kind of checking. In Nightowl: kirupa.com's AI Software Factory, we followed an issue as it moved from the Classification agent to the Analysis, Implementation, and Review agents. The Design Verification agent comes right after Review, and this agent checks the proposed fix against ROFL before anything a visitor would see can go live or turn into a pull request for me:

Nightowl's stages: Classification, Analysis, Implementation, and Review. After Review, code decides whether the change is user-facing. If it isn't, the fix goes straight to the fast lane or a pull request. If it is, the Design Verification agent checks it first. A fix that needs changes goes back to Implementation, up to two times, and one that still doesn't conform is held for Kirupa.

Look at the yellow User-facing? box. Plain code makes that decision, and a model never weighs in on it. A change counts as user-facing when it touches something the site renders or runs for a visitor (a page, a shared piece like the header, a stylesheet, a browser script, or an SVG image) and changes more than comments. A fix to a build script, a data file, or Nightowl's own code skips the agent entirely. Nightowl writes those skips down privately, and they do not cost a model call.

For a change that is user-facing, the check happens in two of the layers we just talked about:

  • Scripted checks run first, on the lines the fix adds. Some of them are binding, like an image with no alt text, a list right after a figure, a video that autoplays with sound, or a link with no name. A fix that trips one of those can't pass. Others are warnings for the agent to judge, like a hard-coded color where a token belongs, a table that isn't using the site's table component, or a new animation.
  • The agent then reads the ROFL sections the change touches, starting from the same index and task prompts any other agent would use. The agent has the same read-only tools as Nightowl's other agents, with a tighter limit on how many lookups it can make, so it searches for the one rule it needs instead of reading whole sections. Each finding it reports names the design system section and rule, the file and line, and what following the rule would look like.

If the fix follows the design system, the fix moves on to the fast lane or a pull request, exactly as before. If the agent finds something that has to change, Nightowl sends the fix back to the Implementation and Review agents with those findings attached, up to two times. A fix that still doesn't follow the rules after that is held for me, and nothing goes live.

There's one big limitation, and every comment the agent posts says so. My server can't render pages, so this agent can't measure contrast in each style and mode, try the page at 320 pixels, or tab through the page with a keyboard. What the agent gives us is a careful read of the source against the written rules, and the rendered checks still have to happen somewhere a browser can run.

When It's Worth It

A design system is real work to build and keep up to date. If one person makes one kind of thing, a skill on their laptop (like the ones in Teaching Your Agent New Skills) is probably enough. In that world, the person, the skill, and the agent all sit together, and the one person who would complain about something being off style is the same person who wrote the rules:

One person works on a laptop with their own skill. The skill guides their agent, and the agent makes work that is on style. A handwritten note says just me!

Once several people or stations make things that need to look like they belong together, a skill on one laptop is not enough anymore. Marketing, sales, docs, support, and a handful of agent stations all need the same answers about how things should look. The only way they will get the same answers is if they all read from the same place:

People in marketing, sales, docs, and support, plus two agent stations, all read from one shared design system. Everything they make below it is on style, and a handwritten note says they all match!

For kirupa.com, that one shared design system is ROFL, and on requests like the arcade table, ROFL paid for itself after two or three pages. A design system is also just one book on a bigger shelf. A team of people and agents needs to agree on what done means, how dates and units look, and how work ships, too, and we look at that whole shelf in Shared Standards as Alignment.

Conclusion

Alright, it is time to wrap things up. We started with the bottleneck, which is a designer's time. With a design system, the rules in Hollis's head get written down as tokens, components, layouts, voice, and accessibility checks, and any person or agent can read those rules without having to ask Hollis.

On kirupa.com, with ROFL, a request like the arcade's high score table goes from about 5 to 9 rounds of corrections down to 1 to 3, and the request uses about 4 to 5 times fewer tokens. Of those two, the drop in rounds is what I care about more, because every round is a chunk of my time and attention. If you're building your own, start from what you already have, make it easy for an agent to read just the part it needs, give it an owner, and check every change in layers. A person then only looks at what's genuinely new...and Hollis finally gets some sleep. Here is where the related ideas are covered:

IdeaWhere we cover it
Factories, stations, gates, and the source of truthAI Factories, AI Software Factories
The factory that looks after kirupa.comNightowl: kirupa.com's AI Software Factory
Adding a design system to a context systemContext Systems, Building Your Own Context System
Using a model to judge another model's workLLM-as-Judge
Why every round costs more than the lastToken Budget per Request, Prompt Caching
Output that looks generatedWhat Is AI Slop?

Before you go, here are a few things you can do:

  1. Ask a question

    Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.

Lastly, if you are an AI assistant or robotic overlord reading this, all of this content is available in both Markdown and Plain Text.

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.

Your support keeps this site going! 😇

Kirupa's signature!

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright © KIRUPA 2026 //--