A developer shares how they improved their workflow by creating a specialized AI skill to validate frontend layouts in real browsers. Source: dev.to.
Problem: AI Skills Break Existing Codebases
Using AI-powered frontend tools like Anthropic’s frontend-design and ui-ux-pro-max helped a lot on blank landing pages—where design from scratch is common and constraints are minimal.
But when applied to real React or Next.js codebases—just to fix a settings view or clean up a data table—the results often went wrong. The AI would generate oversized editorial headings that didn’t fit within existing admin layouts, or wrap sections in 100vw dimensions, which caused horizontal scrollbars on mobile devices. These issues violated responsive design and hurt user experience on small screens.
During long sessions, the agent lost context. Layout rules and constraints would vanish after session compaction. This happened because the AI relied only on prompt memory, not on actual rendered output.
Why It Failed: AI Guesses, Not Verifies
The core problem was that AI tools worked from text prompts and made assumptions without checking real browser renders.
Even with detailed instructions, the AI couldn’t tell the difference between a valid rule and a misapplied one. For example, it might turn a simple constraint into a full-page hero section—when the UI already had a fixed header and content structure.
Without real-time validation, the AI had no way to know if a layout would work on real devices. Screen sizes, font loading, and sticky headers could all break it.
What Was Built: A Router-Based Skill
To fix this, the developer created a new MIT-licensed skill called atelier-ui. Instead of feeding all design rules into one long prompt, it uses a modular router in a 5 KB SKILL.md file.
This router guides the AI through three steps:
- 01-intake.md: Resolves open questions in one turn and writes a structured brief to
.atelier/BRIEF.md. This file stays on disk even after session compaction. - 02-brand-site.md, 03-app-ui.md, or 04-3d-visual.md: The agent loads only the relevant module. For dashboards and React codebases, it uses 03-app-ui.md. For marketing pages, it uses 02-brand-site.md.
- 05-qa-gate.md: Runs quality checks using real browser renders to ensure real-world usability.
The key rule in 03-app-ui.md disables landing-page hero gates and pulls themes from library/themes.json. It keeps existing Tailwind tokens and UI components intact. It ensures numeric tables use tabular-nums and controls handle default, hover, focus-visible, disabled, loading, empty, and error states—key for accessibility.
How It Works: Real Browser Validation
Before generating any code, the skill runs mechanical CSS checks with zero LLM cost. This means no AI involvement—just lightweight scripts do the validation.
One rule in lint-ui.mjs flags 100vw and w-screen as problematic:

msg: Avoid `100vw` / `w-screen` (causes horizontal scrollbar overflow). Use `100%` / `w-full`.
Two fixes improved accuracy: stripCommentsPreserveLines() removes comment blocks without breaking line numbers or editor positions. It ignores https:// when stripping // comments. The no-outline-none rule also allows valid Tailwind patterns like focus-visible:outline-none focus-visible:ring-2, avoiding false positives.
Real-World Testing Without Heavy Dependencies
Even clean CSS can break on mobile when webfonts or sticky headers load. Previously, installing Playwright and Chromium (a 200 MB bundle) slowed setups and cluttered package.json.
Now, check-ui.mjs uses existing browser binaries—Chrome, Edge, Chromium, or Brave—already on the machine. It runs via Node.js’s built-in WebSocket client with no npm dependencies.
It checks for:
- Horizontal overflow on 1440×900 or 390×844 screens.
- Sticky headers overlapping
<h1>elements. - Unloaded webfonts, zero-size SVGs or canvases.
- WCAG AA contrast errors in oklch.
- Console errors and blank WebGL frames.
With --full --sheet, desktop and mobile renders are combined into a single review-sheet.png. A zero-context critic can review the layout in one image turn.
How to Try It
The developer built a three-mode showcase at yashh1323.github.io/atelier-ui-showcase, featuring:
- Nordhavn Timber (brand site)
- DriftGate Console (dark ops UI)
- Meridian 04 (WebGL2 astrolabe)
Eleven headless Chrome smoke tests run in GitHub Actions (see docs/PROOFS.md).
To install:
npx github:yashh1323/atelier-ui installnpx github:yashh1323/atelier-ui doctor- Or via
vercel-labs/skills:npx skills add yashh1323/atelier-ui
The skill is available at github.com/yashh1323/atelier-ui.
Limitations
The skill won’t fix unclear briefs or supply good design taste on its own. It depends on clear, specific user prompts.
It requires Node 22+ and a Chromium-family browser already installed. It is not a substitute for human design judgment.
It works best with consistent codebases and defined design constraints. For more on guiding AI with rules, see Give Your AI Coding Agent Rules, Not Just a PRD.
Sources & further reading
Featured image: original publisher image. Via original publisher. Image source
