agentleFS
REPOZYREPOZY/superpowers-optimized/skills/frontend-design/SKILL.md

frontend-design

Skill146 starsChanged 7 months agoMITView on GitHub

MUST USE for any frontend, UI, or web interface implementation. Enforces production-grade visual quality, accessibility, responsive design, and professional polish. Triggers on: "build a UI", "frontend", "website", "landing page", "dashboard", "make it look professional", any React/Vue/Svelte/HTML component work. Routed by using-superpowers, or invoke directly via /frontend-design.

187 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use instantly-campaign, albert-dm and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yawningwhaleAISkill

    instantly-campaign

    Create a new Instantly cold-email campaign in the proven 5-email structure of the user's top-performing campaign (~16% reply rate). Use when the user wants to launch a new outbound campaign, write a cold email sequence, create an Instantly campaign, draft outreach for a new service or niche, or set up a sales sequence.

    Also in 6 projects that use this

  • yawningwhaleAISkill

    albert-dm

    Reply to DMs and messages the way Albert would. Use when the user asks "how would Albert reply to this", pastes a conversation and wants an Albert-style response, or asks you to draft/write a DM in Albert's voice. Albert sells AI voice agents / automations to local service businesses (Go High Level, lead follow-up, bookings).

    Also in 5 projects that use this

  • naman10parikhSkill

    ecosystem-reference

    Quick-access directory of Claude Code ecosystem repos, skills, plugins, MCPs, and patterns. Use when improving the harness.

    Also in 5 projects that use this

  • naman10parikhSkill

    fractal-delegation

    Also in 5 projects that use this

  • julianoczkowskiSkill

    brief-to-tasks

    Break a design brief into an ordered checklist of independently buildable tasks using vertical slices. Saves as a markdown checklist. Use when user wants to break down work, create tasks from a brief, plan implementation order, or mentions "tasks" or "breakdown".

    Also in 7 projects that use this

  • SeifBenayedSkill

    file-reading

    Use this skill when a file has been uploaded but its content is NOT in your context — only its path at /mnt/user-data/uploads/ is listed in an uploaded_files block. This skill is a router: it tells you which tool to use for each file type (pdf, docx, xlsx, csv, json, images, archives, ebooks) so you read the right amount the right way instead of blindly running cat on a binary. Triggers: any mention of /mnt/user-data/uploads/, an uploaded_files section, a file_path tag, or a user asking about an uploaded file you have not yet read. Do NOT use this skill if the file content is already visible in your context inside a documents block — you already have it.

    Also in 6 projects that use this

  • +6 more from naman10parikh

The file

Show its rules and text

We split this skill into the rules it gives an agent

