Why AI agents build the same UI, and how to fix it
Agents reach for the same primitives and hand-write the rest. Give yours a catalog, rules and a review list instead.
By Malay Patel
Key findings
- AI agents build lookalike interfaces because they only have their training data and your code to draw on: they reuse the most common primitives and hand-write everything else.
- Connecting a component library over MCP lets an agent search by what a component does and read its props and source before writing code.
- Installing components as source through the shadcn CLI lets the agent edit them to fit, instead of wrapping a package in workarounds.
- Short, testable design rules in AGENTS.md or CLAUDE.md, such as 'never bold' or 'search the library first', change agent output more than adjectives like 'clean' or 'modern'.
- Agent-built UI most often breaks on keyboard access, reduced motion, dark mode and slow devices, so check those four before merging.
Why agent UI looks the same
Ask an AI agent for a dashboard and you get the same dashboard everyone gets: default shadcn cards, a blue button, a line chart, a fade-in. It works. Nobody would call it designed.
The cause is what sits in its context. With nothing there but your code and its training data, it does two things: it reaches for the most common primitives it has seen, and it hand-writes everything else from scratch. The common primitives make every app look alike. The hand-written parts are where quality slips, because nobody reviews a 200-line animation an agent wrote in eight seconds.
We build components for agents to install, so we watch this every day. Five changes fix most of it.
1. Give it a catalog
An agent picks from what it can see. Connect a component library over MCP and it can search by what a component does ("date range picker", "usage meter"), read the props and source, and choose before it writes a line.
claude mcp add --transport http uibrik https://uibrik.com/mcpThat is the whole setup in Claude Code. Cursor and VS Code take the same URL in their MCP config; the MCP docs have one-click links for both. shadcn's own MCP server works alongside it for the base components.
2. Install source, not packages
When the agent finds a component, it should land in your project as source, through the shadcn CLI. A package hides the code behind an import, so the agent can only pass props. Source it can read, restyle and connect to your data like any file you wrote.
npx shadcn@latest add https://uibrik.com/r/tag-input.jsonThe part that matters is the ownership. If the component is slightly wrong for your app, the agent edits it instead of wrapping it in workarounds.
3. Write the taste down
Agents follow written rules far better than implied ones. Put your design rules in the file your agent reads on every task: AGENTS.md, CLAUDE.md or .cursor/rules. Short, concrete and testable beats long and inspiring. "Clean and modern" changes nothing. "Never bold" does.
## UI rules
- Before building any interactive component, search the uibrik MCP server for one.
Install it with the shadcn CLI and edit the source. Hand-write only what has no match.
- Neutral colours. One accent, used for the primary action only.
- Font weights: regular, medium, semibold. Never bold.
- No borders or drop shadows on cards; separate layers by background tone.
- Motion 150 to 300 ms, fade and small translate. Respect prefers-reduced-motion.
- Every interactive element works by keyboard and shows a visible focus ring.
- Check every screen in light and dark mode before calling it done.The first rule does the most work. It turns "build me X" into "find X, install it, adapt it", which is the difference between a reviewed component and a fresh guess.
4. Ask by job, not by look
"Make a cool animated card" gets you decoration. Describe the job the UI does and where it lives, and let the agent search for it. Ask to see options when the choice matters.
Find a component for picking a date range on the reports page and install it.
The empty state on /projects feels dead. Find something that shows
what to do first, and wire its button to the "New project" dialog.
Which uibrik chart fits a 30-day uptime history? Show me two options
with their props before installing either.5. Check the four things agents skip
Even with good parts, review these before you merge. They are the first to break and the last to show in a demo.
- Keyboard. Tab through it. Every control reachable, focus ring visible, Escape closes what opened.
- Reduced motion. Turn it on in your OS settings. Animations should settle to a still, finished state, not vanish or jump.
- Dark mode. Look for fills that match the surface behind them and text that drops below readable contrast.
- A slow phone. Throttle the CPU 4x in dev tools. Long animations and WebGL should drop quality or pause off screen, not stutter.
The five-minute setup
- Connect a component MCP server (the command above).
- Add a registry namespace to
components.jsonso installs are one short command. Our registry guide shows how. - Paste the UI rules into AGENTS.md and edit them to your taste.
- Ask for the next screen by its job.
- Review the four checks before merging.
Sources
Questions
- Why does UI made by AI agents look generic?
- An agent with no component library in context reuses the most common primitives from its training data and hand-writes the rest, so apps converge on the same default cards, buttons and fades.
- How do I make Claude Code build better UI?
- Connect a component library over MCP, install components as source with the shadcn CLI, put concrete design rules in CLAUDE.md, describe each screen by the job it does, and review keyboard, reduced motion, dark mode and slow-device behaviour before merging.
- What should go in AGENTS.md for UI work?
- Short rules an agent can check: search the component library before writing a component, which colours and font weights to use, how cards are separated, motion durations, reduced-motion and keyboard requirements, and checking light and dark mode.