--- name: frontend-design description: "Create distinctive, production-grade frontend interfaces with visual verification. Use this skill when the user asks to build web components, pages, landing pages, dashboards, React/Vue/Svelte components, HTML/CSS layouts, or any web UI that needs to look polished. Also activates when styling, beautifying, redesigning, or doing visual refresh of existing UI. Covers the full loop: design thinking, code generation, and browser-based visual verification to iterate until the result actually looks right. Use this skill even if the user doesn't explicitly say 'design' — any request to build or improve a web interface benefits from this skill's aesthetic guidance and verification workflow." metadata: version: 1.0.2 tags: frontend, design, ui, visual-verification, browser, chrome, playwright, css, animations, accessibility --- # Frontend Design with Visual Verification Build distinctive, production-grade frontend interfaces — then verify they actually look right in a real browser. This skill closes the gap between "generate code" and "ship something beautiful" by combining bold design thinking with a browser-based verification loop. ## Why Visual Verification Matters Writing frontend code without seeing the result is like painting blindfolded. Generic AI-generated UIs happen because the model never sees what it produced — it can't catch misaligned layouts, clashing colors, or broken animations. This skill ensures you always close the loop: generate code, open it in a browser, see what it looks like, and iterate until it's genuinely good. ## Phase 1: Design Thinking Before writing any code, commit to a clear aesthetic direction. The goal is intentionality — bold maximalism and refined minimalism both work when executed with precision. ### Aesthetic Direction Pick a strong conceptual direction and execute it consistently: - **Purpose**: What problem does this interface solve? Who uses it? - **Tone**: Choose something specific — brutally minimal, retro-futuristic, luxury editorial, organic/natural, playful, industrial, art deco, soft/pastel. Vague directions produce vague results. - **Differentiation**: What makes this memorable? Identify one signature element someone will remember. ### Typography Font choice is the single biggest design signal. Generic fonts (Inter, Roboto, Arial, system defaults) immediately signal "AI-generated." - Pair a distinctive display font with a refined body font - Use a clear typographic scale (e.g., Golden Ratio: 1.618 multiplier between sizes) - Load fonts from Google Fonts or bundle them — never rely on system fonts for character - Vary choices across projects — converging on the same "safe" picks (Space Grotesk, Poppins) defeats the purpose ### Color & Theme - Commit to a cohesive palette using CSS variables for consistency - A dominant color with sharp accents outperforms timid, evenly-distributed palettes - Dark mode: deep, rich backgrounds (not pure black) with vibrant accents that pop - Light mode: warm off-whites (not sterile #fff) with deeper accent variants - Never default to purple gradients on white — the most recognizable AI-slop pattern ### Motion & Animation Animation creates delight when used with intention. One well-orchestrated page load with staggered reveals creates more impact than scattered micro-interactions everywhere. - Prioritize CSS-only solutions for HTML projects, Motion library for React - Focus on high-impact moments: page load reveals (staggered `animation-delay`), scroll-triggered transitions, hover states that surprise - Include skeleton shimmer for loading states - Always respect `prefers-reduced-motion` — wrap animations in a media query ### Spatial Composition Break out of the grid occasionally. Unexpected layouts — asymmetry, overlap, diagonal flow, grid-breaking hero elements — create visual interest. Balance generous negative space with controlled density depending on the aesthetic direction. ### Backgrounds & Visual Details Create atmosphere and depth rather than defaulting to solid colors. Gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays all contribute to a distinctive feel. ## Phase 2: Implementation Generate working code (HTML/CSS/JS, React, Vue, Svelte, etc.) that is production-grade, visually striking, and cohesive. ### Framework Detection Check the project for its tech stack before generating code: - `package.json` with `react` / `next` → React/Next.js (JSX + CSS Modules or Tailwind) - `package.json` with `vue` → Vue SFC - `package.json` with `svelte` → Svelte components - `tailwind.config.*` → Use Tailwind utility classes - No framework detected → Vanilla HTML/CSS/JS ### Visual Media Every image slot must show something — never leave empty placeholders: - **Avatars**: `https://i.pravatar.cc/150?u={unique-id}` - **Photos**: `https://picsum.photos/seed/{slug}/{width}/{height}` - **Branded graphics**: Generate with AI image tools or use gradient SVGs - **Data display**: Always use `Intl.NumberFormat` for prices, `Intl.DateTimeFormat` for dates — showing `$NaN` or `Invalid Date` is a critical visual bug ### Accessibility (Non-Negotiable) - Color contrast: minimum 4.5:1 for text, 3:1 for large text (WCAG AA) - Visible focus indicators on all interactive elements (`:focus-visible`) - Semantic HTML — `