Why AI-generated UIs all look the same: 12 rules that fix it


Ask Claude Code, Cursor or Codex for "a clean, modern SaaS dashboard" and you can describe the result before it finishes. A big rounded card with four smaller rounded cards inside it, each with its own border and shadow. A thin line under every row. Three filled buttons in the toolbar, all the same blue. A revenue number that wobbles sideways every time it updates. And nothing at all for the moment when the table is empty.
Run the same prompt again in a fresh session and the colours may change, but the layout usually does not. That is the useful clue. The model can write CSS perfectly well. What it does not have is a reason to choose anything other than the most common answer, because "clean" and "modern" don't rule anything out.
Two more things make it worse. Each session starts from nothing, so without written decisions the next screen picks its defaults all over again. And agents rarely look at what they built, so cramped spacing and weak contrast go unseen.
So the fix is not a better adjective. It is a short list of rules the agent can check its own work against: one surface level, corners that nest, one filled button, three type sizes, numbers that hold still, and real states for empty, loading and keyboard focus. Below are twelve of them, each with the before and after. Four are live: flip them yourself.
Surfaces and corners
Most of the "AI look" comes from boxes. Every group gets a frame, every frame gets a shadow, and the content ends up small in the middle of several layers.
1. One card, not cards inside cards
It is the most recognisable pattern of the lot. An outer card with a border and a shadow, and inside it, four more cards with their own borders and shadows. Each layer adds a little padding, so the actual numbers keep shrinking, and the double edges make the whole thing feel cramped.
Keep the outer card. Inside it, group things with space, or with a flat panel in a slightly different fill and no border or shadow.
Order #2048
3 items · €86.00
Delivery
Ana R. · 14 Flower Street, Porto
2. Space before lines
The second habit is a border-bottom on every row and an <hr> between every section. One line is fine. Twenty of them turn the screen into a form from 2009.
Try deleting the lines and adding space instead: a larger gap between groups than inside them. If a group still needs to stand apart, put it on a soft fill. A dense table can keep one hairline per row, because there the eye really does need help across the columns.
Notifications
Choose what reaches your phone
- Workout reminders30 minutes before each session
- Weekly progressEvery Sunday evening
- Tips from coachesAbout twice a month
3. Corners that nest
When an inner element has the same corner radius as its container, the gap between them is thick at the corners and thin along the sides. You may not be able to say what is wrong, but you notice it.
The fix is a small sum: the inner radius is the outer radius minus the padding between them.
.card { border-radius: 16px; padding: 8px; }
.inner { border-radius: 8px; } /* 16 − 8 */Lakeside cabin
2 nights · from €180
4. Shadows you barely notice
The default shadow in generated code is usually one dark, tight blur, something like 0 10px 25px rgba(0, 0, 0, 0.2). It reads as a smudge under the card, as if the card had been cut out and pasted on.
A hairline ring plus a wide, faint shadow lifts the card without drawing attention to itself.
Hierarchy
Once the boxes are calm, the next problem is that everything on the screen is asking for attention at the same volume.
5. One filled button per view
Generated toolbars love to make Save, Export, Share and Upgrade all solid accent buttons. When three buttons shout, the person reading has to stop and read every one of them to find the one they want.
Fill only the action most people take. Make the others secondary buttons or plain text buttons.
6. Three type sizes in a block
Count the font sizes in a generated card sometime. It is common to find five or six, such as 11, 12, 13, 15, 17 and 22 pixels, each picked for one line. Every line ends up shouting a little and the reading order gets lost.
Use three per block: one large size for the key figure, one for the title, one for everything else. Weight and a quieter text colour give you the rest of the hierarchy.
7. Numbers that hold still
This one is easy to miss in a screenshot and impossible to miss in a running app. Most fonts give each digit its own width, so a 1 is narrower than an 8. A price column does not line up, and a timer or a live counter jitters sideways on every tick.
font-variant-numeric: tabular-nums gives every digit the same width. Put it on prices, table columns, timers and counters, and right-align number columns.
Your basket
3 items- Trail shoes€141.10
- Wool socks × 3€18.00
- Steel bottle€21.50
- Total€180.60
8. One accent colour
Blue buttons, purple tags, orange icons, green links. Each choice looks fine on its own, and together they make the screen look like a template sampler.
Pick one accent for actions and the selected state, and take everything else from the greys. Keep green, amber and red for status, and only for status.
States
This is where a prototype turns into something people can use. Agents almost always build the happy path with sample data, so the empty, loading and keyboard states are simply not there.
9. Empty states that say what to do
"No data" in grey, centred in a big empty box, is the default. It leaves people on a blank screen with no idea what comes next.
Say what will appear here, and offer the one action that fills it: create the first project, import a file, invite someone.
10. Skeletons shaped like the content
A spinner in an empty box tells you nothing about what is coming, and when the data lands, the page jumps.
Draw grey blocks in the layout of the real content instead: the avatar circle, the title bar, the lines of text at their real height. The page keeps its shape while it loads, and the content arrives in place.
11. Keyboard focus you can see
outline: none shows up in a lot of generated CSS, usually to get rid of the ring after a mouse click, and usually with nothing to replace it. Anyone moving through the page with the Tab key now has no idea where they are.
Style :focus-visible instead of removing focus: a clear ring around whatever has keyboard focus, shown for the keyboard only, so mouse clicks stay clean.
12. Buttons that keep their size while busy
Press Save, the label turns into "Saving changes…", the button grows, and the button next to it slides away. Press again while it is busy and the same request goes out twice.
Keep the width, put a spinner where the label was, and ignore presses until the work is done.
If you would rather not write that one yourself, LayQ's free state button does exactly this, including the check or the shake at the end:
Four more quick checks
These don't need a demo to explain, and they show up in agent-built screens just as often:
- Padding inside cards. Text nearly touching the edge of a card with about 8px of padding looks cramped. Use 20px on all four sides, 24px on wide cards, and never less than 16px, even on phones. Rule page
- Quiet supporting text. When labels, values and help text share one colour and weight, nothing leads. Keep the main text dark, descriptions a step lighter and metadata (times, counts, units) lighter again, and never make a label darker than its value. Rule page
- Readable text on tints. Pale green text on a pale green badge is hard to read. Put dark text on the tint and carry the colour with a small dot in the full hue, and check the pair reaches 4.5:1 contrast. Rule page
- Status needs more than colour. A lone green or red dot means nothing to someone who can't tell the two apart. Give every status an icon and a word: a check for done, a clock for waiting, an exclamation mark for blocked. Rule page
Hand the rules to your agent
Put a block like this in CLAUDE.md (Claude Code), AGENTS.md (Codex) or a file in .cursor/rules/ (Cursor) before you ask for UI. It is deliberately plain so the agent can check each line against what it just wrote:
## UI rules
- One card level. Inside a card, group with space or a flat filled panel: no border, no shadow.
- Separate rows with space, not lines. Keep at most one hairline per table row.
- Nested corners: inner radius = outer radius - padding. Never the same radius on both layers.
- Shadows: a hairline ring plus one wide, faint shadow. No dark, tight shadows.
- One filled button per view. Other actions are secondary or text buttons.
- At most three font sizes per block. Use weight and a quieter colour for the rest.
- font-variant-numeric: tabular-nums on prices, table columns, timers and counters.
- One accent colour for actions and the selected state. Greys for everything else.
Status colours only for status.
- Every empty state says what will appear and offers one action to fill it.
- Loading: skeletons in the shape of the real content, not a spinner in a box.
- Never remove focus outlines without a :focus-visible ring in their place.
- Busy buttons keep their width, show a spinner in place of the label and ignore extra presses.
- Card padding: 20px on all sides (24px on wide cards), never below 16px.
- Text in three tones: main, description, metadata. A label is never darker than its value.
- On a tinted badge, dark text plus a dot in the full colour; at least 4.5:1 contrast.
- Every status has an icon and a word, not only a colour.Then ask it to go through the list against the screen it just built. Agents are noticeably better at fixing a specific rule than at following a general wish to "make it look nicer". Better still, let it look: a browser MCP server such as Playwright lets the agent open the page and compare what it sees with the list, instead of reasoning only from its own code.
Where a rules file stops being enough
A dozen rules in a prompt file works well for a handful of screens. On a bigger project, the file grows, gets skimmed, and each new session reinterprets it a little differently. At that point it helps to move the decisions out of prose: write the colours, spacing, corners and type sizes down as design tokens, and give the agent a way to check its screens against them. The rule sentences then name those tokens instead of raw pixel values.
That is what we built LayQ for. Every rule above has its own page with a live before and after and one sentence written for an agent, and there are 71 of them in total, free to read without an account. The Blueprint writes your decisions out as specs/design.md and design-tokens.css for the agent to read, and the LayQ MCP server lets Claude Code, Codex or Cursor read those rules and check a screen while it works. We also keep a set of open-source design skills for Claude Code and Cursor at CarGod/ai-ui-design-skills. Both are our own projects, so weigh our enthusiasm accordingly.
For setting up a design system in your agent's files, see how to give Claude Code or Cursor a design system.
Questions
- Why do Claude Code and Cursor produce generic-looking UI?
- An open request such as "a modern SaaS dashboard" leaves almost every visual decision open, and the model fills each one with the most common pattern it has seen. Those patterns are template defaults, so the result looks like every other template. Concrete rules about surfaces, spacing, corners, type sizes and states close those gaps.
- Is a rules block in CLAUDE.md enough, or do I need a design spec or an MCP server?
- For a few screens, a short rules block in CLAUDE.md, AGENTS.md or .cursor/rules goes a long way. As a project grows, a long prompt file gets skimmed and drifts. A written spec with design tokens, or an MCP server the agent can ask (LayQ is one, and it is ours), keeps the same decisions across sessions without filling the context window.
- Which rule should I try first on an AI-built dashboard?
- Take out the cards nested inside cards and turn on tabular numbers for every metric and number column. Both are small changes, and they remove two of the things that make a generated dashboard look generated.
- Do I need LayQ to use these rules?
- No. Every rule here is a plain sentence you can paste into any agent's instructions, and the demos and rule pages are free to read without an account. LayQ helps when you want the same decisions written down as design tokens and checked across a whole project.