Skip to main content

Product 15 min read

Where the Rule Sits

An abstract ink field: one straight edge of light that is a wide blur on the left and narrows until it is exact, with a blue point where it turns exact. An abstract ink field: one straight edge of light that is a wide blur on the left and narrows until it is exact, with a blue point where it turns exact.

This year I built three design systems, and coding agents wrote most of the code in all three. The first belongs to Morningbrew, my coffee journal, and started in February 2026. The second, Asterisk, grew out of my job board WorkRemotely in early November. The third, Aether, followed a few weeks later for my own brand: my website, Almagest and the tool I use to share work with clients.

Between the three, the rules moved. In the first they sat in a note the agent was told to read. In the second they ran as checks on every edit. In the third each rule is written into the token the agent picks. Each move made the agents follow the system more closely, and each one changed what I spend my review time on.

The order changed with it. Morningbrew got its system along the way, while I built the product. With WorkRemotely I experimented first, and once I had found the right way, I made the system a permanent part of the product. Aether had its system before any product code existed.

In Morningbrew the rule was a note outside the repo, in Asterisk it is a check that runs after every edit, and in Aether it is the job written into the token, right where the agent picks a valueIn Morningbrew the rule was a note outside the repo, in Asterisk it is a check that runs after every edit, and in Aether it is the job written into the token, right where the agent picks a value
Where the rule sits in each system. Each step moved it closer to the moment the agent picks a value.

Morningbrew: a palette and a note

With Morningbrew I wanted a finished product, and the design system was never the focus. I prompted a lot on the frontend, made different versions of screens and fixed the layouts afterwards. For everything else I relied on Tailwind’s defaults. Back then, tweaking seemed the best way to get it right. Only when I dug deeper into design systems later did I see that I had focused on the product and too little on design craft. The code shows where that left the quality.

Morningbrew runs on Next.js and Tailwind. Its colours live in one CSS file: eight scales and a semantic layer on top, with names like --text-primary and --bg-raised. The rules lived in a note in my vault, and the agent instructions said to read it when working with colours or spacing.

There was no Button component, no Input, no Dialog and no type scale. An agent writes the most likely next thing, so where the system had a gap, it filled it with something that looked right for that one screen. Today the app has 221 <button> elements, and the shared button classes appear 17 times. A raw palette class like border-indigo-500 appears 818 times, and text-[11px] 55 times. Five dialogs are each built by hand. Every one of those was a reasonable choice when it was written.

None of this failed. In July I ran an audit and found that much of the theme had never worked. A placeholder colour class used 84 times compiled to nothing, because Tailwind drops a class it doesn’t know without a word. The agent had written names that fit the pattern, and nothing checked whether they existed. Dark mode had a similar hole: Tailwind’s dark: variant followed the operating system while the app followed its own toggle, so for anyone whose two settings differed, 22 colour pairs came out inverted. A script that draws the journal’s share images kept its own copy of the theme, and that copy had drifted. So had the note: it still described a Tailwind config the app no longer had. For an agent, a rule that nothing checks is a suggestion.

At the time Morningbrew also ran on ten project agents, each with a persona and “Mandatory” sections. That looked thorough. In practice the copies drifted between repos, the references to my notes broke, and newer models took every “always” literally, so a one-line fix ran the full checklist. Design work also fits a subagent badly, because it is a conversation and a subagent returns one report. I cut the set down to one test agent and moved design, copy and research into skills that run in the main session.

Asterisk: the rule moves into the loop

WorkRemotely launched in October with styling done by eye. For four weeks I corrected it one round at a time: “does not need to stand out”, “either break it or use the same rhythm”. Each correction fixed one screen, and the next screen needed the same correction again.

After the launch the product was mature enough for a deliberate pause. I needed time anyway to gather data and ideas for the next steps, so I put that time into a shared system. The goal was a system the agents could keep without me.

Most of it came together in a single day. I removed Tailwind’s built-in palette, so bg-indigo-500 no longer exists to reach for. Every token got a name that says what it colours and what for. text-subtle and bg-subtle are two different tokens, and there is no bg-link, so an agent can’t put the link colour on a background by accident. The first round had names like fg and line. They said little, any of them worked on any property, and they were gone within the week.

A step number became a job. In every scale, step 6 is a control’s edge at 3:1 contrast and step 7 is the lightest grey that still carries words, at 4.5:1. A token points at a step once, and dark mode swaps the scale underneath. About 170 dark mode overrides became eight, and the step carries the contrast promise.

The nine steps of every Asterisk colour scale, each with one job: steps 1 to 3 are backgrounds, 4 to 6 lines and shapes with a control's edge at 3:1, and 7 to 9 carry words, starting at 4.5:1The nine steps of every Asterisk colour scale, each with one job: steps 1 to 3 are backgrounds, 4 to 6 lines and shapes with a control's edge at 3:1, and 7 to 9 carry words, starting at 4.5:1
The nine steps of every colour scale in Asterisk, each with one job.

