FrontendDesign
Production-quality frontend engineering standards. Ensures UI output looks like it was built by a design-aware engineer, not generated by AI.
Customization
Before executing, check for user customizations at:
${PAI_USER_DIR}/SKILLCUSTOMIZATIONS/FrontendDesign/
Workflow Routing
| Workflow |
Trigger |
File |
| DesignReview |
"design review", "review UI", "check accessibility", "review frontend" |
Workflows/DesignReview.md |
| BuildWebsite |
"build website", "create website", "landing page", "portfolio site" |
→ Route to WebsiteFactory skill (separate skill, uses this skill's Core Principles as pre-flight) |
Aesthetic Presets (pick ONE per project)
| Preset |
Skill |
Vibe |
| Default premium |
../Aesthetics/taste-skill |
Metric-based rules, GSAP/ThreeJS, bento grids |
| Luxury/agency |
../Aesthetics/soft-skill |
Exact fonts, expensive shadows, agency feel |
| Industrial/raw |
../Aesthetics/brutalist-skill |
Swiss typography, military terminal, declassified |
| Editorial/clean |
../Aesthetics/minimalist-skill |
Warm monochrome, flat grids, muted pastels |
| Upgrade existing |
../Aesthetics/redesign-skill |
Audit + fix in-place, no rewrite |
These are CSS-level presets. This skill's Design Thinking and Anti-AI-Slop principles apply on top of whichever preset is chosen.
Context Files
| File |
Content |
AccessibilityGuidelines.md |
WCAG 2.1 AA compliance, keyboard nav, ARIA |
ResponsivePatterns.md |
Breakpoints, mobile-first, viewport fitting |
ComponentPatterns.md |
Architecture, anti-AI-slop rules, state management |
Quality References (shared with other skills)
${SKILLS_HOME}/Utilities/References/accessibility-checklist.md — WCAG 2.1 AA quick checklist
${SKILLS_HOME}/Utilities/References/performance-checklist.md — Core Web Vitals checklist
Core Principles
Design Thinking (from official Anthropic frontend-design skill)
Before coding, understand the context and commit to a BOLD aesthetic direction:
- Purpose: What problem does this interface solve? Who uses it?
- Tone: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc.
- Constraints: Technical requirements (framework, performance, accessibility).
- Differentiation: What makes this UNFORGETTABLE? What's the one thing someone will remember?
CRITICAL: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work — the key is intentionality, not intensity.
Frontend Aesthetics Guidelines (from official Anthropic frontend-design skill)
- Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt for distinctive, characterful choices. Pair a distinctive display font with a refined body font.
- Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
- Motion: Prioritize CSS-only solutions for HTML. Use Motion library for React. Focus on high-impact moments: one well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
- Spatial Composition: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.
- 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, grain overlays.
Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code. Minimalist designs need restraint, precision, and attention to spacing and typography.
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.
Anti-AI-Slop Rules
UI must NOT look AI-generated. Avoid these patterns:
- Excessive gradients (especially purple-to-blue defaults)
- Oversized padding and rounded corners on everything
- Uniform card grids with identical spacing
- Generic stock layouts (hero + 3 cards + CTA)
- Default shadcn/ui styling without customization
- Decoration over function
- Overused font families (Inter, Roboto, Arial, system fonts)
- Cookie-cutter design that lacks context-specific character
Instead: Use the project's actual color palette, match existing design language, prioritize content density over whitespace padding. Interpret creatively and make unexpected choices that feel genuinely designed for the context.
Component Architecture
- Colocate related files (component + styles + tests + types together)
- Prefer composition over configuration (children > props for layout)
- Keep components under 200 lines — split when logic or rendering gets complex
- Separate data fetching from presentation (container/presentational pattern)
- Extract reusable logic into hooks, not HOCs
State Management
Use the simplest appropriate tool:
| State Type |
Tool |
When |
| Component UI |
useState / useReducer |
Toggle, form input, open/close |
| Cross-cutting read-heavy |
React Context |
Theme, locale, auth status |
| URL-synced |
URL params / searchParams |
Filters, pagination, tabs |
| Server/remote |
TanStack Query / SWR |
API data, cache, mutations |
| Complex client |
Zustand / Jotai |
Multi-component shared state |
Avoid: Prop drilling beyond 3 levels. Global state for local concerns.
Responsive Design
Mobile-first — start with smallest viewport, enhance upward.
| Breakpoint |
Target |
Priority |
| 320px |
Small phone |
Must work |
| 768px |
Tablet |
Must work |
| 1024px |
Laptop |
Must work |
| 1440px |
Desktop |
Should work |
- Use CSS Grid/Flexbox, not absolute positioning
- Test touch targets (min 44x44px on mobile)
- Use
rem/em units, not px for typography
- Images: responsive srcset + explicit width/height (prevents CLS)
Content Density (from zarazhangrui/frontend-slides)
- Viewport fitting: content should fill the viewport without scrolling where possible
- Style presets: offer 2-3 density options (compact/normal/spacious)
- Limit content per section: 3-5 key points, not walls of text
- Visual hierarchy through typography scale, not color alone
Red Flags
Examples
Example 1: Building a dashboard component
User: "Build a task dashboard with filters and a table"
→ Loads ComponentPatterns.md for architecture
→ Applies anti-slop rules (no purple gradients, no generic cards)
→ Builds mobile-first with responsive breakpoints
→ Verifies keyboard navigation and ARIA labels
Example 2: Design review of HTML output
User: "Review this HTML page for quality"
→ Invokes DesignReview workflow
→ Checks 5 axes: visual quality, accessibility, responsiveness, architecture, performance
→ Classifies findings by severity
Example 3: Fixing AI-generated UI
User: "This looks too AI-generated, make it professional"
→ Loads ComponentPatterns.md anti-slop table
→ Replaces generic patterns with project-specific design choices
→ Fixes typography, spacing scale, color palette
Integration
Works with:
- VisualExplainer — HTML diagram/visualization generation
- ScientificDeck-HTML — HTML slide generation
- Designer agent — spawns with FrontendDesign context
- Algorithm VERIFY — HTML output quality check
1---2name: frontenddesign3description: Frontend UI engineering and aesthetic standards — design thinking, anti-AI-slop rules, component architecture, responsive design, accessibility, and design review. Incorporates official Anthropic frontend-design skill aesthetics. USE WHEN building UI, generating HTML, frontend work, design review, component architecture, responsive design, anti-slop, design system, WCAG, accessibility review, build web component, build page, build application.4---56# FrontendDesign78Production-quality frontend engineering standards. Ensures UI output looks like it was built by a design-aware engineer, not generated by AI.910## Customization1112**Before executing, check for user customizations at:**13`${PAI_USER_DIR}/SKILLCUSTOMIZATIONS/FrontendDesign/`1415<!-- ## Voice Notification16```bash17curl -s -X POST http://localhost:8888/notify \18 -H "Content-Type: application/json" \19 -d '{"message": "Running WORKFLOWNAME in FrontendDesign to ACTION"}' \20 > /dev/null 2>&1 &21```22-->2324## Workflow Routing2526| Workflow | Trigger | File |27|----------|---------|------|28| **DesignReview** | "design review", "review UI", "check accessibility", "review frontend" | `Workflows/DesignReview.md` |29| **BuildWebsite** | "build website", "create website", "landing page", "portfolio site" | → Route to `WebsiteFactory` skill (separate skill, uses this skill's Core Principles as pre-flight) |3031## Aesthetic Presets (pick ONE per project)3233| Preset | Skill | Vibe |34|--------|-------|------|35| **Default premium** | `../Aesthetics/taste-skill` | Metric-based rules, GSAP/ThreeJS, bento grids |36| **Luxury/agency** | `../Aesthetics/soft-skill` | Exact fonts, expensive shadows, agency feel |37| **Industrial/raw** | `../Aesthetics/brutalist-skill` | Swiss typography, military terminal, declassified |38| **Editorial/clean** | `../Aesthetics/minimalist-skill` | Warm monochrome, flat grids, muted pastels |39| **Upgrade existing** | `../Aesthetics/redesign-skill` | Audit + fix in-place, no rewrite |4041These are CSS-level presets. This skill's Design Thinking and Anti-AI-Slop principles apply on top of whichever preset is chosen.4243## Context Files4445| File | Content |46|------|---------|47| `AccessibilityGuidelines.md` | WCAG 2.1 AA compliance, keyboard nav, ARIA |48| `ResponsivePatterns.md` | Breakpoints, mobile-first, viewport fitting |49| `ComponentPatterns.md` | Architecture, anti-AI-slop rules, state management |5051## Quality References (shared with other skills)5253- `${SKILLS_HOME}/Utilities/References/accessibility-checklist.md` — WCAG 2.1 AA quick checklist54- `${SKILLS_HOME}/Utilities/References/performance-checklist.md` — Core Web Vitals checklist5556## Core Principles5758### Design Thinking (from official Anthropic frontend-design skill)5960Before coding, understand the context and commit to a BOLD aesthetic direction:61- **Purpose**: What problem does this interface solve? Who uses it?62- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc.63- **Constraints**: Technical requirements (framework, performance, accessibility).64- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?6566**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work — the key is intentionality, not intensity.6768### Frontend Aesthetics Guidelines (from official Anthropic frontend-design skill)6970- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt for distinctive, characterful choices. Pair a distinctive display font with a refined body font.71- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.72- **Motion**: Prioritize CSS-only solutions for HTML. Use Motion library for React. Focus on high-impact moments: one well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.73- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.74- **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, grain overlays.7576Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code. Minimalist designs need restraint, precision, and attention to spacing and typography.7778No 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.7980### Anti-AI-Slop Rules8182UI must NOT look AI-generated. Avoid these patterns:83- Excessive gradients (especially purple-to-blue defaults)84- Oversized padding and rounded corners on everything85- Uniform card grids with identical spacing86- Generic stock layouts (hero + 3 cards + CTA)87- Default shadcn/ui styling without customization88- Decoration over function89- Overused font families (Inter, Roboto, Arial, system fonts)90- Cookie-cutter design that lacks context-specific character9192**Instead:** Use the project's actual color palette, match existing design language, prioritize content density over whitespace padding. Interpret creatively and make unexpected choices that feel genuinely designed for the context.9394### Component Architecture9596- Colocate related files (component + styles + tests + types together)97- Prefer composition over configuration (children > props for layout)98- Keep components under 200 lines — split when logic or rendering gets complex99- Separate data fetching from presentation (container/presentational pattern)100- Extract reusable logic into hooks, not HOCs101102### State Management103104Use the simplest appropriate tool:105106| State Type | Tool | When |107|-----------|------|------|108| Component UI | `useState` / `useReducer` | Toggle, form input, open/close |109| Cross-cutting read-heavy | React Context | Theme, locale, auth status |110| URL-synced | URL params / searchParams | Filters, pagination, tabs |111| Server/remote | TanStack Query / SWR | API data, cache, mutations |112| Complex client | Zustand / Jotai | Multi-component shared state |113114**Avoid:** Prop drilling beyond 3 levels. Global state for local concerns.115116### Responsive Design117118**Mobile-first** — start with smallest viewport, enhance upward.119120| Breakpoint | Target | Priority |121|-----------|--------|----------|122| 320px | Small phone | Must work |123| 768px | Tablet | Must work |124| 1024px | Laptop | Must work |125| 1440px | Desktop | Should work |126127- Use CSS Grid/Flexbox, not absolute positioning128- Test touch targets (min 44x44px on mobile)129- Use `rem`/`em` units, not `px` for typography130- Images: responsive srcset + explicit width/height (prevents CLS)131132### Content Density (from zarazhangrui/frontend-slides)133134- Viewport fitting: content should fill the viewport without scrolling where possible135- Style presets: offer 2-3 density options (compact/normal/spacious)136- Limit content per section: 3-5 key points, not walls of text137- Visual hierarchy through typography scale, not color alone138139## Red Flags140141- [ ] Components > 200 lines142- [ ] Inline styles or arbitrary pixel values143- [ ] Missing loading/error/empty states144- [ ] No keyboard navigation145- [ ] Color as sole state indicator146- [ ] Generic AI aesthetic (purple gradients, oversized padding)147- [ ] No responsive testing148- [ ] `tabindex > 0` (breaks natural tab order)149- [ ] `div` used as button (not focusable, no keyboard support)150151## Examples152153**Example 1: Building a dashboard component**154```155User: "Build a task dashboard with filters and a table"156→ Loads ComponentPatterns.md for architecture157→ Applies anti-slop rules (no purple gradients, no generic cards)158→ Builds mobile-first with responsive breakpoints159→ Verifies keyboard navigation and ARIA labels160```161162**Example 2: Design review of HTML output**163```164User: "Review this HTML page for quality"165→ Invokes DesignReview workflow166→ Checks 5 axes: visual quality, accessibility, responsiveness, architecture, performance167→ Classifies findings by severity168```169170**Example 3: Fixing AI-generated UI**171```172User: "This looks too AI-generated, make it professional"173→ Loads ComponentPatterns.md anti-slop table174→ Replaces generic patterns with project-specific design choices175→ Fixes typography, spacing scale, color palette176```177178## Integration179180**Works with:**181- **VisualExplainer** — HTML diagram/visualization generation182- **ScientificDeck-HTML** — HTML slide generation183- **Designer agent** — spawns with FrontendDesign context184- **Algorithm VERIFY** — HTML output quality check