How to Get Design-Consistent Output From a Coding Agent

Agents produce generic interfaces because nothing in the session tells them what your product looks like. Fix the input: expose design tokens as code, point the agent at existing components before it writes new ones, and write down the rules that are usually tacit. Consistency is a grounding problem, not a prompting one.

Why the default output looks anonymous

Ask an agent for a settings page and you get a settings page. Reasonable spacing, sensible hierarchy, components that work, and an aesthetic that belongs to no product in particular.

That is not a failure. It is the correct output for the input it received. With no information about your system, the model produces something near the average of everything it has seen, and the average of all interfaces is a competent generic interface.

The mistake teams make next is to describe their design in the prompt. It works for one screen. It decays immediately, because the description lives in whoever typed it, drifts between team members, and omits the rules nobody thinks to state until a reviewer objects to a violation.

So the durable fix is not a better description. It is making the design system something the agent reads rather than something it is told.

The four things to ground

Tokens, as code. Colors, spacing scale, type ramp, radii, shadows, breakpoints, in the actual file the build uses. An agent reading a token file produces values that are correct by construction. An agent reading a description of your palette produces values that are approximately correct, which is worse than wrong because it survives review.

Components, discoverable. The most valuable standing instruction in a design-aware setup is to search for an existing component before writing a new one, and to extend rather than duplicate. Most inconsistency is not wrong styling. It is a fourth button implementation that looks close enough to pass.

Patterns, written down. How a form reports errors. Where a primary action sits. What an empty state contains. How loading is represented. These are decided once and then live in the heads of two or three people, which is precisely the knowledge an agent cannot infer and reviewers enforce anyway.

Prohibitions. What you never do. No shadows on flat surfaces, no more than two font weights, never a modal for a destructive action. Negative rules are compact, high signal, and almost never written down anywhere a tool can read.

The review question that surfaces the gap

When you reject generated interface work, ask what rule it violated and whether that rule exists in writing. If it does not, the fix is not to reject the output. It is to write the rule down where the agent can retrieve it, because you will otherwise be rejecting the same thing next week with the same explanation.

The iteration loop that works

Design work with an agent goes well when it is structured like code review rather than like commissioning.

Start from a reference in your own product. "Match the structure of the account settings page" produces better results than any description, because it points at something concrete that already encodes your decisions.

Constrain the surface. One screen or one component per pass, with the states named explicitly: default, loading, empty, error, and whatever your domain adds. Naming states is where most of the value is, since generated interfaces are consistently strong on the happy path and thin everywhere else.

Review against the tokens rather than against taste. Did it use scale values, or arbitrary numbers? Did it reuse the component, or produce a near-copy? Those are checkable, and checkable review is the kind that survives a busy week.

Then keep what you learned. If a phrasing or a reference consistently produces good output, that belongs in your written rules rather than in one person's habits.

Make the system retrievable, not repeated

Once the rules exist, the remaining question is how they reach the agent.

Pasting them into every session works and is expensive: the same material bought on every request, in every session, by everyone on the team, and stale the moment the design system changes without someone remembering to update the paste.

RDK handles this layer. Files from local vaults, docs, and code are indexed as encrypted private chunks, and agents search those chunks before querying a model. Your token definitions, component conventions, patterns, and prohibitions get retrieved when a task touches them and cost nothing on the turns that do not. Token spend drops 80 to 90 percent on this kind of repeated, reference-heavy work because the answer is retrieved instead of regenerated.

Stacked retrieval sets the proportions: a private index over your own material answers 40 to 65 percent of queries, the public network adds 15 to 20 percent, and the model handles the remaining 5 to 10 percent. For design work specifically, almost everything an agent needs to know is in the first bucket, because it is your system and nobody else has documented it.

Frequently asked questions

Why does AI-generated UI look generic?
Because nothing in the request describes your product, so the model produces something near the average of every interface it has seen. That average is a competent generic interface. The output is a correct response to an ungrounded prompt, which means the fix belongs in the input rather than in the phrasing.
How do I make an agent follow my design system?
Expose tokens as code the agent can read rather than as a description it has to interpret, instruct it to find and extend existing components before creating new ones, and write down the tacit patterns and prohibitions your reviewers already enforce. Then make all of that retrievable rather than pasted per session.
What is the most common source of visual inconsistency?
Not wrong styling. A fourth implementation of a component that looks close enough to pass review. The single most valuable standing instruction is to search for an existing component and extend it, because duplication is what accumulates when generation is cheap and searching feels slower than writing.
How should I review generated interface work?
Against the tokens rather than against taste. Did it use scale values or arbitrary numbers, and did it reuse a component or produce a near-copy? Also name the states explicitly before the work starts, since generated interfaces are consistently strong on the happy path and thin on loading, empty, and error.