# Turn Claude Code into Your Own INCREDIBLE UI Designer (using Playwright MCP Subagents)
<!--
ref: @content/youtube/patrick-ellis/2025-08-16-claude-code-ui-designer-playwright-mcp-subagents
version: 3
updated_at: 2026-10-31T20:08:34.998Z
-->

Claude Code (Patrick Oakley Ellis, 2025-08-16): Generic-looking AI-generated UIs are not a model failure — they are an environment failure.

*Synthesized from Patrick Oakley Ellis on Patrick Oakley Ellis, 2025-08-16.*

Patrick Oakley Ellis is the CTO and co-founder of an AI-native startup that has used Claude Code heavily since its February 2025 release, doing front-end work for brands including Google, Coca-Cola, Disney, Nike, and Microsoft.

## Core Thesis

Generic-looking AI-generated UIs are not a model failure — they are an environment failure. Claude Code writes front-end code without ever seeing the rendered result, so it exercises only the text half of a multimodal model and leaves the vision circuits idle. Wiring in the Playwright MCP so the agent can open a browser, screenshot its own output, and compare that screenshot against a fixed spec turns one-shot generation into a self-correcting design loop.

## Key Insights

- Ellis frames every tool addition as building an **orchestration layer** with three parts: context (well-written prompts and documentation), tools (Playwright here), and validation state (a UI mock, style guide, or acceptance criteria). Missing any one of the three is why out-of-the-box results underwhelm.
- The **iterative agentic loop** requires a fixed spec or validator to iterate against. Claude reads the spec, builds, screenshots via Playwright, compares back to the spec, and repeats — which is what lets a run go 30–60 minutes unattended instead of five, and what removes the need to re-prompt five times.
- Ellis's mental model of the training mix: common crawl text dominates, code is a growing share, and images feed the multimodal side. Standard Claude Code usage taps the text and code portions and skips the visual circuits entirely, so the model reasons about design from coding best practices rather than from what the page looks like.
- Playwright is a Microsoft browser-automation and testing framework — roughly 76,000 GitHub stars at recording — supporting Chromium, WebKit, and Firefox. The MCP wrapper is a one-line install for Claude Code.
- Configuration knobs worth setting at the MCP JSON level: which browser, device emulation (e.g. iPhone 15), and headed vs headless. Ellis runs headed by default so he can watch the browser navigate. There is also a **vision mode** that switches from the default accessibility-map navigation to coordinate-based operations — slower, but better for some applications.
- Capabilities that matter beyond screenshots: reading browser console logs and network logs, emulating device and viewport sizes, and clicking through forms to reproduce a specific application state before collecting logs.
- Ellis treats CLAUDE.md as agent memory — its contents land right after the system prompt in every session. His file carries a **Visual Development** section pointing at a `context/` folder holding design principles and a style guide, plus a rule that any front-end change triggers navigation to the affected pages, a desktop-viewport screenshot, a check against acceptance criteria in the prompt, and a console-error check.
- For deeper review he delegates to a `design-reviewer` subagent in `.claude/agents/`, scoped to specific tools (Playwright, Context7 for docs, plus the standard built-ins) and pinned to Sonnet — he has seen no quality difference versus Opus for this work, and Sonnet is far cheaper. The agent prompt assigns a principal-designer persona, names Stripe and Airbnb as reference bars, and specifies both a step-by-step review methodology (accessibility, code health, robustness) and the exact report format.
- Subagents can invoke other subagents — a design reviewer calling a mobile-specific reviewer, for example — each with its own context window and model choice, so the main thread receives only the executive summary instead of accumulating all the intermediate context.
- Ellis's authoring recipe for config files: run Gemini deep research on the topic (design principles, SEO practices, back-end architecture), condense to markdown, feed it into Claude Code's `/agents` generator, then ask Claude Code to re-edit the draft against Anthropic's own published documentation and repo examples.
- Emergent behavior he did not script: Firecrawl returned 403 on some pages, so Claude Code spun up a Playwright browser on its own to load the same pages and scrape them directly.
- **Git worktrees** enable parallel exploration. Ellis keeps a second checkout (`patrick-ellis-io-2`) sharing one `.git` folder, each worktree on its own branch, and runs the same or varied prompts in three worktrees to A/B the stochastic outputs. A friend of his runs three headless Claude Code processes in GitHub workers and uses a separate Opus instance as judge over the three results.
- Packaging a strong team member's expertise — the best designer, the best code reviewer — into a subagent, slash command, or MCP distributes that judgment across the team without every engineer learning the nuances.

## Actionable Takeaways

1. Install the Playwright MCP into Claude Code with the one-line command from the microsoft/playwright-mcp README, then verify with `/mcp` that the server, its arguments, and its tool list are registered.
2. Set browser, device emulation, and headed/headless in the MCP JSON config rather than per-prompt. Start headed so you can watch the loop run; reach for vision mode only when accessibility-map navigation fails your app.
3. Create a `context/` folder holding a design-principles markdown file and a style guide. Generate the first draft with a deep-research tool, then hand-edit it down to something concise and actionable.
4. Add a Visual Development section to CLAUDE.md that instructs Claude, after any front-end change, to navigate to the affected pages, screenshot at your desktop viewport, compare against the prompt's acceptance criteria and your style guide, and read console errors.
5. Build a `design-reviewer` subagent in `.claude/agents/` with an explicit tool allowlist, `model: sonnet`, a principal-designer persona, a step-by-step methodology covering accessibility and code health, and a fixed report format. Trigger it before PRs and after significant UI/UX refactors.
6. Draft agents and slash commands by feeding a research summary into `/agents` with "generate with Claude," then ask Claude Code to revise the resulting markdown against Anthropic's documentation and the examples in their GitHub repos (the cookbook and the claude-code-security-review command are both worth reading).
7. Close the loop after a review: feed the report's high-priority issues back as the next prompt, or chain subagents so the fixes happen without a human turn.
8. Use git worktrees to run three variants of the same front-end prompt in parallel, then pick the best rather than iterating serially on one output.
9. Put visual material in the prompt — low-fidelity wireframes, inspiration boards, reference screenshots, hex codes, typography specs — alongside the framework and code constraints.

## Notable Quotes

> "You're taking an incredible PhD level intelligence and you're forcing it to design with essentially blindfolds on." — Patrick Oakley Ellis

> "They can't see their own designs. They can only see the code that they're writing." — Patrick Oakley Ellis

> "Those cookie cutter designs aren't the model's fault. It's the environment that you're placing those agents in." — Patrick Oakley Ellis

> "At the end of the day, the performance of these models comes down to context, tools, and validation steps." — Patrick Oakley Ellis

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*