36 rules. 0 are common, 31 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 181 edited versions we read keep these.

  • 31

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check: does the project already have a design system, component library, or style guide?

    line 18
  2. Very specific:

    Look for: tailwind.config, theme.ts/js, tokens.json, design-system/, styles/, existing component library (shadcn, MUI, Chakra, etc.)

    line 19
  3. Distinctive:

    If YES (existing design system):

    line 20
  4. Distinctive:

    Read and reference the existing system.

    line 21
  5. Distinctive:

    Only generate new design tokens if the existing system has clear gaps for the requested feature.

    line 23
  6. Distinctive:

    Before writing any frontend code, walk through this reasoning framework.

    line 29
  7. Distinctive:

    Use the Industry Reference Table (below) as a starting point, then refine based on project specifics.

    line 43
  8. Distinctive:

    Every product type has styles that actively harm it.

    line 55
  9. Distinctive:

    Before writing code, output a brief design system summary:

    line 63
  10. Distinctive:

    Avoid these generic patterns:

    line 87
  11. Distinctive:

    Default SaaS layout (hero + 3 feature cards + testimonials + pricing + footer)

    line 88
  12. Distinctive:

    The test: If the UI could belong to any startup with a search-and-replace on the logo and copy, it has failed.

    line 93
  13. Distinctive:

    Use these as starting points for layout composition — adapt to project needs.

    line 170
  14. Distinctive:

    Every data-dependent view must handle all five states.

    line 187
  15. Distinctive:

    When building a tool with both backend and frontend, these patterns determine perceived quality:

    line 202
  16. Very specific:

    API loading: Every fetch must show loading state immediately, not after a delay.

    line 204
  17. Very specific:

    Use CSS custom properties for all colors: --color-bg, --color-text, --color-surface

    line 218
  18. Distinctive:

    Test all semantic colors (error red, success green, warning amber) against dark backgrounds

    line 222
  19. Distinctive:

    Button labels: Use specific verbs ("Save changes", "Create project", "Send invite") — never generic ("Submit", "OK", "Click here")

    line 240
  20. Distinctive:

    Placeholder text: Use realistic examples ("jane@company.com") not instructions ("Enter your email")

    line 246
  21. Distinctive:

    Never convey information by color alone — add icon or text

    line 260
  22. Distinctive:

    Never rely on hover alone for primary interactions — use click/tap

    line 269
  23. Distinctive:

    Avoid "card spam" — not everything needs a container.

    line 297
  24. Distinctive:

    No horizontal scroll on mobile

    line 307
  25. Very specific:

    Use min-h-dvh instead of 100vh on mobile (accounts for browser chrome)

    line 310
  26. Distinctive:

    Prefer spring/physics-based curves for natural motion feel

    line 332
  27. Distinctive:

    All animations must be interruptible by user interaction

    line 333
  28. Distinctive:

    All key screens reachable via deep link / URL

    line 355
  29. Distinctive:

    Never mix Tab + Sidebar + Bottom Nav at the same hierarchy level

    line 359
  30. Distinctive:

    No pie chart for >5 categories — switch to bar

    line 372
  31. Distinctive:

    All interactive chart elements keyboard-navigable

    line 373
  32. Distinctive:

    When self-reviewing frontend work, fix issues in this order.

    line 380
  33. Distinctive:

    Run this verification gate before declaring any frontend work complete:

    line 388
  34. Distinctive:

    Before scaffolding any CSS framework, check the project's existing setup:

    line 409
  35. Very specific:

    Read tailwind-v4.md before writing any Tailwind setup, config, or utility classes for:

    line 418
  36. Distinctive:

    When the user cares about premium visual quality, brand alignment, or accessibility

    line 429

“Common” is measured: kept by at least 6 in 10 of the 181 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Professional Frontend Design

This skill transforms generic AI-generated UIs into production-grade, visually distinctive interfaces. It provides a design reasoning framework, industry-aware style selection, and concrete engineering standards.

Scope Gate — Before Anything Else

  1. Check: does the project already have a design system, component library, or style guide?
    • Look for: tailwind.config, theme.ts/js, tokens.json, design-system/, styles/, existing component library (shadcn, MUI, Chakra, etc.)
  2. If YES (existing design system):
    • Read and reference the existing system. Do NOT generate a new one.
    • Skip to "Quality Standards" section — apply those standards within the existing design framework.
    • Only generate new design tokens if the existing system has clear gaps for the requested feature.
  3. If NO (greenfield):
    • Proceed with full Design System Generation below.

Design System Generation

Before writing any frontend code, walk through this reasoning framework. The goal is to make deliberate design decisions — not default to generic blue-and-white SaaS templates.

Step 1: Analyze Requirements

Identify these before choosing any visual direction:

  • Product type — What category? (SaaS, e-commerce, dashboard, portfolio, etc.)
  • Audience — Who uses this? (developers, executives, consumers, elderly, children)
  • Platform — Web, mobile, desktop, or cross-platform?
  • Constraints — Existing brand guidelines? Required framework? Accessibility level (AA/AAA)?
  • Trust sensitivity — How much does visual credibility matter? (critical for finance/healthcare, lower for playful apps)
  • Primary user goal — What does the user come here to do? (scan, convert, explore, act)

Step 2: Select Design Direction

Use the Industry Reference Table (below) as a starting point, then refine based on project specifics.

Choose explicitly:

  • Style — The visual language (glassmorphism, brutalism, flat, etc.)
  • Color mood — Emotional tone (trust blue, energetic orange, calm pastels, dark OLED)
  • Typography mood — Character (professional, playful, editorial, technical)
  • Key effects — Signature interactions (hover lifts, parallax, scroll reveals, blur)
  • Density level — Compact (data-dense, minimal padding), balanced (standard), or spacious (generous whitespace, editorial feel)
  • Visual anchor — What element draws the eye first? (hero metric, primary CTA, key image, headline)

