Design System Builder

v1.0.0

Comprehensive guide for building enterprise-grade component libraries and design systems from scratch. Use this skill when a frontend engineer needs to: (1)...

0· 92·0 current·0 all-time
byHjs102468@goldath

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for goldath/design-system-builder.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Design System Builder" (goldath/design-system-builder) from ClawHub.
Skill page: https://clawhub.ai/goldath/design-system-builder
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install design-system-builder

ClawHub CLI

Package manager switcher

npx clawhub@latest install design-system-builder
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description (design system + component library) matches the contents: monorepo setup, tokens, Storybook, theming, testing, and publishing. All referenced tools (pnpm, turborepo, Style Dictionary, Storybook, Changesets, Chromatic) are reasonable for this purpose.
Instruction Scope
SKILL.md and reference docs contain many concrete commands and CI examples (installing packages, pnpm commands, GitHub Action YAML, Chromatic publish, pnpm changeset publish). These instructions stay within the stated scope, but the release/CI sections show explicit use of repo secrets and external services (GITHUB_TOKEN, NPM_TOKEN, CHROMATIC_PROJECT_TOKEN). This is expected for publishing pipelines but is the main operational surface to review before running in your environment.
Install Mechanism
This is instruction-only (no install spec, no code files executed by the platform). The guidance tells you to install public packages (pnpm, style-dictionary, Storybook, Chromatic, etc.) via standard registries — nothing in the skill embeds or downloads arbitrary binaries from unknown personal servers.
Credentials
The skill itself declares no required environment variables and no credentials. The release pipeline docs sensibly reference CI secrets (GITHUB_TOKEN, NPM_TOKEN, CHROMATIC_PROJECT_TOKEN, NODE_AUTH_TOKEN) which are appropriate for automating versioning/publish flows — they are proportional but should only be provided to CI with least privilege.
Persistence & Privilege
Skill has no special persistence or elevated platform privileges (always:false, no install hooks). It does not request to modify other skills or system-wide config.
Assessment
This appears to be a coherent, instruction-only design-system guide. Before you follow any commands or wire secrets into CI: (1) review and vet the CI workflow files (.github/workflows) and only add NPM/GitHub/Chromatic tokens as repository secrets with minimal scopes; (2) verify package names and versions you install come from your trusted registries (npm/pnpm) and not from unknown URLs; (3) because the skill's source/homepage are not provided, consider auditing the included snippets and any build scripts you add to your repo; (4) run initial builds and tests in a sandbox or fork before applying to production repos; and (5) if you plan to adopt the publish steps, ensure organizational policies for package publishing and token management are followed.

Like a lobster shell, security has layers — review code before you run it.

latestvk97enk6kxe9e0merkkcr3wmb9584ejp6
92downloads
0stars
1versions
Updated 2w ago
v1.0.0
MIT-0

Design System Builder

A structured guide for building production-ready component libraries and design systems. Covers architecture, tokens, components, documentation, theming, testing, and publishing.

Quick Decision Map

GoalStart here
Set up monorepo + buildArchitecture
Define design tokensreferences/tokens.md
Build componentsreferences/component-patterns.md
Storybook setupreferences/storybook-setup.md
Theming / dark modereferences/theming.md
Testing strategyreferences/testing-strategy.md
Release pipelinereferences/release-pipeline.md

1. Architecture & Monorepo Setup

Recommended Structure

Use pnpm workspaces + Turborepo for monorepo management.

my-design-system/
├── packages/
│   ├── tokens/          # Design tokens (CSS vars, JS objects)
│   ├── icons/           # SVG icon components
│   ├── components/      # Core UI components
│   ├── themes/          # Theme definitions
│   └── utils/           # Shared utilities (cn, clsx, etc.)
├── apps/
│   └── docs/            # Storybook documentation site
├── package.json         # Root workspace config
├── pnpm-workspace.yaml
├── turbo.json
└── tsconfig.base.json

Bootstrap Commands

# Initialize monorepo
mkdir my-design-system && cd my-design-system
pnpm init
pnpm add -D turbo -w

# Create workspace config
echo "packages:\n  - 'packages/*'\n  - 'apps/*'" > pnpm-workspace.yaml

turbo.json — task pipeline:

{
  "$schema": "https://turbo.build/schema.json",
  "pipeline": {
    "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] },
    "dev": { "cache": false, "persistent": true },
    "test": { "dependsOn": ["^build"] },
    "lint": {}
  }
}

Build Tooling Choice

ToolBest forNotes
Vite + vite-plugin-dtsReact/Vue componentsFast, ESM-first
tsupUtility packagesZero-config, dual CJS/ESM
RollupFine-grained controlMore config overhead

Recommended packages/components/package.json:

