agentleFS
XINGANLIUXINGANLIU/design-system-generator-skill/skills/design-system-generator/SKILL.md

design-system-generator

Skill1 starsChanged 6 months agoApache-2.0View on GitHub

Generate a complete, production-ready design system from a single brand color. Outputs OKLCH color palettes, W3C Design Tokens (JSON), CSS custom properties, component styles (Button, Card, Input, Badge, Alert, Modal, etc.), and a live preview HTML page with Light/Dark theme toggle. Trigger this skill when the user asks to create a design system, generate a color palette, build a theme, create UI tokens, or set up brand styles. 从一个品牌色自动生成完整的设计系统:OKLCH 调色板、W3C Design Tokens、CSS 变量、 组件样式和可视化预览页。

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. OneWave-AI/claude-skills★ 321same name
    2. thienanblog/awesome-ai-agent-skills★ 68same name
    3. qodex-ai/ai-agent-skills★ 45same name
    4. th-efool/SKILLS★ 1same name
    5. brianamazzio/design-system-toolkit★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 12 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    OKLCH-First: All colors are generated in the OKLCH color space for perceptual uniformity and superior accessibility.

    line 23
  2. Distinctive:

    Accessibility by Default: All color combinations meet WCAG 2.2 AA contrast ratios (4.5:1 for text, 3:1 for UI elements).

    line 26
  3. Distinctive:

    If user gives a color name (e.g., "blue", "coral"), convert it to a hex value first.

    line 53
  4. Distinctive:

    If the user says "just use defaults" or gives only a color, proceed with defaults for all optional fields.

    line 56
  5. Distinctive:

    Create semantic token mappings for both Light and Dark themes:

    line 86
  6. Very specific:

    Follow the template in tokens.json.tmpl.

    line 119
  7. Distinctive:

    All color tokens (primitive + semantic)

    line 120
  8. Very specific:

    Follow the template in tokens.css.tmpl.

    line 129
  9. Very specific:

    Output: Write both files to design-system/ directory.

    line 152
  10. Very specific:

    ONLY use var(--token-name) — never hardcode any color, size, or spacing value.

    line 179
  11. Very specific:

    Use BEM-like naming: .btn, .btn--primary, .btn:hover.

    line 180
  12. Distinctive:

    All components must look correct in both Light and Dark themes automatically.

    line 184
  13. Very specific:

    Output: Write components.css to design-system/.

    line 186
  14. Very specific:

    Follow the template in preview.html.tmpl.

    line 197
  15. Distinctive:

    Color Palette Section: All color swatches with token names and values

    line 199
  16. Distinctive:

    Typography Section: All font sizes rendered as sample text

    line 200
  17. Distinctive:

    Components Section: All components rendered in all variants and states

    line 202
  18. Distinctive:

    Use a clean, modern layout

    line 209
  19. Distinctive:

    Use the first color as primary.

    line 234

“Common” is measured: kept by at least 6 in 10 of the 5 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

Design System Generator / 设计系统生成器

Generate a complete, production-ready design system from minimal brand inputs. 从最少的品牌输入自动生成完整的、可投产的设计系统。

Core Principles / 核心原则

  1. One Color In → Full System Out: The user only needs to provide a single brand color. Everything else is derived algorithmically.
  2. OKLCH-First: All colors are generated in the OKLCH color space for perceptual uniformity and superior accessibility.
  3. W3C Standards: Output follows the W3C Design Tokens specification ($value / $type format).
  4. Zero Dependencies: Generated CSS uses only native custom properties — no preprocessors, no frameworks required.
  5. Accessibility by Default: All color combinations meet WCAG 2.2 AA contrast ratios (4.5:1 for text, 3:1 for UI elements).
  6. Progressive Enhancement: Dark mode uses color-scheme + light-dark() for native OS integration.

Workflow / 工作流

You MUST follow these phases in order. Do NOT skip phases or generate all files at once without user confirmation at each stage.