Step 3: Define Anti-Patterns

Every product type has styles that actively harm it. Name them explicitly before implementation:

  • Finance: playful colors, excessive animation, dark mode by default
  • Healthcare: bright neon, motion-heavy, low contrast
  • Creative agency: corporate minimalism, generic templates
  • Government: ornate design, low contrast, motion effects

Step 4: Output Design Summary

Before writing code, output a brief design system summary:

**Design System**: [Product] — [Style]
**Colors**: [Primary] / [Accent] / [Neutral] / [Semantic]
**Typography**: [Heading font] + [Body font] — [Scale]
**Effects**: [Key interactions]
**Avoid**: [Named anti-patterns]

This takes 30 seconds and prevents hours of rework from misaligned visual direction.


Distinctiveness Enforcement

Most AI-generated UIs fail here. They're technically correct but visually forgettable — the same blue-and-white SaaS template with rounded cards and a gradient hero. Professional UIs have identity.

The UI must include at least one of these distinctiveness signals:

  • Strong typography decision — A deliberate scale, weight contrast, or editorial type treatment that gives the interface character
  • Distinctive layout structure — Something beyond standard stacked sections (asymmetric grid, bento layout, split-screen, offset columns)
  • Controlled visual motif — A repeating design element (border system, grid pattern, spacing rhythm, accent shape) that ties the interface together
  • Deliberate density choice — Intentionally compact for data-rich contexts, or intentionally spacious for editorial/luxury feel — not just "default padding"

Avoid these generic patterns:

  • Default SaaS layout (hero + 3 feature cards + testimonials + pricing + footer)
  • Random gradients without structural purpose
  • Card grids where every card has equal visual weight
  • "Pleasant but forgettable" — passes review but has no identity

The test: If the UI could belong to any startup with a search-and-replace on the logo and copy, it has failed. The design direction chosen in Step 2 should be visible in the final output.


Style Reference

25 styles with key characteristics. Use this to select and combine styles — most projects blend 1-2 primary styles.

StyleKey CharacteristicsBest ForAvoid When
Minimalism / SwissMonochromatic, geometric grid, essential elements onlyEnterprise, dashboards, toolsPlayful brands, children's products
Glassmorphismbackdrop-filter: blur(10-20px), translucent overlays, vibrant backgroundsModern SaaS, fintech dashboardsLow-performance targets, print
Brutalism / NeubrutalismBold borders 2-4px, primary colors, thick offset shadows, no gradientsCreative agencies, portfolios, Gen-ZCorporate, healthcare, finance
Neumorphism / Soft UIDual shadows (light+dark), embossed/debossed, monochromatic, roundedWellness, smart home, controlsData-dense, text-heavy, low contrast risk
ClaymorphismSoft 3D, thick borders 3-4px, double shadows, rounded 16-24pxEducational, children's, playful appsCorporate, legal, finance
Dark Mode (OLED)Deep black #000, dark grey #121212, neon accents, high contrastStreaming, dev tools, gaming, fintechPrint content, elderly users
Flat Design2D, bold colors, no shadows, clean lines, icon-heavyCross-platform, complex dashboardsWhere depth/hierarchy is critical
Bento Box GridModular cards, asymmetric grid, varied sizes, Apple-styleProduct showcases, feature pagesSimple single-column content
Aurora UIVibrant gradients, northern lights, 8-12s ambient animationsCreative, AI platforms, luxuryPerformance-constrained, accessibility-critical
Motion-DrivenScroll effects, parallax 3-5 layers, 300-400ms transitionsStorytelling, portfolios, agenciesMotion-sensitive users, data tools
Hero-CentricFull-viewport hero, compelling headline, high-contrast CTALanding pages, product launchesMulti-feature pages, dashboards
Conversion-OptimizedSingle CTA focus, minimal distractions, trust signals, form-centricLead gen, signups, pricing pagesContent sites, portfolios
Feature Showcase3-4 column grid, benefit cards, interactive elementsSaaS feature pages, product toursSimple products, single-function tools
Data-Dense DashboardMultiple charts, KPI cards, data tables, minimal padding, gridBI/analytics, monitoring, adminConsumer apps, marketing sites
Executive DashboardLarge metrics, summary KPIs, minimal detail, whitespaceC-suite reporting, high-level viewsDrill-down analysis, operations
Real-Time MonitoringLive data, status indicators, alert pulses, streaming chartsDevOps, IoT, trading, operationsStatic content, marketing
Editorial / MagazineAsymmetric grid, pull quotes, drop caps, CSS Grid columnsBlogs, news, long-form contentDashboards, tools, e-commerce
Organic BiophilicNature-inspired, organic shapes, earth tones, flowing SVGSustainability, wellness, eco brandsTech-forward, cybersecurity
AI-Native UIConversational, minimal chrome, streaming text, typing indicatorsChatbots, AI assistants, voiceData-heavy, multi-panel interfaces
Exaggerated MinimalismOversized type clamp(3rem, 8vw, 12rem), extreme whitespaceFashion, luxury, art, editorialDense information, dashboards
Pixel Art / Retro8-bit aesthetic, blocky, pixelated fonts, nostalgic paletteGaming, indie, retro brandsProfessional services, healthcare
E-Ink / PaperPaper-like texture, high contrast, monochrome, reading-focusedReading apps, documentation, notesDynamic content, media-heavy
Spatial UI (VisionOS)Glass panels, depth layers, translucent, immersiveXR/VR interfaces, spatial computing2D-only contexts, accessibility-first
CyberpunkNeon on black, terminal/HUD, glitch effects, monospaceGaming, security, crypto, dev toolsConservative brands, elderly users
Swiss Modernism 2.0Strict grid, Helvetica/Inter, modular, 12-column, WCAG AAAGovernment, education, documentationCreative/expressive brands

