| name | web-design |
| description | Generate beautiful, well-designed web pages and visualizations. Creates
self-contained HTML with professional design (typography, color, layout, spacing),
OKLCH color palettes, dark/light themes, Mermaid diagrams, Chart.js charts,
KPI dashboards, timelines, and responsive layouts. Use when the user asks to
create a web page, landing page, documentation site, portfolio, diagram,
dashboard, or any HTML visualization.
|
| allowed-tools | ["Read","Write","Edit","Bash","Glob"] |
Web Design โ Generate Beautiful Web Pages
When to Activate
Activate this skill when the user asks to:
- Create a web page, landing page, or website
- Design a portfolio, blog, or documentation site
- Generate an HTML page for any content
- Build a single-page site or article layout
Also activate when the user mentions: "make it look good", "professional layout", "clean design", "typography", "readable", "visualize this".
Additionally activate for visualization requests:
- Diagrams, flowcharts, architecture overviews
- Data dashboards or KPI displays
- Any table with 4+ rows or 3+ columns (generate HTML, not ASCII)
- Sequence diagrams, ER diagrams, state machines
- Timelines, before/after comparisons
- Charts (bar, line, pie, doughnut)
Before You Begin
-
Read the references โ always read these before generating:
references/design-principles.md โ typography, spacing, color, and layout rules
references/css-patterns.md โ reusable CSS patterns and OKLCH palettes
references/visualizations.md โ diagrams, charts, and interactive components (read when the page needs diagrams, data visualizations, architecture overviews, or dashboards)
-
Choose an aesthetic direction โ don't default to the same look every time. Consider:
- Paper & Ink โ warm cream, dark brown, serif body, editorial feel
- Editorial โ cool white, deep blue accent, clean sans-serif
- Modernist โ high contrast, geometric, single bold accent
- Forest โ warm naturals, sage greens, organic feel
- Dusk โ dark backgrounds, warm text, amber highlights
Pick based on content type: portfolios suit Paper & Ink or Dusk; docs suit Editorial or Modernist; blogs suit Paper & Ink or Forest.
-
Use OKLCH for all colors โ all color values must use oklch(lightness chroma hue) syntax. Never use hex codes, rgb(), or hsl() in generated pages. Use OKLCH palettes from references/css-patterns.md as your starting point. Derive variations by adjusting the three axes predictably:
- Lighter: +0.1 L
- Darker: โ0.1 L
- Muted/subtle: ร0.4โ0.6 C
- More vivid: +0.02โ0.05 C (watch for gamut clipping)
- Alpha: append
/ 0.5 etc.
-
Choose fonts โ pick a Google Fonts pairing that fits the aesthetic:
- Playfair Display + Source Serif 4 (editorial/magazine)
- Inter (clean/technical, vary by weight)
- Libre Baskerville + Montserrat (warm/professional)
- IBM Plex Sans + IBM Plex Serif (technical/structured)
- Crimson Pro + Manrope (literary/modern)
- Outfit + Space Mono (clean/developer)
- Bricolage Grotesque (bold/expressive)
The Four Design Pillars
Every page must consciously address all four:
1. Color โ OKLCH palette chosen for the aesthetic. Consistent semantic roles: background, surface, text, accent, border. Both themes look intentional, not just inverted.
2. Typography โ Font pairing, size scale, line height, line length. Headings lead with scale and weight, not decoration. Body text is comfortable to read.
3. Layout & Spacing โ Generous whitespace creates breathing room. Consistent spacing scale (multiples of 0.5rem). Content hierarchy is visible at a glance (squint test).
4. Interactivity & Motion โ Theme toggle, hover states, smooth transitions. Entrance animations only when they add meaning. Respects prefers-reduced-motion.
Generation Workflow
Step 1: Plan Structure
Determine the page sections based on content. Common patterns:
- Article: hero โ body prose โ optional sidebar โ footer
- Portfolio: hero โ work grid โ about โ contact
- Documentation: sidebar nav โ content area with sections
- Landing page: hero โ features โ testimonials โ CTA โ footer
- Architecture/diagram: hero โ diagram(s) โ explanatory prose โ details
- Dashboard: KPI cards โ charts โ data tables โ details
Step 1b: Choose Visualization Approach (if applicable)
When the page includes diagrams, charts, or data:
- Flowcharts, sequences, ER, state machines, mind maps โ Mermaid.js (with ELK for complex layouts)
- Architecture overviews (text-heavy) โ CSS Grid cards with flow arrows
- Architecture overviews (topology) โ Mermaid for automatic edge routing
- Data tables (4+ rows or 3+ cols) โ HTML
<table> with tabular figures
- Bar/line/pie/doughnut charts โ Chart.js
- KPI dashboards โ CSS Grid with KPI cards + optional Chart.js
- Timelines โ CSS central-line pattern
- Before/after comparisons โ CSS Grid side-by-side panels
- Complex choreographed animations (10+ elements) โ anime.js
- Simple staggered entrances โ CSS-only with
--i delay variable
All visualization libraries load from CDN. Pages remain self-contained.
Step 2: Generate Self-Contained HTML
Create a single .html file with ALL CSS embedded in a <style> tag. No external stylesheets except Google Fonts <link>.
Required elements in every page:
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=...&display=swap" rel="stylesheet">
<style></style>
</head>
Step 3: Apply Design Principles
Every page MUST follow these non-negotiable rules:
Typography:
- Body text: 15โ25px (use clamp() for fluid)
- Line height: 1.3โ1.45 (unitless)
- Line length: max-width 65ch on prose containers
- Proper heading hierarchy (max 3 levels, minimal size jumps)
- Curly quotes (" " ' '), em dashes (โ), en dashes (โ)
- Bold OR italic for emphasis, never both
- font-kerning: normal
Color:
- All values in oklch() โ no hex, no hsl(), no rgb()
- Text: perceptually dark (L โ 0.10โ0.25 light / L โ 0.90โ0.95 dark), never pure black on white
- Accent color drives the visual personality
- Semantic roles:
--bg-primary, --bg-secondary, --text-primary, --text-secondary, --accent, --border
Layout:
- Generous margins โ text never touches viewport edges
- Consistent spacing scale
- Visual hierarchy survives the squint test
Step 4: Add Theme Toggle
Every page includes a dark/light theme toggle:
- Sun/moon icon button, fixed position (top-right)
- Respects prefers-color-scheme as default
- Persists choice to localStorage
- Smooth transition on toggle (0.3s)
Step 5: Ensure Responsiveness
- Test mentally at 320px, 768px, 1440px
- Sidebar layouts collapse to single column on mobile
- Margins reduce but never disappear on small screens
- Font sizes scale down slightly on mobile
Output
Save generated files to ~/.claude/output/web/ with a descriptive filename.
After saving, tell the user the file path and suggest they open it in a browser.
Quality Checks
Before finishing, verify:
- Squint test โ blur your eyes โ can you see the visual hierarchy?
- Line length test โ body text within 45โ90 characters per line?
- Both-theme test โ does the page look good in both light and dark mode?
- The "is it generic?" test โ would it look the same with different content? If yes, add character
- OKLCH audit โ are all color values in oklch()? No hex or hsl() anywhere?
- Typography audit โ curly quotes? Proper dashes? Restrained emphasis?
Anti-Patterns to Avoid
- Any hex, hsl(), or rgb() color values โ use oklch() exclusively
- Pure black text on pure white background (use L โ 0.1 on L โ 0.98, not 0 on 1)
- Body text smaller than 15px
- Lines longer than 90 characters
- Centered body text
- Underlining anything except links
- Bold AND italic together
- All-caps for more than a few words
- More than 3 heading levels
- Heading sizes that jump dramatically
- Flat, monochrome designs without any accent
- Default browser link styling
- Gradients that interpolate through gray (use
in oklch syntax)