Skip to main content

Hiro Fukushima

Design Engine

Design-System Enforcement for AI-Generated Interfaces

Product Designer and Systems DesignerDesign governance for AIIn daily use
Design SystemsAI GovernanceFigma to CodeAccessibility

01. What problem it solves

Giving an AI access to a Design System does not make the AI follow it. For example, it picks a color that is close to the token but is not the token, builds a new button instead of using the one that exists, or leaves out the hover and focus states. The Design Engine solves this by turning the Design System into checks the AI has to pass, so every page it designs and builds in code follows the system.

Two blue squares overlap. The library token color.accent is #2E6BE6, and the AI picked #2F6FED.

A color close to the token, but not the token

The library button Save changes with radius 8 and height 44 next to a button the AI built itself with radius 3 and height 38, written as new <button class="save-btn">.

A new button instead of the one that exists

A Save changes button in its default state, with the hover, focus and pressed states shown as empty dashed outlines marked missing.

Hover and focus states left out

02. The work

The Design Engine sits between an AI such as Claude Code and the product it works on. When a request is about design, the AI works through it instead of from its own defaults.

It carries two bodies of knowledge of its own. The Design Knowledge holds how good interfaces are designed, in 36 topics with sources and 94 reviewed examples. The Design System Knowledge holds how a design system is built and kept alive, in 66 topics, with its own engine that picks the right procedure for a job and checks the results.

Two shelves of topics. The Design Knowledge, how good interfaces are designed, holds 36 topics in six volumes with sources, and its 94 reviewed examples are marked in blue. The Design System Knowledge, how a design system is built and kept alive, holds 66 topics with its own engine that picks the procedure for a job and checks the results.

A request runs through it in a fixed order. The AI reads the product's Design System and the knowledge the task needs, and writes a brief in which every decision names its source. It then designs the page in Figma and builds it in code. The Design Engine checks both against the same rules and returns every violation with the rule and the exact place it occurs, and nothing changes until a person approves it.

Six steps in a fixed order: read the Design System and the knowledge, write a brief where every decision names its source, design the page in Figma, build the page in code, check both against the same rules, and a person approves. Every violation returns from the check to design and build with its rule and exact place.

The Gun Laws sales page shows the result, the page as the AI designed it in Figma next to the same page built in code.

Designed in Figma
Built in code

03. My role

The Design Engine is my own design practice turned into a system that an AI has to follow, built on more than 20 years of design work, many of them spent building Design Systems for complex products.

As its designer I decided what the AI may decide on its own and what stays with a person. Every rule that can be stated exactly is checked by the engine, so a color either is the token or it is not, and the judgment that a rule cannot hold stays with a designer. I also decided what the Design Engine should not become. A tool that only compares colors and sizes against the tokens would miss whether a page works, and an AI that changes a product on its own would take the decisions away from the designer. I use it for every piece of design work I do.

A scale from only rules to only the AI. Both ends are crossed out: a tool that only compares colors and sizes would miss whether a page works, and an AI that changes a product on its own would take the decisions away from the designer. The Design Engine sits in the middle. Checked by the engine: every rule that can be stated exactly, a color is the token or it is not. Stays with a designer: the judgment a rule cannot hold, whether a page works.

04. Key decisions

Five sources stacked from Legal requirements at the top through Product requirements, Platform conventions and Designer's approved style to General design guidance, with an arrow reading higher overrules lower. A conflict between two sources stops and a person decides.
01

A fixed order of authority

Legal and product requirements come before platform conventions, a designer's approved style comes before general design guidance, and a lower source can never overrule a higher one. The alternative was to let the AI weigh all of its sources itself, which is faster but lets general advice quietly replace a product rule. With a fixed order, a conflict between two sources stops the work and a person decides, so the designer is asked more often and no rule is ever overridden without anyone noticing.

The request "change this" with change, preview and check sits inside a ring. An audit, a deployment and the backend each sit outside it and need their own request, and other problems are reported to the designer.
02

A request keeps its size

When someone says "change this", the AI changes that one thing, previews it and checks it, and an audit, a deployment or work on the backend each need their own explicit request. The alternative was to let the AI fix everything it notices along the way, which feels helpful but turns a small request into changes nobody asked for. Problems outside the request are reported to the designer and left for a separate decision.

A finding, raw value where a token exists at hero.css line 18, rejected by the designer and stamped correction recorded. On a timeline it is raised in run 1, stays quiet in runs 2 to 4, and returns only when the line changes.
03

A designer's correction is kept

When a designer rejects a finding, the Design Engine records the rejection and does not raise the same finding again, and the finding only returns if that part of the code is changed. The alternative was to report every finding on every run, which keeps the list complete but buries the real problems under ones the designer already decided. Each rejection also becomes a record of the designer's judgment that the system can learn from.

A Figma frame and the code of the same page both connect to one set of rules covering tokens, components and states.
04

The same rules check design and code

The page in Figma and the page built in code are measured against the same tokens, components and states, and every violation comes back with the rule and the exact place it occurs. The alternative was a separate design review and code review, which is the usual way of working and the point where a design and its build drift apart. One set of rules means the built page has to match the design the designer approved.

05. How it works

The product's Design System