Industry Design Reference

Recommended design direction by product category. Use as a starting point — adapt to specific project needs.

CategoryStyleColor MoodTypographyEffectsAnti-Patterns
SaaSGlassmorphism + FlatTrust blue, accent contrastProfessional, clear hierarchySubtle hover 200ms, smooth transitionsExcessive animation, dark mode default
E-commerceVibrant + Feature ShowcaseBrand primary, success greenEngaging, clear hierarchyCard hover lift 200ms, scaleFlat without depth, text-heavy pages
E-commerce LuxuryLiquid Glass + GlassmorphismPremium minimal, gold accentElegant serif + refined sansSlow animations 400-600ms, parallaxVibrant block colors, playful tones
HealthcareNeumorphism + AccessibleCalm blue, health greenReadable, large 16px+Soft shadows, smooth press 150msBright neon, motion-heavy, low contrast
EducationalClaymorphism + Micro-interactionsPlayful, clear hierarchyFriendly, engagingSoft press 200ms, progress animationsDark modes, complex jargon
Financial DashboardDark Mode + Data-DenseDark bg, red/green alerts, trust blueClear, readable monoReal-time number animations, alert pulseLight mode default, slow rendering
Analytics DashboardData-Dense + Heat MapCool-to-hot gradients, neutral greyFunctional, monospace dataHover tooltips, chart zoom, filtersOrnate design, no filtering
Creative AgencyBrutalism + Motion-DrivenBold primaries, artistic freedomBold, expressive, variableCRT scanlines, neon glow, glitchCorporate minimalism, hidden portfolio
PortfolioMotion-Driven + MinimalismBrand primary, artisticExpressive, variable weightParallax 3-5 layers, scroll revealsCorporate templates, generic layouts
Fitness/GymVibrant + Dark ModeEnergetic orange #FF6B35, dark bgBold, motivationalProgress rings, achievement unlocksStatic design, no gamification
Restaurant/FoodVibrant + Motion-DrivenWarm orange/red/brownAppetizing, clearFood image reveals, menu hoverLow-quality imagery, outdated info
Real EstateGlassmorphism + MinimalismTrust blue, gold, whiteProfessional, confident3D property tour, map hoverPoor photos, no virtual tours
TravelAurora UI + Motion-DrivenVibrant destination, sky blueInspirational, engagingDestination parallax, itinerary animationsGeneric photos, complex booking
News/MediaMinimalism + FlatBrand + high contrastClear, readable serif/sansBreaking news badges, article revealsCluttered layout, slow loading
AI/ChatbotAI-Native + MinimalismNeutral, AI purple #6366F1Modern, clearStreaming text, typing indicators, fade-inHeavy chrome, slow response feedback
Developer ToolDark Mode + MinimalismSyntax theme, blue focusMonospace, functionalSyntax highlighting, command paletteLight mode default, slow performance
ProductivityFlat + Micro-interactionsClear hierarchy, functionalClean, efficientQuick actions 150ms, task animationsComplex onboarding, slow performance
Social MediaVibrant + Motion-DrivenVibrant engagement colorsModern, boldScroll animations, icon animationsHeavy skeuomorphism, poor a11y
Gaming3D + Retro-FuturismVibrant, neon, immersiveBold, impactfulWebGL, glitch effectsMinimalist design, static assets
Non-profitAccessible + OrganicCause-related, trust, warmHeartfelt, readableImpact counters, story revealsNo impact data, hidden financials
LegalTrust & Authority + MinimalNavy #1E3A5F, gold, whiteProfessional, authoritativePractice area reveals, credential displayOutdated design, hidden credentials
BankingMinimalism + AccessibleNavy, trust blue, goldProfessional, trustworthyNumber animations, security indicatorsPlayful design, poor security UX
Music StreamingDark Mode + VibrantDark #121212, vibrant accentsModern, boldWaveform visualization, playlist animationsCluttered layout, poor audio player
Video StreamingDark Mode + Motion-DrivenDark bg, poster colors, brandBold, engagingVideo player, content carousel parallaxStatic layout, slow video player
Job BoardFlat + MinimalismProfessional blue, success greenClear, professionalSearch/filter animations, application flowOutdated forms, hidden filters
MarketplaceVibrant + FlatTrust colors, category colorsModern, engagingReview animations, listing hoverLow trust signals, confusing layout
Smart Home/IoTGlassmorphism + Dark ModeDark, status indicator colorsClear, functionalDevice status pulse, quick actionsSlow updates, no automation
GovernmentAccessible + MinimalismProfessional blue, high contrastClear, large typeFocus rings 3-4px, skip linksOrnate design, low contrast, motion

