Design Engine
Design-System Enforcement for AI-Generated Interfaces
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.
A new button instead of the one that exists
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.
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.
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.
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.
04. Key decisions
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.
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
07. What I learned
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.
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.