← 返回 Skills 市场
goldath

Design System Builder

作者 Hjs102468 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
97
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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)...
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install design-system-builder
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /design-system-builder 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: enterprise component library scaffold with Design Tokens, Storybook 8, theming, testing, and CI/CD pipeline
元数据
Slug design-system-builder
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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)... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 97 次。

如何安装 Design System Builder?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install design-system-builder」即可一键安装,无需额外配置。

Design System Builder 是免费的吗?

是的,Design System Builder 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Design System Builder 支持哪些平台?

Design System Builder 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Design System Builder?

由 Hjs102468(@goldath)开发并维护,当前版本 v1.0.0。

💬 留言讨论