Common Page Structures

Use these as starting points for layout composition — adapt to project needs.

Page TypeStructureKey Components
SaaS DashboardCollapsible sidebar + top bar + main gridStat cards, charts, data tables, activity feed, filters
Landing PageHero → social proof → features → how-it-works → pricing → CTA → footerHero with CTA, testimonial carousel, feature grid, pricing cards
Admin PanelFixed sidebar + breadcrumb top bar + content areaCRUD tables with sort/filter/search, detail drawers, bulk actions
E-commerce ProductSticky nav + image gallery + details + relatedImage carousel, variant selector, add-to-cart, reviews, recommendations
DocumentationLeft nav + main content + right TOC (sticky)Search, version switcher, code blocks with copy, prev/next nav
Blog / EditorialTop nav + hero article + content + sidebarFeatured image, reading time, table of contents, share buttons, related
Settings / ProfileSidebar tabs or top tabs + form sectionsSection nav, form groups, save/cancel, danger zone at bottom
Auth FlowCentered card, minimal chromeLogo, form, social login, link to alt flow (signup↔login), error inline

UI States

Every data-dependent view must handle all five states. Shipping only the success state is the single most common quality gap in AI-generated UIs.

StateWhat to ShowImplementation
LoadingSkeleton shimmer matching content layout — never a blank screen or spinner aloneSkeleton components that mirror the final layout shape
ErrorWhat went wrong + how to fix it + retry actionError boundary (React) or error component; include retry button
EmptyHelpful message + primary action to populateIllustration optional; clear CTA ("Create your first project")
SuccessThe actual content, fully interactiveDefault state — but don't forget the other four
Partial / DegradedAvailable data + indicator for what's missing or stale"Last updated 5m ago" badge, greyed-out sections, retry for failed parts
PendingUser-triggered async action in progressInline spinner or progress indicator on the triggering element, disable re-trigger, revert UI on failure