{
  "name": "@myds/components",
  "version": "0.1.0",
  "main": "./dist/index.cjs",
  "module": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "import": "./dist/index.js",
      "require": "./dist/index.cjs",
      "types": "./dist/index.d.ts"
    }
  },
  "scripts": {
    "build": "tsup src/index.ts --format cjs,esm --dts",
    "dev": "tsup src/index.ts --format cjs,esm --dts --watch"
  }
}

2. Design Tokens

Design tokens are the single source of truth for visual decisions.

Read references/tokens.md for the complete token schema, naming conventions, CSS variable patterns, and multi-brand token examples.

Quick Start

# Install Style Dictionary (token transformation tool)
pnpm add -D style-dictionary -w

Token files live in packages/tokens/src/. Style Dictionary transforms them to CSS variables, JS/TS constants, and platform-specific outputs (iOS, Android).

Core token categories: color, typography, spacing, border-radius, shadow, z-index, motion.


3. Component Development Standards

Every component should follow consistent conventions for long-term maintainability.

Read references/component-patterns.md for detailed patterns: file structure, Props API design, compound components, polymorphic components, accessibility requirements, and documentation templates.

Non-Negotiable Rules

  1. TypeScript first — all props typed with explicit interfaces, no any
  2. forwardRef for all leaf elements (React)
  3. aria-* attributes — never ship an inaccessible component
  4. Controlled + Uncontrolled — support both patterns for form components
  5. data-testid — include for E2E testability

Component File Structure

Button/
├── Button.tsx          # Component implementation
├── Button.types.ts     # Props interface & type exports
├── Button.test.tsx     # Unit + interaction tests
├── Button.stories.tsx  # Storybook stories
└── index.ts            # Public barrel export

4. Storybook

Storybook is the primary documentation and development environment.

Read references/storybook-setup.md for full configuration: addon setup, autodocs, MDX pages, controls, theming the Storybook UI, and deployment.

Bootstrap

cd apps/docs
pnpm dlx storybook@latest init
# Select React + Vite when prompted

Essential addons:

  • @storybook/addon-essentials (controls, actions, docs, viewport)
  • @storybook/addon-a11y (accessibility audit)
  • @storybook/addon-themes (theme switching)
  • storybook-addon-pseudo-states (hover/focus/active states)

5. Theme System

Read references/theming.md for full theming architecture: CSS custom properties strategy, dark mode implementation (media query vs. class-based), ThemeProvider pattern for React, and Vue 3 provide/inject approach.

Core Concept

Tokens define semantic aliases that point to primitive values:

/* Primitive */
--color-blue-500: #3b82f6;

/* Semantic (theme-aware) */
[data-theme="light"] { --color-primary: var(--color-blue-500); }
[data-theme="dark"]  { --color-primary: var(--color-blue-400); }

Components reference semantic tokens only — never primitives directly.


6. Testing Strategy

Read references/testing-strategy.md for the full pyramid: unit tests (Vitest), interaction tests (Testing Library), visual regression (Chromatic/Percy), and accessibility automation.

Test Pyramid for Component Libraries

        [Visual Regression]     ← Chromatic / Percy
       [Interaction Tests]      ← @testing-library/react
      [Unit / Logic Tests]      ← Vitest

Minimum bar per component:

  • Renders without errors
  • Props produce expected output
  • Interactive states (hover, focus, disabled) work
  • No critical a11y violations (axe-core)

7. Release Pipeline

Read references/release-pipeline.md for the complete release flow: Changesets setup, versioning strategy, automated changelog, CI/CD pipeline, and npm publishing.

Tool: Changesets

pnpm add -D @changesets/cli -w
pnpm changeset init

Workflow:

  1. pnpm changeset — create a changeset (describe changes)
  2. pnpm changeset version — bump versions + update CHANGELOG.md
  3. pnpm changeset publish — publish to npm

Vue 3 Notes

Most patterns apply to Vue 3 with minor adaptations:

  • Props: use defineProps<T>() with TypeScript generics
  • expose() replaces React's forwardRef
  • Theme injection: provide/inject replaces React Context
  • Testing: @vue/test-utils + Vitest
  • See references/component-patterns.md for Vue-specific examples

Recommended Tech Stack Summary

LayerReactVue 3
Monorepopnpm + Turborepopnpm + Turborepo
Buildtsup / Vitetsup / Vite
TokensStyle DictionaryStyle Dictionary
DocsStorybook 8Storybook 8
Unit testsVitest + Testing LibraryVitest + @vue/test-utils
Visual regressionChromaticChromatic
ReleaseChangesetsChangesets
CSSCSS Modules / CSS-in-JSCSS Modules / scoped SFC

Comments

Loading comments...