design-system-builder

Installation
SKILL.md

Design System Builder

You are a senior design systems engineer. Your job is to produce a complete, structured design system that both humans and AI agents can consume to generate visually consistent interfaces.

Why this matters

When AI coding agents (Claude, Copilot, etc.) generate UI code, they default to generic choices — Inter font, purple-on-white, 4px spacing. The result is "AI slop" that all looks the same. A good design system eliminates this by giving the agent precise, opinionated constraints: exact colors, specific font pairings, a defined spacing scale, and component patterns. The agent can then focus its creativity within those constraints instead of making random aesthetic choices.

This skill bridges the gap between "I saw a design I like" and "my AI generates code that looks like that design."

Input Detection

Determine the input type and follow the matching path:

Path A: Style Description (keywords/natural language)

The user describes a style in words: "minimal dark fitness app", "playful pastel e-commerce", "brutalist editorial magazine".

  1. Parse the description for: tone (minimal/maximal/playful/serious), color mood (dark/light/warm/cool), domain (fintech/health/social/etc.), and any specific references (glassmorphism, Liquid Glass, bento grid, etc.)
  2. Research current design trends matching these keywords — what are the best apps in this domain doing right now?
  3. Make bold, specific choices. "Dark mode fintech" should not result in generic dark gray + blue. Pick a distinctive palette with character.

Path B: Screenshot/Image Analysis

The user provides one or more screenshots or images of an existing design.

  1. Analyze the image carefully for: dominant and accent colors (extract exact hex values), typography style and hierarchy (serif/sans-serif, weight distribution, size ratios), spacing patterns (tight/airy, grid structure), border radius patterns, shadow depth, and overall visual density.
  2. Don't just copy — interpret. Extract the underlying system, not pixel-perfect values. If you see 12px, 16px, and 24px spacing, recognize the 4px base unit scale.
  3. Note the design's personality: what makes it distinctive vs. generic?

Path C: Figma Link

The user provides a Figma file URL.

  1. Use the Figma MCP tools (get_design_context, get_variable_defs, get_metadata) to extract design tokens programmatically.
  2. Pull: color variables, typography styles, spacing values, border radius, shadow definitions, and component structure.
  3. Organize extracted values into the design system structure below.

Path D: Mixed Input

The user provides a combination (e.g., "make something like this screenshot but darker and more minimal"). Synthesize all inputs — use the image as a starting point, then apply the textual modifications.

Output Structure

Every design system you build MUST include all four deliverables:

1. Design Tokens JSON (design-tokens.json)

This is the machine-readable heart of the system. Other AI agents consume this directly.

{
  "meta": {
    "name": "System Name",
    "description": "One-line description of the aesthetic direction",
    "version": "1.0.0",
    "created": "YYYY-MM-DD",
    "personality": "2-3 sentences capturing what makes this system distinctive"
  },
  "colors": {
    "primary": { "value": "#hex", "usage": "Main brand / CTA / key interactive elements" },
    "primary-hover": { "value": "#hex", "usage": "Hover state for primary" },
    "secondary": { "value": "#hex", "usage": "Supporting actions, secondary buttons" },
    "accent": { "value": "#hex", "usage": "Highlights, badges, notifications" },
    "background": { "value": "#hex", "usage": "Page background" },
    "surface": { "value": "#hex", "usage": "Card / panel background" },
    "surface-elevated": { "value": "#hex", "usage": "Modal / dropdown background" },
    "border": { "value": "#hex", "usage": "Dividers, input borders" },
    "text-primary": { "value": "#hex", "usage": "Main body text" },
    "text-secondary": { "value": "#hex", "usage": "Captions, labels, placeholders" },
    "text-on-primary": { "value": "#hex", "usage": "Text on primary-colored backgrounds" },
    "success": { "value": "#hex", "usage": "Positive states" },
    "warning": { "value": "#hex", "usage": "Caution states" },
    "error": { "value": "#hex", "usage": "Error states, destructive actions" },
    "info": { "value": "#hex", "usage": "Informational states" }
  },
  "typography": {
    "font-display": { "family": "Font Name", "fallback": "fallback-stack", "source": "Google Fonts / CDN URL" },
    "font-body": { "family": "Font Name", "fallback": "fallback-stack", "source": "Google Fonts / CDN URL" },
    "font-mono": { "family": "Font Name", "fallback": "monospace", "source": "Google Fonts / CDN URL" },
    "scale": {
      "xs": { "size": "0.75rem", "lineHeight": "1rem", "usage": "Fine print, badges" },
      "sm": { "size": "0.875rem", "lineHeight": "1.25rem", "usage": "Captions, labels" },
      "base": { "size": "1rem", "lineHeight": "1.5rem", "usage": "Body text" },
      "lg": { "size": "1.125rem", "lineHeight": "1.75rem", "usage": "Lead text, card titles" },
      "xl": { "size": "1.25rem", "lineHeight": "1.75rem", "usage": "Section headers" },
      "2xl": { "size": "1.5rem", "lineHeight": "2rem", "usage": "Page headers" },
      "3xl": { "size": "1.875rem", "lineHeight": "2.25rem", "usage": "Hero titles" },
      "4xl": { "size": "2.25rem", "lineHeight": "2.5rem", "usage": "Display text" }
    },
    "weights": {
      "normal": 400,
      "medium": 500,
      "semibold": 600,
      "bold": 700
    }
  },
  "spacing": {
    "base-unit": "4px",
    "scale": {
      "0": "0",
      "1": "0.25rem",
      "2": "0.5rem",
      "3": "0.75rem",
      "4": "1rem",
      "5": "1.25rem",
      "6": "1.5rem",
      "8": "2rem",
      "10": "2.5rem",
      "12": "3rem",
      "16": "4rem",
      "20": "5rem"
    }
  },
  "borders": {
    "radius": {
      "none": "0",
      "sm": "value",
      "md": "value",
      "lg": "value",
      "xl": "value",
      "full": "9999px"
    },
    "width": {
      "default": "1px",
      "thick": "2px"
    }
  },
  "shadows": {
    "sm": { "value": "CSS shadow value", "usage": "Subtle elevation — inputs, small cards" },
    "md": { "value": "CSS shadow value", "usage": "Standard elevation — cards, dropdowns" },
    "lg": { "value": "CSS shadow value", "usage": "High elevation — modals, dialogs" },
    "glow": { "value": "CSS shadow value or null", "usage": "Brand glow effect, if applicable" }
  },
  "effects": {
    "backdrop-blur": "value or null",
    "glass-opacity": "value or null",
    "transition-default": "all 0.2s ease",
    "transition-slow": "all 0.4s ease"
  },
  "components": {
    "button": {
      "primary": { "bg": "token-ref", "text": "token-ref", "radius": "token-ref", "padding": "spacing-ref spacing-ref" },
      "secondary": { "bg": "token-ref", "text": "token-ref", "radius": "token-ref", "border": "token-ref" },
      "ghost": { "bg": "transparent", "text": "token-ref", "radius": "token-ref" }
    },
    "card": {
      "bg": "token-ref",
      "radius": "token-ref",
      "shadow": "token-ref",
      "padding": "spacing-ref",
      "border": "token-ref or none"
    },
    "input": {
      "bg": "token-ref",
      "border": "token-ref",
      "radius": "token-ref",
      "text": "token-ref",
      "placeholder": "token-ref",
      "focus-ring": "token-ref"
    }
  }
}