Frontend-Backend Integration

When building a tool with both backend and frontend, these patterns determine perceived quality:

  • API loading: Every fetch must show loading state immediately, not after a delay. Use useSWR, react-query, or equivalent for cache + revalidation.
  • Optimistic updates: For user-initiated mutations (toggle, delete, reorder), update the UI immediately and roll back on failure. Waiting for the server round-trip feels sluggish.
  • Error boundaries: Wrap route segments in error boundaries so one failed API call doesn't crash the entire page. Show a localized error with retry, not a white screen.
  • Auth flow: Login/signup → redirect to intended destination (not always home). Show auth state in nav (avatar/menu). Handle token expiry gracefully (refresh silently, prompt re-login only when needed).
  • Real-time updates: For dashboards/chat, use WebSocket or SSE with reconnection logic. Show connection status indicator. Degrade gracefully to polling if WS fails.
  • Form submissions: Disable submit button during request, show inline progress, display success confirmation or inline errors. Never navigate away without confirming unsaved changes.
  • Pagination / infinite scroll: Show count ("1-25 of 342"), maintain scroll position on back-nav, use cursor-based pagination for real-time data.

Dark Mode Implementation

When the project needs dark mode, implement it properly — not as an afterthought. But first, evaluate whether dark mode is actually appropriate for the product. Not every interface benefits from it — light mode is often the right default for content-heavy, trust-sensitive, or general-audience products. Do not add dark mode just because it's trendy.

  • Use CSS custom properties for all colors: --color-bg, --color-text, --color-surface
  • Apply via prefers-color-scheme media query for system default + class toggle for user override
  • Dark mode is NOT inverted colors — use desaturated, lighter tonal variants with adjusted contrast
  • Shadows become less visible in dark mode — use border or elevated surface colors instead
  • Test all semantic colors (error red, success green, warning amber) against dark backgrounds
  • Store user preference in localStorage; respect system preference as default

Design Token Scales

Beyond color and spacing tokens (covered in Quality Standards §6), define these additional token scales to prevent ad-hoc values:

  • Radius scale — Border radius values tied to the design direction (e.g., --radius-sm: 4px, --radius-md: 8px, --radius-lg: 16px). A brutalist design uses sharp radii; glassmorphism uses larger values.
  • Elevation scale — Shadow definitions for consistent depth (e.g., --shadow-sm, --shadow-md, --shadow-lg). These must match the chosen style — flat design uses none, neumorphism uses dual light/dark shadows.

Micro-Copy & UX Writing

Words are UI. Bad copy makes good design feel broken.

  • Button labels: Use specific verbs ("Save changes", "Create project", "Send invite") — never generic ("Submit", "OK", "Click here")
  • Error messages: State the cause + the fix ("Email is already registered — try logging in instead") — never just "Invalid input" or "Error occurred"
  • Empty states: Tell the user what this space is for + how to fill it ("No projects yet. Create your first project to get started.")
  • Confirmation dialogs: Name the destructive action ("Delete 3 files permanently?") — never "Are you sure?"
  • Loading text: Describe what's happening if it takes >3s ("Loading your dashboard..." not just a spinner)
  • Success feedback: Confirm what happened ("Project created" not "Success")
  • Placeholder text: Use realistic examples ("jane@company.com") not instructions ("Enter your email")

Quality Standards

1. Accessibility (CRITICAL)

  • Contrast minimum 4.5:1 normal text, 3:1 large text (WCAG AA)
  • focus-visible rings 2-4px on all interactive elements — never outline: none without a visible replacement
  • alt text for meaningful images; empty alt="" for decorative
  • aria-label on icon-only buttons and links
  • Tab order matches visual order; all interactive elements keyboard-operable
  • Sequential heading hierarchy h1→h6, no level skip; one h1 per page
  • Never convey information by color alone — add icon or text
  • @media (prefers-reduced-motion: reduce) guard on every animation/transition
  • Skip-to-content link on every page
  • Semantic HTML: <nav>, <main>, <article>, <section>, <button> — never <div onclick>