你必须按顺序执行以下阶段。不要跳过阶段,也不要在未获得用户确认的情况下一次性生成所有文件。


Phase 1: Brand Input Collection / 品牌输入收集

Trigger / 触发: User asks to create a design system, generate a theme, or build brand styles.

Your Task / 你的任务: Collect brand parameters through conversation. At minimum, you need ONE of these:

ParameterRequiredDefaultExample
Brand color✅ Yes—#6366f1, oklch(55% 0.25 270), indigo
Font familyOptionalInter, system-ui, sans-serif"Outfit", "Noto Sans SC"
Border radius styleOptionalrounded (8px)sharp (2px), rounded (8px), pill (9999px)
DensityOptionalcomfortablecompact, comfortable, spacious

Steps:

  1. If user gives a color name (e.g., "blue", "coral"), convert it to a hex value first.
  2. Convert any hex/rgb color to OKLCH using the algorithm in color-system.md.
  3. Present a summary of all parameters to the user and ask for confirmation.
  4. If the user says "just use defaults" or gives only a color, proceed with defaults for all optional fields.

Output: Display the collected parameters in a table and wait for user confirmation.


Phase 2: Color System Generation / 调色板生成

Trigger / 触发: User confirms Phase 1 parameters.

Your Task / 你的任务: Generate the complete color system. Read color-system.md for the OKLCH algorithm.

Generate these palettes:

2.1 Primary Palette (10 steps)

From the brand color, generate a 10-step scale (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950) by varying Lightness in OKLCH while keeping Chroma and Hue stable. The brand color should map to step 500 or 600.

2.2 Neutral Palette (10 steps)

Take the brand color's Hue, reduce Chroma to near zero (0.01–0.03), and generate a neutral gray scale with a subtle brand tint.

2.3 Semantic Colors

Generate these using complementary/analogous hue relationships from the brand color:

  • Success: Hue ≈ 145° (green family)
  • Warning: Hue ≈ 85° (amber/yellow family)
  • Error/Danger: Hue ≈ 25° (red family)
  • Info: Hue ≈ 230° (blue family)

Each semantic color gets a 5-step mini-scale: light, default, dark, contrast-text, subtle-bg.

2.4 Theme Mapping

Create semantic token mappings for both Light and Dark themes:

Light Theme:
  --color-bg-primary:     neutral-50
  --color-bg-secondary:   neutral-100
  --color-text-primary:   neutral-900
  --color-text-secondary: neutral-600
  --color-border:         neutral-200

Dark Theme:
  --color-bg-primary:     neutral-950
  --color-bg-secondary:   neutral-900
  --color-text-primary:   neutral-50
  --color-text-secondary: neutral-400
  --color-border:         neutral-800

Output: Display the generated palettes as color swatches (use colored text or blocks if in terminal, or describe the colors). Wait for user confirmation before proceeding.


Phase 3: Token Architecture / Token 架构

Trigger / 触发: User confirms Phase 2 color system.

Your Task / 你的任务: Generate the complete token files. Read the following references as needed:

  • typography-scale.md for font sizes
  • spacing-system.md for spacing values

Generate these files:

3.1 tokens.json — W3C Design Tokens

Follow the template in tokens.json.tmpl. Include:

  • All color tokens (primitive + semantic)
  • Typography tokens (font-family, font-size scale, font-weight, line-height, letter-spacing)
  • Spacing tokens (4px base geometric progression)
  • Border radius tokens
  • Shadow tokens (3 levels: sm, md, lg)
  • Z-index tokens
  • Transition/animation duration tokens

3.2 tokens.css — CSS Custom Properties

Follow the template in tokens.css.tmpl. Structure:

/* === Primitive Tokens === */
:root {
  --color-primary-50: oklch(...);
  /* ... all primitive values ... */
}

/* === Semantic Tokens (Light Theme — Default) === */
:root {
  color-scheme: light dark;
  --color-bg-primary: light-dark(var(--color-neutral-50), var(--color-neutral-950));
  /* ... semantic mappings using light-dark() ... */
}

