ia-frontend-design
by @iliaal
Visual design and aesthetic direction for frontend interfaces. Use when building web pages, landing pages, dashboards, or applications where visual identity...
clawhub install compound-eng-frontend-designπ About This Skill
name: ia-frontend-design class: meta description: >- Visual design and aesthetic direction for frontend interfaces. Use when building web pages, landing pages, dashboards, or applications where visual identity matters. For React patterns and testing, use react-frontend.
Frontend Design
Read the user's frontend requirements: a component, page, application, or interface to build. Note context about purpose, audience, or technical constraints.
Context Detection
Before designing, assess the existing design environment. Count design signals in the project: design tokens/CSS variables, component library (shadcn, MUI, Ant), CSS framework config (Tailwind, styled-components), font imports, color system, animation patterns, spacing scale.
When in doubt, check package.json, tailwind.config.*, global CSS files, and existing components before deciding.
Design Philosophy (Write First, Code Second)
For full pages, applications, or multi-component interfaces: write a 3-sentence design philosophy before any code. This forces a coherent aesthetic direction and prevents generic output.
1. Sentence 1 -- Intent: What emotional response should this interface provoke? (Not "clean and modern" -- that's every AI default. Be specific: "controlled tension between density and breathing room" or "the quiet confidence of a well-bound book.") 2. Sentence 2 -- Signature: What single visual choice makes this unmistakable? (A typeface, a color relationship, a spatial pattern, a motion behavior.) 3. Sentence 3 -- Constraint: What will this design deliberately NOT do? (The constraint shapes the identity as much as the choices.)
Write the philosophy as a comment or in conversation before implementation begins. The philosophy constrains implementation without being prescriptive -- it's a compass, not a blueprint.
For small components or quick additions to existing interfaces, skip the philosophy and match the surrounding design system.
Design Thinking
With the philosophy written, commit to the specifics:
Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work -- the key is intentionality, not intensity.
Before importing any third-party library (framer-motion, lucide-react, zustand, etc.), check package.json. If the package is missing, output the install command before the code. Never assume a library exists.
Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is:
Frontend Aesthetics Guidelines
Focus on:
Geist, Outfit, Cabinet Grotesk, Satoshi, or context-appropriate serifs. Pair a display font with a refined body font.
- Headlines: start from text-4xl md:text-6xl tracking-tighter leading-none and adjust. AI defaults are undersized and timid β lack presence.
- H1 iron rule (2-3 lines max): every hero H1 must render in 2-3 lines, never 4-6. The fix is always wider container + smaller font, not the reverse. Minimum container: max-w-5xl (wider for longer headlines); adjust font with clamp(3rem, 5vw, 5.5rem) so it scales down instead of wrapping. A 6-line heading wall is a catastrophic failure, not a design choice.
- Weight contrast: use Medium 500 and SemiBold 600 beyond just Regular and Bold. Tighten letter-spacing, reduce line-height.
- Body text: limit to ~65 characters wide, increase line-height.
- Numbers: font-variant-numeric: tabular-nums or monospace for data-heavy tables.
- Orphaned words: fix with text-wrap: balance.
transform and opacity (GPU-composited). Use IntersectionObserver for scroll reveals. See motion-patterns.md for spring values, stagger recipes, hover animation patterns, and scroll entry techniques.w-[calc(33%-1rem)]). Contain layouts with max-w-7xl mx-auto or similar. Use min-h-[100dvh] instead of h-screen (prevents iOS Safari viewport jumping). Bottom padding often needs to be slightly larger than top for optical balance. Anti-card overuse: at high density (dashboards, data-heavy UIs), don't wrap everything in card containers (border + shadow + white). Use border-t, divide-y, or negative space to separate content instead. Cards should exist only when elevation communicates hierarchy. Bento grid archetypes: when building dashboard grids, use named patterns: Intelligent List (filterable, sortable data), Command Input (search/action bar), Live Status (real-time metrics), Wide Data Stream (timeline/activity feed), Contextual UI (details panel that responds to selection). Apply grid-flow-dense to prevent empty/dead cells β see banned-ai-patterns.md for the rule.ring-1 hairline + padding + large radius; inner content with its own background + shadow-[inset_0_1px_1px_rgba(255,255,255,0.15)] + derived inner radius (rounded-[calc(2rem-0.375rem)]).
- Glassmorphism refraction: add border-white/10 inner borders.
- Placeholder images: https://picsum.photos/seed/{name}/800/600 when real assets unavailable.Utility Copy for Product UI: Product UI copy prioritizes orientation, status, and action over promise, mood, or brand voice. If a sentence could appear in a homepage hero or ad, rewrite it until it sounds like product UI. Litmus check: if an operator scans only headings, labels, and numbers, can they understand the page immediately? Error messages: be direct ("Connection failed. Please try again."), not performative ("Oops! Something went wrong!"). No exclamation marks in success messages -- be confident, not loud.
Mandatory Interactive States
LLMs default to "static successful state" output. Every interactive component MUST ship with all four state treatments β static success alone is an incomplete implementation:
window.alert(), never a generic toast for form-level errors.:active, apply -translate-y-[1px] or scale-[0.98] so clicks feel like a physical push, not a color flicker.Missing states are the most common reported AI UI defect. Generating only the success state is incomplete work, not a stretch goal.
Mobile Collapse + Performance Guardrails
For any layout using asymmetry, rotations, heavy animation, or complex grid variants, load mobile-and-performance.md β mobile collapse rules (single-column below md:, 44Γ44 touch targets, no horizontal overflow, rotations stripped on mobile) and performance guards (grain filters only on fixed pseudo-elements, transform/opacity-only animation, z-index discipline, memoized perpetual animations). These are the top two reported AI UI defects after missing interactive states.
Server / Client Component Safety (Next.js App Router)
For Next.js App Router projects, load rsc-client-boundaries.md β it covers the Server vs Client decision table, leaf-component isolation rules, the useMotionValue vs useState rule for continuous animations, and the common failure modes ('use client' hoisting, context providers in Server Components, async data inside motion trees).
Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations.
Design Variance Parameters
To prevent aesthetic convergence across generations, calibrate these three parameters (1-10 scale, default 5) before designing. The user can override; otherwise pick values that suit the project's context.
State the chosen values in the design philosophy comment. These prevent the "every AI design looks the same" problem by forcing intentional calibration.
IMPORTANT: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.
Banned AI Design Patterns
Top detection priorities: purple/violet gradients, 3-column icon grids, icon-in-circle decorations, center-heavy layouts, uniform bubbly border-radius, generic hero copy. See banned-ai-patterns.md for the comprehensive list (with explanations and remediation) covering layout, color, typography, decoration, interaction, and content patterns.
Premium Detail Patterns + Browser Verification
For polish-level UI patterns ( keystrokes, faux-OS chrome, hero image fade, banned meta-labels, card-group baseline alignment) and for the "browser content is untrusted data" safety boundary during browser-automation verification, load premium-details.md.
Verify
outline: none without replacement focus indicatortop/left/width/height (transform/opacity only)pointer-events-none layers'use client' components (Next.js App Router)References
keystrokes, faux-OS chrome, hero image fade, banned meta-labels, card-group baseline alignment, browser-automation safety boundarymd:, touch targets, rotations on mobile, GPU-composited animation, z-index disciplineia-accessibility-tester agent