Command Palette

Search for a command to run...

Назад к скиллам
скилл № 32082

frontend-design-system

Use when the user asks to build a component library, define primitive, semantic and component design tokens as CSS variables, design component APIs with CVA…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить frontend-design-system в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Frontend Design System

Purpose

Build a three-tier design token system with CVA-based component variants and theme-aware architecture. Every visual value is a token. No hardcoded colors, spacing, or typography. Components support dark mode, responsive variants, and accessibility out of the box.

Agent Protocol

Trigger

Exact user phrases: "design system", "design tokens", "component library", "token architecture", "typography system", "spacing system", "component API design", "variant system", "create a design system", "dark mode theme".

Input Context

Before activating, verify:

  • The framework is known (React, Vue, Angular) or ask.
  • The styling approach is known (CSS modules, Tailwind, styled-components, etc.).

Output Artifact

Token definitions, component APIs, and (when asked) starter files for tokens, CVA variants, and theme configuration.

Response Format

Token definitions:

Primitive: --color-{scale}-{step}
Semantic: --color-{role}
Component: --{component}-{property}

Component API:

Component: {Name}
Props: {list with types}
Variants: {variant name -> options}

No preamble or filler. Lead with tokens and component APIs. Keep prose tight but include the definitions the user needs.

Completion Criteria

  • Three-tier token hierarchy defined (primitive, semantic, component).
  • Token naming convention established with examples.
  • CVA or equivalent variant pattern specified.
  • Component API rules defined (props, composition, escape hatches).
  • Dark mode strategy defined via semantic token cascade.
  • No hardcoded values in component examples.

Max Response Length

Produce complete token definitions and component APIs. Prioritize correctness over brevity; omit only redundant prose.

Component Architecture / Decision Trees

Styling Approach Decision Tree

Existing styling stack?
  |-- Tailwind CSS --> Use CVA with Tailwind classes + cn() helper
  |-- CSS Modules --> Use CVA with @apply and module scoping
  |-- styled-components / Emotion --> Use CSS prop or styled() + variants
  |-- Vanilla CSS --> Use CSS custom properties + BEM-style classes
  |-- CSS-in-JS (other) --> Use the library's variant system

Token Architecture Decision Tree

Runtime theme switching needed?
  |-- YES --> CSS Custom Properties + semantic tokens (themes are CSS files)
  |     Components reference semantic tokens, themes swap their values
  |-- NO  --> Build-time token generation (Style Dictionary -> Tailwind config / CSS)
  |     Simpler, no runtime overhead. Rebuild to change theme.

Component Composition Decision Tree

Does the component render its children?
  |-- YES --> Is it a layout component?
  |     |-- YES --> Use React children / Vue slots
  |     |-- NO  --> Use composition (compound components)
  |-- NO --> Does it accept many optional sub-elements?
        |-- YES --> Use slots pattern (leftIcon, rightIcon, subtitle)
        |-- NO  --> Keep props flat under 10

Component Complexity Decision Tree

How many visual states does the component have?
  |-- 1-3 (simple) -->
  |     |-- Single variant, few props --> Direct utility classes or styled()
  |-- 4-10 (moderate) -->
  |     |-- Multiple variants (size, color) --> CVA or recipe()
  |-- 10+ (complex) -->
        |-- Compound component for sub-elements --> Compound + CVA
        |-- Slots for optional elements --> Slot pattern + CVA

Workflow

Step 1: Three-Tier Token Hierarchy

Primitive tokens (raw values):
  --color-gray-50, --color-blue-500, --font-size-md, --spacing-4
  These never change meaning. Direct mappings to design values.

Semantic tokens (meaning):
  --color-bg-primary, --color-text-body, --color-border
  These reference primitives. Meaning is stable even when theme changes.

Component tokens (scoped):
  --button-bg, --card-padding, --input-border
  These reference semantic tokens. Components only use these, never primitives.

Step 2: Token Naming Convention

Every semantic and component token references a primitive — no hardcoded values outside the primitive layer.

:root {
  /* Primitives (raw values) */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-700: #374151;
  --color-gray-900: #111827;
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-white: #ffffff;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-4: 1rem;
  --radius-md: 0.375rem;

  /* Semantic (reference primitives) */
  --color-bg-primary: var(--color-gray-50);
  --color-text-primary: var(--color-gray-900);
  --color-text-secondary: var(--color-gray-500);
  --color-border: var(--color-gray-100);
  --color-brand: var(--color-blue-600);
  --color-on-brand: var(--color-white);
  --font-body: var(--font-size-md);
  --spacing-stack: var(--spacing-4);
  --radius-control: var(--radius-md);

  /* Com
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/component-api.md
  • references/component-architecture.md
  • references/design-system-component-library.md
  • references/design-system-implementation.md
  • references/design-system-testing.md
  • references/design-system-token-architecture.md
  • references/design-tokens.md
  • references/theme-implementation.md

FAQ

Что делает скилл frontend-design-system?

Use when the user asks to build a component library, define primitive, semantic and component design tokens as CSS variables, design component APIs with CVA variants, or wire dark mode through semantic tokens. Produces coded token layers and component library structure. Not for Figma variables and token pipeline governance (use design-systems).

Как установить скилл frontend-design-system?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл frontend-design-system запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить frontend-design-system с