Ask a model to build a dashboard and you get the same page back: indigo buttons, glassmorphism cards, a pulsing LIVE badge, and a monospace eyebrow reading // SYSTEM STATUS: OPTIMAL. The output is not wrong because the model is bad at CSS. It is wrong because nothing in your workflow checks whether a visual element motivates a user action.
By the end of this article you will have a concrete review checklist, two lint rules that catch the loudest smells automatically, and a system prompt that suppresses them at generation time.
The root cause is your prompt, not the model
Models predict the most probable next token. Unconstrained, the most probable UI is the statistical average of every Tailwind tutorial and Dribbble shot from the last few years: purple gradients, rounded cards, Inter, three-column feature grids.
You cannot change the distribution. You can constrain the output. Two levers work:
- Constrain generation: a system prompt that names the smells and states the design rules.
- Constrain review: automated checks that block the worst patterns before a human ever looks.
Relying on one without the other fails. A prompt alone drifts on long sessions. Review alone means regenerating slop on every iteration.
A design rule you can actually enforce
Use the motivated-move test, borrowed from filmmaking. Every visual flourish must do one of three jobs: orient the user, communicate a state change, or guide attention to a priority action.
That test turns taste into a checklist:
- Does this element tell the user where they are, what state something is in, or what to do next?
- If the state is normal and permanent, would removing the badge lose information? Then remove the badge.
- Does copy address the user, or does it leak your architecture ("100% client-side WebAssembly processing")?
- Is color doing work (error, accent, brand) or just decorating?
If the answer to the first question is no, the element is noise. Delete it. This is the rule every later section implements.
Lint the copy that leaks context
The easiest smell to catch mechanically is context leakage: build details and prompt instructions showing up in user-facing strings. Most of those strings live in one place, so a small script over your source files catches them.
import re import sys from pathlib import Path # Strings that read like the model talking about its own implementation SMELL_PATTERNS = [ (r"(?i)100%? (client[- ]side|local)", "implementation detail in copy"), (r"(?i)no mocks?|real services", "test/prompt context in copy"), (r"(?i)webassembly|wasm", "tech leak in user-facing copy"), (r"(?i)one (app|campus|platform)", "marketing brief leak"), (r"//\s*\d+\s*[—-]", "monospace eyebrow"), ] failures = [] for f in Path("src").rglob("*.{tsx,ts,jsx,js,vue,html}"): text = f.read_text(encoding="utf-8") # match string literals and JSX text only, crudely but usefully for literal in re.findall(r"[\"'`]([^\n]{4,120})[\"'`]", text): for pattern, label in SMELL_PATTERNS: if re.search(pattern, literal): failures.append(f"{f}: {label}: {literal.strip()[:60]}") if failures: print("\n".join(failures)) sys.exit(1) The regexes are crude on purpose. They produce false positives occasionally, but a lint rule that a human confirms in two seconds beats a code review that misses the string entirely. Wire it into CI as a pre-push hook and the smells stop reaching your teammates.
Flag badges that describe normal state
Fake telemetry is subtler than copy leakage, so the check is different. Instead of pattern-matching text, ask a structural question: is this badge attached to a state that can actually change?
// Before: a badge on a state that never varies <span className="badge badge-green animate-pulse">ACTIVE</span> // After: render the badge only for exceptional states {status !== "active" && <StatusBadge status={status} />} The rule: if the condition rendering the badge is a constant, the badge is decoration. A useful heuristic for review — search for badges whose parent component has no props or state feeding them. LIVE, SYNCED, and VERIFIED pills next to static content fail the motivated-move test every time.
Animation makes it worse. An animate-pulse badge tells the user a background process is in flight. If nothing is in flight, the pulse is a lie your UI tells on every render.
Kill the gradient monoculture with tokens
The indigo-to-violet gradient (#6366f1 to #8b5cf6, 135 degrees) shows up because it is the most over-represented palette in template libraries. You cannot argue a model out of a distribution, but you can remove the choice entirely with design tokens.
:root { /* one accent, doing real work */ --color-accent: #0f766e; /* primary actions only */ --color-danger: #b91c1c; /* destructive and error states */ --color-text: #1c1917; --color-surface: #fafaf9; --color-border: #e7e5e4; } /* hard rule: no decorative gradients */ .btn-primary { background: var(--color-accent); } When your prompt says "use only these tokens; gradients are forbidden", the model's color decisions collapse into a small, sane set. The same trick works for cards: provide a single .section pattern and forbid nested rounded-xl border shadow-sm containers, forcing the model to separate content with spacing and type scale instead.
Three suppression strategies compared
Each lever catches different failures at different costs.
| Approach | Catches | Cost | When to use |
|---|---|---|---|
| Constrained system prompt | Color monoculture, decorative flourishes | One-time setup, drifts on long sessions | Always, as the first line of defense |
| String linting in CI | Context leakage, eyebrow labels | Occasional false positives | Teams with multiple people merging AI code |
| Human review with checklist | Everything, including judgment calls | Slowest | Final gate on user-facing surfaces |
Note the failure mode of prompt-only suppression: models comply on the first generation, then drift back toward the mean as the conversation grows and earlier instructions lose salience. Re-inject the design rules when the session gets long, or start a fresh session per feature.
The prompt that works
Constraints need to be specific and negative. Vague instructions like "keep it clean" do nothing; naming the smells does.
Design rules for all UI you generate: - Use only the CSS tokens provided. Never introduce new colors or gradients. - No badges for permanent or normal states. Badges only for: error, disconnected, syncing with a count of remaining items. - No decorative animation. Animate only in-flight background processes. - No labels above headers. Headers say what the section is. - All copy addresses the end user. Never mention implementation, architecture, or the prompt in UI strings. - Prefer whitespace and type scale over nested bordered containers. Keep it under a screen. Long rule lists get partially ignored; short absolute rules get followed.
Key takeaways
- LLM UI slop is a distribution problem, so you fix it with constraints, not taste arguments.
- The motivated-move test converts design taste into a pass/fail checklist: orient, communicate state, or guide attention.
- Context leakage in copy is mechanically catchable with a small regex lint over string literals.
- Badges on unchanging states are always decoration; render them only when the state can actually vary.
- Design tokens plus a short, negative, specific system prompt beat any amount of "make it look clean."
Source
LLM UI Smells and How to Avoid Them — the original catalogue of smells; this article adds working lint code, token-based suppression, and a comparison of the three enforcement strategies.
Support this work
These write-ups are researched and published with no paywall, sponsor, or tracking. If one saved you an afternoon, a small tip keeps them coming.
USDT, USDC or USDD · TRC-20 (Tron)
TFTNsfyomKrnUutRjBTGVULp19ByW29KbY 