Everything starts from the product's own Design System. The product keeps it in one package with its tokens, components, states, mappings and approved exceptions, and the Design Engine reads that package as the highest design authority for the product. It reads the tokens wherever a codebase keeps them, in CSS, Tailwind, TypeScript, SCSS or design token files, and it reads interfaces built for the web and for Android.

One package with layers for approved exceptions, mappings, states, components and tokens, marked as the highest design authority. It reads from CSS, Tailwind, TypeScript, SCSS and design tokens, and from interfaces for Web and Android.

The Design Knowledge

The Design Knowledge is written so that an AI can apply it without guessing. Every topic follows the same structure, with practical recommendations, why they matter, when they apply, their exceptions, and the accessibility requirements, examples and common failures that belong to them. Its values sit in one table, where each row names the decision, the default, what the default is relative to, when to adjust it, and whether it is a requirement, a convention or a guideline. The sources are kept in separate records behind the topics, so the AI reads the guidance itself and the sources stay available for anyone who checks them.

A topic with Recommendations, Why they matter, When they apply, Exceptions, Accessibility, Examples and Common failures, next to a values table with the columns decision, default, relative to, adjust when and class, where each row is a requirement, a convention or a guideline. Sources are kept behind each topic.

The Design System Knowledge

The Design System Knowledge works like a guided procedure. It first establishes whether the job is design only or design and code, who will maintain the system and which tools are already in place. From that it selects the procedure, reads the topics the procedure needs, and writes a plan with the exact outputs and checks. It records the evidence of every step and runs its checks until every required one passes.

A decision path through three questions. Scope is design and code, the system is maintained by a team, and tools are already in place. The path ends in procedure, topics and a plan with outputs and checks, with evidence recorded for every step.

From request to approved change

A request then runs through the engine in one direction. Every rule that can be stated exactly, such as contrast, target size, token use and state coverage, is checked by code without asking a model. A question that needs design judgment goes to a review that receives one rule, one target and the evidence for it, and an answer that does not fit that frame is stopped. Every finding names its rule, its source and the exact place it occurs, and a proposed fix waits for a person to approve it before anything changes.

A request splits into two routes. Code checks contrast, target size, token use and state coverage. A design judgment review receives one rule, one target and the evidence, and stops an answer outside that frame. Both lead to a finding with rule, source and exact place, and a proposed fix waits for a person.

While the AI writes

The engine also works while the AI is writing. Every time the AI saves a file, the Design Engine checks that file and returns its findings to the AI at once, so a wrong color or a button without an action is corrected in the same step, not discovered in a later review.

The file TaskRow.tsx has just been saved and checked by the Design Engine. Two findings come back at once: text contrast below 4.5 to 1 on line 4, and a control without an action on line 7.

06. Evidence

The same task without and with the Design Engine

The same AI worker received the same task twice, to add a date chip to the task rows of Nexthen, a to-do list with an AI assistant that I designed and built, once without the Design Engine and once with it. Both results were measured in the browser in all six theme and mode combinations at 360 and 1440 pixels wide.

The task list in a light theme without the engine. The completed date chip has a contrast of 2.89 to 1. Seven colors were invented outside the Design System, and a button does nothing when pressed.

Without the engine

The completed chip had a contrast of 2.89 to 1 in all three light themes, below the 4.5 to 1 that accessible text needs. The AI also invented seven new colors that exist nowhere in the Design System and built a button that does nothing when it is pressed.

The same task list with the engine. The completed date chip has a contrast of 5.39 to 1, every chip state passes 4.5 to 1 in all six combinations, no color was invented, and the control without an action is left for a person to decide.

With the engine

Every state of the chip passes 4.5 to 1 in all six combinations, no color was invented, and the button without an action became an item for a person to decide. The first draft of this run had the same mistakes, and the engine's findings are what changed them. The change was also smaller and faster, 127 added lines against 242, finished in 850 seconds against 982.

2.895.39
completed chip contrast
70
invented colors
242127
added lines
982850
seconds to finish

Tests and knowledge

Behind this sit 1,688 automated tests that pass on the engine, and a Design Knowledge of 36 complete topics with 94 Design Motion examples.

1,688automated tests pass
36complete knowledge topics
94Design Motion examples

07. What I learned

Offered: the AI and the Design Knowledge sit side by side, and the knowledge is not called. Part of the work: when the AI saves a file, the checks run on their own.

Giving knowledge is not the same as using it

Giving an AI my design knowledge is not the same as the AI using it. I first built the engine as something an AI could call when it needed it, and the AI did not call it. It answered design questions from memory while the knowledge sat next to it. So I made the checks run on their own every time the AI saves a file, and the AI is now told to read the Design Knowledge before it answers any design question.

The plan listed more project types, a formal release and a two-product test, all crossed out. What was built instead: three pieces, everyday design work, and a contrast command.

You learn what a tool needs by using it

The plan for the engine had support for more kinds of projects, a formal release and a test on two products ahead of it, and I asked myself whether the rest was only more testing. I built three more pieces and then put the engine into my everyday design work. Since then the engine grows from that work. The command that measures contrast exists because every design review kept measuring it by hand. A plan can only guess what a tool needs, and real use shows it.