2. Touch & Interaction (CRITICAL)

  • Minimum 44x44px touch targets (Apple HIG) / 48x48dp (Material)
  • 8px+ gap between adjacent touch targets
  • Never rely on hover alone for primary interactions — use click/tap
  • Loading buttons: disable during async operations, show spinner
  • Visual tap feedback within 100ms
  • touch-action: manipulation on interactive elements to remove 300ms tap delay
  • Respect safe areas for notch, Dynamic Island, gesture bars
  • Cursor: pointer on all clickable elements (web)

3. Performance (HIGH)

  • Images: WebP/AVIF format, responsive srcset/sizes
  • loading="lazy" on all below-fold images
  • Declare width/height or aspect-ratio on images/media to prevent CLS
  • font-display: swap or optional; preload only critical fonts
  • Lazy load non-hero components via dynamic import / route splitting
  • Reserve space for async content — no layout jumps (CLS < 0.1)
  • Virtualize lists with 50+ items (react-virtual, tanstack-virtual)
  • Skeleton screens or shimmer for operations exceeding 300ms
  • Critical CSS inlined or early-loaded for above-the-fold content

4. Style Consistency (HIGH)

  • Match style to product type using the Industry Reference Table
  • SVG icon libraries (Heroicons, Lucide, Phosphor) — never emoji as icons
  • One icon set and visual language across the entire product
  • Consistent elevation/shadow scale for cards, sheets, modals
  • Design light and dark variants together — test contrast separately
  • One primary CTA per screen; secondary actions visually subordinate
  • Effects (shadows, blur, radius) must align with chosen style
  • Avoid "card spam" — not everything needs a container. Use spacing and typography to group related content instead of wrapping everything in bordered boxes
  • Visual hierarchy must not rely only on color — use size, weight, spacing, and position to establish importance

5. Layout & Responsive (HIGH)

  • Mobile-first: base styles target small screens, min-width media queries scale up
  • <meta name="viewport" content="width=device-width, initial-scale=1"> — never disable zoom
  • Systematic breakpoints: 375 / 768 / 1024 / 1440
  • Minimum 16px body text on mobile (prevents iOS auto-zoom)
  • Line length: 35-60 chars mobile, 60-75 chars desktop (max-width: 65ch)
  • No horizontal scroll on mobile
  • 4pt/8dp spacing rhythm throughout; consistent spacing scale
  • max-width container on desktop (e.g., max-w-7xl)
  • Use min-h-dvh instead of 100vh on mobile (accounts for browser chrome)
  • Consistent z-index scale: 0 / 10 / 20 / 40 / 100 / 1000
  • Layout should adapt hierarchy on different breakpoints, not just stack columns — what's a sidebar on desktop might become a bottom sheet on mobile, not just a collapsed column

6. Typography & Color (MEDIUM)

  • Design tokens as CSS custom properties: --color-primary, --spacing-md, --font-size-base
  • Semantic color tokens (primary, secondary, error, surface, on-surface) — no raw hex in components
  • Fluid typography with clamp(): e.g., clamp(1rem, 0.5rem + 1.5vw, 1.25rem)
  • Consistent type scale: 12 / 14 / 16 / 18 / 24 / 32 / 48
  • Line-height 1.5-1.75 for body text; 1.1-1.3 for headings
  • Font weight hierarchy: bold headings 600-700, regular body 400, medium labels 500
  • Dark mode: desaturated/lighter tonal variants — never just invert colors
  • Tabular/monospaced figures for data columns, prices, timers

7. Animation (MEDIUM)

  • Micro-interactions: 150-300ms; complex transitions: ≤400ms; never >500ms
  • Animate only transform and opacity — never width, height, top, left
  • ease-out for entering elements, ease-in for exiting
  • Exit animations ~60-70% of enter duration for responsive feel
  • Stagger list/grid item entrance: 30-50ms per item
  • Prefer spring/physics-based curves for natural motion feel
  • All animations must be interruptible by user interaction
  • Maximum 1-2 animated elements per view at once
  • Skeleton/progress indicator for any load exceeding 300ms