The same day Storybook got 333 stories and a guide for each of 33 components, all in one shape: what it’s for, when not to use it, variants with “pick it for”, keyboard, content, accessibility, and a do and don’t drawn with the real components. The “when not to use it” line does real work. A chip that runs an action should be a button, the chip’s guide says so in one sentence, and one of the review agent’s test cases checks exactly that. The patterns section went from 24 entries to 7, once I saw that 17 of them were components. A pattern now describes a moment in someone’s visit, such as an empty list, an error or a form.

The hooks came next. After every edit, a token check runs and sends any failure straight back to the agent, so it fixes the mistake in the same turn, before I see it. The check also catches typos in class names, the same silent drop that hid Morningbrew’s broken classes.

Before a pull request, a second hook refuses to open it until a review agent has read the diff against the guides. It refuses instead of adding a reminder, because a reminder would arrive after the pull request already exists. The review agent’s instructions hold the rule I’d now put in any setup: “Read the guide of every component you check, every time; never work from memory.” It reports in a table, with the place, what’s wrong, the rule it breaks and a fix, and it keeps a memory of the exceptions I approved.

Later I added a check that reads the code’s syntax tree and refuses a raw <button>, <input> or dialog outside the component folder. The ten exceptions each carry a written reason. The review agent got its own test set: five small diffs with known answers. Its first run passed four of five cases and cost $1.21. In the case it failed, it had also flagged that the new component had no story. The agent was right, so the test now allows that finding.

Figma moved downstream. After I signed off one spec sheet, five agents built the remaining 21 components with 206 variants in one day, from the code. They cut borders with clipped frames and set headlines in the wrong font. I found those in review, and the lessons went into the skill the agents use for Figma.

Figma now has a different job: it is where ideas start. I no longer maintain a library by hand the way I did for years; the agents rebuild it from the code after each merge.

From then on, everything I reviewed had already passed the checks.

After every edit the token and component check runs and a failure goes straight back to the agent; a pull request opens only once the review agent has read the diff against the guides; blocking CI comes before the merge, and Figma is rebuilt after itAfter every edit the token and component check runs and a failure goes straight back to the agent; a pull request opens only once the review agent has read the diff against the guides; blocking CI comes before the merge, and Figma is rebuilt after it
The two checks in Asterisk’s loop: one after every edit, one before every pull request.

What didn’t hold

I set an accessibility check to fail on every story, and removed it the same day. It flagged text in the middle of a scroll fade that stayed readable, and there was no way to tell it so. Since then, contrast and keyboard in Asterisk are checked by hand, which means they are checked less.

One agent run took 250 tool calls. Every agent now has a turn limit in its settings. A run that reaches it stops and returns what it has, marked as partial.

The first Figma rule said to update the library “in the same piece of work”. That sent agents into Figma while I was still trying versions. The rule changed: Figma gets updated only after the merge, once a design has settled.

The names kept changing. neutral became ink, five greys became three, three corner names became one. Each rename was cheap for the agents, and every guide and story had to follow it.

Aether: the rule moves into the token

Aether is the system I’d have built if I had known all of this in February. It is for my own brand, which has different needs from a job board: a dense layer for apps like Almagest and a roomier one for my website. This time the system came first: the repo holds tokens, components, tests and mock pages for the products that will use it, and no product code. Its first commit already had 84 files and 13,094 lines, because the decisions had been made in Morningbrew’s debt and in Asterisk’s rounds.

Its master is one file, tokens.json. Each of its 76 functional colour and shadow tokens carries a description of its job. The one for fgColor-subtle reads: “Second text: descriptions, navigation, the lead under a heading. Quieter than fgColor-default, stronger than fgColor-muted. At least 7:1.” The build writes the CSS from that file, and it writes a 98-line AGENTS.md with the rules and every token with its job. A test fails when the checked-in file differs from what the build would write. The description sits next to the value, so the agent reads it at the moment it picks a token, and it changes whenever the value does.

tokens.json, where every token carries its job, goes through the token build into tokens.css for the components and AGENTS.md for the coding agent, with Figma variables planned; tests fail the run when a generated file is out of date or a component breaks a ruletokens.json, where every token carries its job, goes through the token build into tokens.css for the components and AGENTS.md for the coding agent, with Figma variables planned; tests fail the run when a generated file is out of date or a component breaks a rule
In Aether one file writes everything else, and the tests fail the run when anything drifts.

Before naming anything, I had the naming of 11 design systems researched, from Primer and Atlassian to Material and GOV.UK. Aether took Primer’s vocabulary because it is the most widely read, and Atlassian’s rule for adding tokens: mirror an existing one before inventing a new one. Primary, secondary and tertiary are gone everywhere except buttons. An ordinal says only an order, and an agent needs the job.

