Guide
What you get: The agent builds UI with your theme tokens (no arbitrary values), mobile-first breakpoints, dark: variants, visible focus styles and a test. Best for Frontend teams using Tailwind who want consistent, on-brand utility classes from agents..
Before you start
- A Tailwind project with theme tokens (Tailwind v4: an @theme block in your CSS; v3: tailwind.config.js)
- A test command (we used Vitest + Testing Library: npm test)
- Cursor: .cursor/rules/tailwind.mdc. Claude Code/Codex: the same text in CLAUDE.md / AGENTS.md
Worked example (Nov 14, 2026, Claude Code 2.1.318 (claude-opus-5-5); Codex 0.151.0 (gpt-5.6-sol))
Input
Vite 8 + React 19 + Tailwind 4.3 with brand tokens in src/index.css (@theme) and a class-based dark variant, an existing Button with focus-visible styles. Task: a 3-plan pricing section with a highlighted 'most popular' plan, responsive and dark-mode ready.
Result
Claude Code: a PricingCard component reusing Button, `grid gap-8 md:grid-cols-3`, `dark:bg-white/5`, `border-brand-600`. Codex: cards rendered from a plans array in App.tsx with `ring-2 ring-brand-500` for the popular plan.
Not tested in Cursor or Copilot: the rule text was saved verbatim (front matter included) as CLAUDE.md for Claude Code and AGENTS.md for Codex, the files those agents load at startup, plus a copy at its normal path. Filled with tailwind_config_path='src/index.css (the @theme block...)' and dark_mode_strategy='the dark class on <html>...'; because the blanks sit inside backticks, these phrase values broke the Markdown formatting of those two lines. Re-run by us: tests, oxlint and vite build pass for both; no arbitrary [..] values; no @apply; buttons reuse the existing focus-visible styles; mobile-first md: breakpoints. Neither actually measured contrast.
How to check it worked
- grep the diff for '-[' to catch arbitrary values
- Tab through the page: every button and link should show a focus ring
- Toggle the dark class and look at both themes
Common problems
- Tailwind v4 has no config file: point the token rule at the CSS file with @theme
- Long values in the blanks break formatting because the blanks are inside backticks
- 'check contrast in both themes' isn't something agents can measure without a tool
Log in to join the discussion.