8. Forms & Feedback (MEDIUM)

  • Visible <label> per input — never placeholder-only labels
  • Error messages below the related field, not only at form top
  • Validate on blur, not on each keystroke
  • Required fields: asterisk indicator + required attribute
  • Helper text below complex inputs (persistent, not tooltip-only)
  • Disabled state: opacity 0.38-0.5 + cursor: not-allowed + semantic disabled
  • Progressive disclosure: reveal complex options only when relevant
  • Confirm before destructive actions (delete, discard, overwrite)
  • Auto-save for long forms to prevent data loss
  • Toast auto-dismiss 3-5s; use aria-live="polite" for screen readers
  • Error messages must state cause + how to fix (not just "Invalid input")

9. Navigation (HIGH)

  • Bottom nav: max 5 items, each with icon + text label
  • Back behavior must preserve scroll position and filter/input state
  • All key screens reachable via deep link / URL
  • Current location visually highlighted in navigation
  • Modals/sheets: clear close/dismiss affordance; swipe-down on mobile
  • Large screens (≥1024px): prefer sidebar nav; small screens: bottom/top nav
  • Never mix Tab + Sidebar + Bottom Nav at the same hierarchy level
  • Route change: move focus to main content region for screen readers
  • Drawer/sidebar for secondary navigation, not primary actions

10. Charts & Data Visualization (LOW)

  • Match chart type to data: trend→line, comparison→bar, proportion→pie/donut
  • Accessible color palettes + pattern/texture supplements (not color-only)
  • Provide data table alternative for screen readers
  • Legend visible near chart, not below scroll fold
  • Tooltips on hover (web) / tap (mobile) showing exact values
  • Responsive: simplify on small screens (horizontal bar, fewer ticks)
  • Skeleton/shimmer placeholder while chart data loads
  • No pie chart for >5 categories — switch to bar
  • All interactive chart elements keyboard-navigable
  • aria-label summary describing the chart's key insight

Post-Build Fix Priority

When self-reviewing frontend work, fix issues in this order. Earlier items affect everything downstream — fixing color before structure wastes effort.

structure → hierarchy → spacing → typography → color → interaction → polish


Pre-Delivery Checklist

Run this verification gate before declaring any frontend work complete:

  • All interactive elements keyboard accessible
  • Color contrast meets WCAG AA (4.5:1 text, 3:1 large text)
  • Touch targets ≥44px with 8px+ gaps
  • No horizontal scroll at 375px width
  • prefers-reduced-motion media query on all animations
  • Semantic HTML throughout (no <div onclick>, proper heading hierarchy)
  • Loading/skeleton states for all async content
  • Error states for all data-dependent views
  • Empty states with helpful message + action
  • Dark mode tested if applicable (contrast, readability, brand)
  • Responsive tested at 375px, 768px, 1024px, 1440px
  • UI does not look like a generic AI template
  • Visual hierarchy is clear within 3 seconds of scanning
  • One clear primary action per major section

Framework & Version Awareness

Before scaffolding any CSS framework, check the project's existing setup:

  1. Existing project — inspect package.json and CSS entry files to detect the current framework and major version. Use whatever version is already in use. Do not silently upgrade.
  2. Greenfield project — default to the latest stable major version of the chosen framework. State the version explicitly before writing any setup code ("Using Tailwind CSS v4.x").
  3. Ambiguous version — ask the user before writing setup code. Major version differences have breaking setup patterns.
  4. Never mix major version patterns — v3 config syntax + v4 CSS directives = broken build.

Tailwind CSS

Read tailwind-v4.md before writing any Tailwind setup, config, or utility classes for:

  • Greenfield projects choosing Tailwind
  • Projects where the Tailwind version is unknown

Training data is biased toward v3 patterns. tailwind-v4.md contains the correct v4 installation commands, @theme config syntax, renamed class scales, and new features that v3 training will get wrong.


When to Use in Superpowers

  • During executing-plans or subagent-driven-development when tasks involve UI/frontend
  • When the user cares about premium visual quality, brand alignment, or accessibility
  • Apply the Design System Generation framework before implementation begins
  • Recommend an appropriate stack guided by user constraints (e.g., Next.js + Tailwind + Radix, Svelte + skeleton UI, plain HTML + CSS for simple sites)

Supporting References

  • tailwind-v4.md — Tailwind CSS v4 installation, configuration, class name changes from v3, and new features. Read before any Tailwind work on greenfield or version-unknown projects.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.