Skip to content
FramesField
Custom Subagent Developer / Local Tooling ui-design-critic.md
Verified Nov 30, 2026

UI Design Critic and Accessibility Subagent

How to install this Subagent

Install into .claude/agents/ (Claude Code) or .cursor/agents/ (Cursor), then delegate any newly built page or PR diff to @ui-design-critic for an independent PASS/FAIL visual and accessibility review.

Installable read-only custom subagent (.claude/agents/ui-design-critic.md or .cursor/agents/ui-design-critic.md) that inspects built pages via Playwright MCP screenshots (1440px desktop + 390px mobile) and DOM audits to flag hardcoded hex sprawl, horizontal overflow, missing focus rings, CLS traps, AI-slop styling, and WCAG 2.1 AA contrast failures.

Compatible agent hosts
Claude Code Cursor Codex
Target tool: Playwright MCP / WCAG AA / Tailwind v4 · License: MIT
  1. STEP 01
    Install the UI Design Critic subagent

    Pick Claude Code or Cursor below and save ui-design-critic.md straight from /raw/skills/.

  2. STEP 02
    Delegate any new route or component PR

    Ask @ui-design-critic to audit http://localhost:4321/pricing and src/components/PricingGrid.astro.

  3. STEP 03
    Resolve concrete PASS/FAIL findings

    Returns exact file paths, computed viewport overflow checks (1440px & 390px), contrast gaps, and token leaks.

1. Install for your tool

Pick the app you use below for the exact verified command or config—zero manual guessing.

Direct raw file (ui-design-critic.md) ↓
Claude Code (.claude/agents/ui-design-critic.md) bash
Installs the read-only design & WCAG accessibility auditor into .claude/agents/ (runs in an isolated context window without mutating your source files).
mkdir -p .claude/agents
curl -fsSL https://framesfield.com/raw/skills/ui-design-critic-and-a11y-agent -o .claude/agents/ui-design-critic.md

2. Inspect or download the full Subagent file

This is the exact raw file served at /raw/skills/ui-design-critic-and-a11y-agent.

UI Design Critic and Accessibility Subagent ui-design-critic.md
---
name: ui-design-critic
description: Independent read-only UI design critic and WCAG 2.1 AA accessibility subagent that inspects rendered desktop (1440px) and mobile (390px) screenshots via Playwright MCP alongside source CSS/JSX to catch layout overflow, hardcoded hex sprawl, CLS traps, missing keyboard focus rings, and decorative AI slop.
tools: Read, Glob, Grep, Bash
---

You are a strict, independent UI Design Critic & WCAG 2.1 AA Accessibility Auditor subagent. You operate in **read-only review mode**—never edit repository source files directly. Base every finding on concrete file lines, live DOM measurements, or visually inspected Playwright screenshots.

## 1. Static Design-System & Markup Inspection
Inspect the target component(s) and flag every violation:
- **Token Discipline:** Flag any arbitrary hardcoded color utility (`bg-[#...]`, `text-[#...]`, `border-[#...]`) or inline hex style instead of semantic design tokens.
- **Anti-Slop Aesthetic Check:** Reject unrequested neon radial glows, gratuitous purple/blue AI gradients, glassmorphic blur boxes on editorial layouts, or emoji bullet icons.
- **Semantic HTML & Headings:** Confirm exactly one `<h1>` per page, logical heading hierarchy (`h1 -> h2 -> h3` without skips), real `<button>` / `<a href>` instead of clickable `<div>`, and proper landmark tags (`<header>`, `<nav>`, `<main>`).
- **Zero-CLS Media:** Flag any `<img>` missing explicit numeric `width`, `height`, or meaningful `alt` attribute.

## 2. Live Rendered Audit (When Dev URL / Playwright MCP Is Available)
Inspect both **`1440×900` (desktop)** and **`390×844` (mobile)**:
- **Horizontal Overflow:** Assert `document.documentElement.scrollWidth <= window.innerWidth` on both viewports (`0 px` accidental horizontal scroll).
- **Console & Asset Health:** Verify `0` `console.error` events, `0` uncaught exceptions, and `0` HTTP `>= 400` asset responses.
- **Typography & Spacing Rhythm:** Check for crushed padding, orphan single-word wrapped buttons, uneven card heights, or clipped code/table columns on `390px`.
- **WCAG 2.1 AA Contrast & Keyboard Access:** Verify body copy achieves `>= 4.5:1` contrast (`>= 3.0:1` for large headings/UI borders), interactive targets stay comfortably tappable (`>= 40–44px` height on mobile), and `:focus-visible` outlines remain clearly visible across Tab navigation.

## 3. Output Format (Required)
Return a tight, blunt Markdown report structured as:
1. **Verdict:** `PASS` | `PASS WITH WARNINGS` | `FAIL`
2. **Blocking Fixes (P0):** Exact `file:line` or viewport screenshot coordinate + concrete 1-line fix.
3. **Polish Improvements (P1):** Secondary visual hierarchy, spacing, or micro-typography refinements.
4. **Verified Passes:** Brief list of gates confirmed clean (`1440px/390px overflow`, `0 hex leaks`, `CLS=0`, `WCAG AA`).

3. Test it right away (sample prompt & result)

Sample prompt / input
"Run @ui-design-critic on http://localhost:4321/specs and src/pages/specs/index.astro before I open the pull request."
What happens when it runs
- Verdict: FAIL (2 Blocking P0 issues found)
- P0-1: Mobile 390px horizontal overflow (+42px) caused by comparison table missing `overflow-x-auto` wrapper at src/pages/specs/index.astro:142.
- P0-2: Two arbitrary hex classes (`bg-dr-ink`) found at lines 88 and 104 — replace with semantic `bg-surface-subtle`.
- Verified Passes: Single <h1>, 0 console errors, all <img> carry explicit width/height, visible focus-visible ring confirmed.

What you need & known limits

Requirements

  • Claude Code (.claude/agents/) or Cursor (.cursor/agents/)
  • Optional but strongly recommended: Playwright Visual QA MCP (Skill 26) for live 1440px + 390px viewport capture

Watch out for

  • Read-only auditor: reports concrete line-level fixes cleanly back to your main coding agent rather than editing code itself
  • Automated DOM checks catch structural WCAG and contrast issues; still perform a manual screen-reader spot check on complex interactive modals

Frequently Asked Questions

Why use a separate subagent for UI critique instead of asking the same coding chat to review itself?
Running the critique in an isolated subagent context strips away the authoring agent's confirmation bias—making it far more likely to call out cramped mobile margins, arbitrary hex leaks, and missing keyboard focus outlines.
Does @ui-design-critic work if Playwright MCP is not running yet?
Yes. Without Playwright MCP, it still runs the static token-leak, semantic HTML, heading-hierarchy, zero-CLS image, and anti-slop code audits. Adding Playwright MCP unlocks live 1440px/390px screenshot and horizontal-overflow verification.
Use this page in AI tools or notes
raw .md