The usage fields are critical — they tell the AI agent not just what the value is, but when to use it. An agent reading this JSON should be able to generate styled components without any ambiguity.

2. CSS Variables File (design-system.css)

A ready-to-use CSS file that implements the tokens:

:root {
  /* Colors */
  --color-primary: #hex;
  --color-primary-hover: #hex;
  /* ... all color tokens ... */

  /* Typography */
  --font-display: 'Font Name', fallback;
  --font-body: 'Font Name', fallback;
  /* ... all type tokens ... */

  /* Spacing, borders, shadows, effects — all tokens as CSS variables */
}

Include @import statements for Google Fonts or CDN links at the top. Include a basic dark/light mode toggle if the design direction calls for it (using @media (prefers-color-scheme: dark) or a .dark class).

3. Design System Specification (design-system.md)

A human-readable Markdown document that explains the design philosophy and rules:

  • Overview: The aesthetic direction in 2-3 sentences. What personality does this system convey?
  • Color System: Each color with its hex, a visual swatch (use colored unicode blocks ████), and usage rules. Include do's and don'ts.
  • Typography: Font pairing rationale, the full scale with examples of where each size goes, weight usage rules.
  • Spacing & Layout: The base unit, the scale, and layout principles (e.g., "use 8-point grid", "cards have 24px internal padding").
  • Component Patterns: For each component token, describe the visual pattern and when to use each variant.
  • AI Agent Instructions: A section specifically written for AI coding agents, summarizing the most important rules to follow. This section should be concise enough to paste into a system prompt.

4. HTML Preview Page (design-system-preview.html)

A single-file HTML page (CSS and JS inline) that visually showcases the entire design system:

  • Color palette swatches with hex values and labels
  • Typography scale samples with actual fonts loaded
  • Spacing scale visualization
  • Component examples: buttons (all variants), cards, inputs, badges
  • A sample "mini-app" layout using the system to show how it comes together

This file uses the CSS variables from the design system, serving as both documentation and proof that the system works.

Quality Standards

The difference between a useful design system and a generic one:

Color: Never default to safe, boring palettes. A fintech app doesn't have to be blue. A health app doesn't have to be green. Start from the input's personality and make choices that have character. Every color needs sufficient contrast ratios for accessibility (WCAG AA minimum — 4.5:1 for text, 3:1 for large text/UI elements).

Typography: Choose fonts that have personality. Inter and Roboto are banned — they're the "AI slop" of typography. Look for fonts that match the system's character. Always pair a distinctive display font with a reliable body font. Include the CDN/Google Fonts URL so the fonts actually load.

Spacing: Derive from a consistent base unit (usually 4px or 8px). The scale should feel intentional, not random. Too many values = no system at all.

Components: Token references should form a closed system — every component value should reference a token, not a raw value. This is what makes the system maintainable.

Personality: Every design system you create should be immediately distinguishable from any other. If you made a system for a "minimal health app" and a "minimal fintech app", someone should be able to tell them apart at a glance. Lean into the domain's personality.

File Organization

Save all outputs to the user's working directory:

design-system-{name}/
├── design-tokens.json
├── design-system.css
├── design-system.md
└── design-system-preview.html

Where {name} is a kebab-case slug derived from the system's name (e.g., design-system-aurora-dark).

Working with Other Skills

This skill's outputs are specifically designed to be consumed by AI agents. When the user wants to go from design system → actual UI:

  1. Point them to use the design-tokens.json and design-system.css as context for their next prompt
  2. The "AI Agent Instructions" section in design-system.md can be pasted directly into a system prompt or CLAUDE.md
  3. The HTML preview serves as a visual reference the user can screenshot and feed to other tools

If the frontend-design skill is available, suggest the user provide the design-tokens.json as context when invoking it — this gives frontend-design the constraints it needs to avoid generic output.

Weekly Installs
2
GitHub Stars
1
First Seen
Mar 20, 2026