/* === Dark Theme Override === */
[data-theme="dark"] {
  color-scheme: dark;
  --color-bg-primary: var(--color-neutral-950);
  /* ... explicit dark overrides for manual toggle ... */
}

Output: Write both files to design-system/ directory. Show the user the file structure and a summary of generated tokens.


Phase 4: Component Styles / 组件样式

Trigger / 触发: Phase 3 token files are generated.

Your Task / 你的任务: Generate production-ready component CSS. Read component-patterns.md and dark-mode-guide.md.

Generate components.css with these components:

ComponentVariantsStates
.btn--primary, --secondary, --ghost, --dangerhover, focus-visible, active, disabled
.card--elevated, --outlined, --filledhover (if interactive)
.input--default, --errorfocus, disabled, placeholder
.badge--primary, --success, --warning, --danger, --neutral—
.alert--info, --success, --warning, --dangerdismissible
.avatarsize variants (sm, md, lg)—
.dividerhorizontal, vertical—
.skeleton—loading animation
.tooltip——
.modal—open/close animation
.navbar—sticky, transparent

Rules for component CSS:

  1. ONLY use var(--token-name) — never hardcode any color, size, or spacing value.
  2. Use BEM-like naming: .btn, .btn--primary, .btn:hover.
  3. Include transition on all interactive state changes (use --transition-fast / --transition-normal).
  4. Include focus-visible outlines for keyboard accessibility.
  5. Include subtle micro-animations (scale on button press, fade on card hover).
  6. All components must look correct in both Light and Dark themes automatically.

Output: Write components.css to design-system/. Show the user a summary of generated components.


Phase 5: Preview & Delivery / 预览与交付

Trigger / 触发: Phase 4 components are generated.

Your Task / 你的任务: Generate a visual preview page and deliver all files.

5.1 Generate preview.html

Follow the template in preview.html.tmpl. The preview page must include:

  • Header with project name and theme toggle button (Light/Dark switch)
  • Color Palette Section: All color swatches with token names and values
  • Typography Section: All font sizes rendered as sample text
  • Spacing Section: Visual representation of spacing scale
  • Components Section: All components rendered in all variants and states
  • Footer with "Generated by Design System Generator"

The preview page must:

  • Be a single self-contained HTML file (inline the CSS or use relative paths)
  • Include a working Light/Dark toggle using JavaScript
  • Be responsive (work on mobile and desktop)
  • Use a clean, modern layout

5.2 File Delivery Summary

Present the final file tree to the user:

design-system/
├── tokens.json          # W3C Design Tokens (machine-readable)
├── tokens.css           # CSS Custom Properties (import this in your project)
├── components.css       # Ready-to-use component styles
└── preview.html         # Open in browser to see your design system

5.3 Usage Instructions

Tell the user how to use the generated files:

<!-- Add to your HTML <head> -->
<link rel="stylesheet" href="design-system/tokens.css">
<link rel="stylesheet" href="design-system/components.css">

Handling Edge Cases / 边界情况处理

If user provides multiple colors

Use the first color as primary. Ask if other colors should be used for specific semantic roles (e.g., "Should I use the second color for success states?").

If user wants to customize after generation

Offer to regenerate specific parts (e.g., "I can update just the color palette while keeping the components unchanged").

If user asks for framework-specific output

Explain that this version generates vanilla CSS. Offer guidance on how to integrate:

  • Tailwind CSS: Point them to use tokens.json values in tailwind.config.js
  • React/Vue: Components can wrap the CSS classes
  • Sass/Less: The CSS custom properties work directly

Example Triggers / 示例触发

These user messages should activate this skill:

  • "Generate a design system with brand color #6366f1"
  • "Create a theme using indigo as the primary color"
  • "Build a design token system for my project"
  • "帮我生成一个以珊瑚色为主色的设计系统"
  • "Create dark mode tokens for my app"
  • "I need a color palette and component styles"
  • "/design-system #e11d48 Outfit rounded"

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.