← Back to Skills Marketplace
goldath

Design System Builder

by Hjs102468 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
97
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install design-system-builder
Description
Comprehensive guide for building enterprise-grade component libraries and design systems from scratch. Use this skill when a frontend engineer needs to: (1)...
README (SKILL.md)

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

Goal Start here
Set up monorepo + build Architecture
Define design tokens references/tokens.md
Build components references/component-patterns.md
Storybook setup references/storybook-setup.md
Theming / dark mode references/theming.md
Testing strategy references/testing-strategy.md
Release pipeline references/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:\
  - 'packages/*'\
  - '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

Tool Best for Notes
Vite + vite-plugin-dts React/Vue components Fast, ESM-first
tsup Utility packages Zero-config, dual CJS/ESM
Rollup Fine-grained control More 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\x3CT>() 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

Layer React Vue 3
Monorepo pnpm + Turborepo pnpm + Turborepo
Build tsup / Vite tsup / Vite
Tokens Style Dictionary Style Dictionary
Docs Storybook 8 Storybook 8
Unit tests Vitest + Testing Library Vitest + @vue/test-utils
Visual regression Chromatic Chromatic
Release Changesets Changesets
CSS CSS Modules / CSS-in-JS CSS Modules / scoped SFC
Usage Guidance
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.
Capability Analysis
Type: OpenClaw Skill Name: design-system-builder Version: 1.0.0 The design-system-builder skill bundle is a comprehensive and legitimate guide for setting up a frontend component library. It provides standard architecture patterns, design token schemas, and CI/CD workflows using industry-standard tools like Turborepo, Storybook, and Changesets. Analysis of SKILL.md and the reference files (component-patterns.md, release-pipeline.md, etc.) reveals no evidence of malicious intent, data exfiltration, or prompt injection attacks.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install design-system-builder
  3. After installation, invoke the skill by name or use /design-system-builder
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: enterprise component library scaffold with Design Tokens, Storybook 8, theming, testing, and CI/CD pipeline
Metadata
Slug design-system-builder
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Design System Builder?

Comprehensive guide for building enterprise-grade component libraries and design systems from scratch. Use this skill when a frontend engineer needs to: (1)... It is an AI Agent Skill for Claude Code / OpenClaw, with 97 downloads so far.

How do I install Design System Builder?

Run "/install design-system-builder" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Design System Builder free?

Yes, Design System Builder is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Design System Builder support?

Design System Builder is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Design System Builder?

It is built and maintained by Hjs102468 (@goldath); the current version is v1.0.0.

💬 Comments