Most of what’s left in Aether is tests. The decision log gives the reason in one line: “A rule the tests enforce holds without anyone having to remember it.” 70 contract cases compare what React writes with a reference HTML, so React, Astro and plain templates all produce the same markup. A list of components without a case yet may only get shorter. A generator solves the palette for a contrast target, and a test checks every contrast the system promises, in both themes. Every story runs through an accessibility check and a screenshot comparison against 353 references, in light and dark, and the accessibility check fails the run again.

The research also settled what Aether can do without. A small JSON file and a short generated rules file are enough for a system this size, so there is no server that answers questions about the tokens and no long design document.

Aether has gaps. It has no real user yet, only mock pages. The repos that will use it have none of Asterisk’s checks so far, so an agent working on my website can still write a raw colour, the same way it did in Morningbrew.

What it changed for me

I spend less time getting each screen right and more time writing down what right means, precisely enough that a machine can check it. The taste is still mine, and it now sits in rules the agents can fail.

My corrections have moved to the details. A broken layout or a wrong token rarely gets to me any more. I’d rather have the agents generate several ideas, look at them side by side and pick what’s good for the job and for the person using it.

Do

  1. Write the rule where the agent picks the value. A description on the token, generated into the agent’s rules file, reaches the agent at the moment of choice. A note somewhere else drifts.
  2. Remove the wrong option. Delete the framework’s palette and its arbitrary values. An agent can’t pick a class that doesn’t exist.
  3. Name tokens by property and job. text-subtle, bg-surface, border-control. Let a step number carry a promise, such as text at 4.5:1. Keep ordinals for buttons.
  4. Give feedback in the same turn. Run the checks after every edit and send failures back to the agent. A mistake fixed in the turn it was made never reaches review.
  5. Hold the pull request until the review has run. A hook that refuses to open it is what makes the review happen.
  6. Build the components before the features. Then refuse hand-built buttons, inputs and dialogs outside the component folder. Write down the reason for each exception.
  7. Write “when not to use it” into every guide. It is the line that keeps an agent from using a chip as a button.
  8. Make the reviewer read the guide every time, and test the reviewer. Five cases with known answers show whether a prompt change made it better or worse.
  9. Turn every correction into a rule the same day. Put it in a token, a guide, a test or the skill the agents use. A lesson that stays in the chat comes back.
  10. Compare versions on one page. Six versions side by side settled WorkRemotely’s reposted mark and its pay format at a glance each.
  11. Let Figma be the place for ideas. Sketch and explore there, and let the agents rebuild the library from the code after each merge, so nobody maintains it by hand.

Don’t

  1. Don’t treat the framework’s defaults as your design system. Tailwind gave Morningbrew a palette, a spacing scale and corner radii on day one. That made it easy to skip deciding what each one was for, and the app ended up with four radii in heavy use.
  2. Don’t keep the rules outside the repo. Morningbrew’s note was right in February and wrong by July, and nothing noticed.
  3. Don’t govern with capitals. “Mandatory” and “always” make a model run the full ritual on a one-line fix. A short rules file and tests do more.
  4. Don’t trust a framework that fails silently. Check every class name against the token list.
  5. Don’t keep a second copy of the theme. Share images, emails and maps read the same tokens, or they drift.
  6. Don’t keep a check that fails on things nobody can fix. It gets switched off, and then nothing checks. Change what the check reads until it can pass.
  7. Don’t sync Figma while a design is still moving.
  8. Don’t run agents without limits. A turn limit and a cost cap belong in the settings.
  9. Don’t hand design conversations to a subagent. It runs alone and returns one report. Checks suit a subagent; design and copy belong in the main session, where the conversation is.
  10. Don’t stop at the system’s border. Every repo that uses the system needs the checks too.

If I started today

Day one
Three to five qualities, ranked, each with a test question, a handful of principles short enough to test, and a dated decision log.
First days
One tokens file as the master, with a description per functional token. The build writes the CSS and the agent rules file, and the framework’s defaults are gone.
First week
The components before any feature (button, input, dialog, menu, the page shell), each with its guide, its reference HTML and its tests.
Second week
The checks in every repo that uses the system, after each edit, before each pull request and blocking in CI. Then a review agent with a small test set.
From then on
Figma generated from the tokens after each merge, and one real page on the system as early as possible. Mock pages can’t show what a real user finds.

What I’d skip: Figma as the master, a long design document outside the repo, and a crew of persona agents.

Morningbrew is resting while I focus on WorkRemotely. When I pick it up again, it gets everything in this piece, and Asterisk gets what Aether added since.

Asterisk is public at workremotely.eu/asterisk, with every guide and story.

Back to Articles