home / skills / openclaw / skills / design-system

This skill helps you design scalable design systems by managing tokens, components, and documentation across teams.

npx playbooks add skill openclaw/skills --skill design-system

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
3.7 KB
---
name: Design System
slug: design-system
version: 1.0.0
homepage: https://clawic.com/skills/design-system
description: Build design systems with tokens, components, and documentation that scale across teams and products.
metadata: {"clawdbot":{"emoji":"šŸŽØ","requires":{"bins":[]},"os":["linux","darwin","win32"]}}
---

## Setup

On first use, read `setup.md` for integration guidelines. All preferences are stored in `~/design-system/memory.md`.

## When to Use

User needs to create, maintain, or extend a design system. Agent handles token architecture, component patterns, documentation structure, and cross-platform consistency.

## Architecture

Memory lives in `~/design-system/`. See `memory-template.md` for structure.

```
~/design-system/
ā”œā”€ā”€ memory.md         # Status + context + decisions
└── tokens/           # Token definitions if exported
```

## Quick Reference

| Topic | File |
|-------|------|
| Setup process | `setup.md` |
| Memory template | `memory-template.md` |

## Core Rules

### 1. Tokens First, Components Second

Design tokens are the foundation. Before building any component:
- Define color tokens (semantic, not raw hex)
- Define spacing scale (consistent multiplier)
- Define typography scale (modular)

Components consume tokens. Never hardcode values.

### 2. Semantic Over Literal Naming

| Bad | Good |
|-----|------|
| `blue-500` | `primary` |
| `14px` | `text-sm` |
| `8px` | `space-2` |

Semantic names survive rebrand. Literal names break everything.

### 3. Three-Tier Token Architecture

```
Primitive → Semantic → Component
   ↓           ↓          ↓
 gray-900   text-primary  button-text
```

- **Primitive**: Raw values (colors, sizes)
- **Semantic**: Meaning-based (primary, danger, muted)
- **Component**: Specific use (button-bg, card-border)

### 4. Document Decisions, Not Just Specs

Every token and component needs:
- **What**: The value or pattern
- **When**: Usage context
- **Why**: The decision behind it
- **When NOT**: Anti-patterns to avoid

### 5. Platform-Agnostic Source of Truth

Design tokens should export to:
- CSS custom properties
- Tailwind config
- iOS/Android native
- Figma variables

One source, many outputs. Use Style Dictionary or similar.

### 6. Component API Consistency

All components follow the same patterns:
- Same prop naming (`variant`, `size`, `disabled`)
- Same size scale (`sm`, `md`, `lg`)
- Same variant names (`primary`, `secondary`, `ghost`)

Predictability beats cleverness.

### 7. Versioning and Migration

Breaking changes need:
- Version bump (semver)
- Migration guide
- Deprecation warnings before removal
- Codemods when possible

## Common Traps

- **Premature abstraction** → Build 3 instances before extracting a pattern
- **Token explosion** → 50 grays is not a system, it is chaos
- **Skipping documentation** → Undocumented patterns get reimplemented wrong
- **Designing for edge cases first** → Cover 80% well before 100% poorly
- **No dark mode strategy** → Retrofit is 10x harder than planning upfront
- **Inconsistent spacing** → Use a scale (4px base), not arbitrary values
- **Component prop sprawl** → More than 10 props means split the component

## Security & Privacy

**Data that stays local:**
- Design decisions in ~/design-system/
- Token definitions and component specs

**This skill does NOT:**
- Access files outside ~/design-system/
- Make network requests
- Store sensitive data

## Related Skills
Install with `clawhub install <slug>` if user confirms:
- `css` — Styling fundamentals
- `tailwindcss` — Utility-first CSS
- `frontend` — Frontend development
- `ui` — User interface patterns
- `design` — Design principles

## Feedback

- If useful: `clawhub star design-system`
- Stay updated: `clawhub sync`

Overview

This skill helps teams build and maintain scalable design systems with tokens, components, and clear documentation. It enforces a tokens-first approach, semantic naming, and a three-tier token architecture so styles remain consistent across platforms. The skill stores decisions and state in ~/design-system/ for local, auditable memory and migration guidance.

How this skill works

On first use, follow setup.md for integration and preferences; the skill keeps context and decisions in ~/design-system/memory.md. It guides you to define primitives, map semantic tokens, and create component-specific tokens, then export those tokens for CSS, Tailwind, iOS/Android, and Figma. It validates component APIs, recommends consistent props and size/variant scales, and produces documentation artifacts that capture what, when, why, and when not to use each token or component.

When to use it

  • Starting a new product or UI library that must scale across teams or platforms
  • Refactoring an inconsistent codebase to unify colors, spacing, and typography
  • Adding platform-specific exports (CSS, Tailwind, iOS/Android, Figma) from a single source
  • Preparing a migration or major version bump for design tokens or components
  • Documenting decisions and usage to prevent repeated reimplementation

Best practices

  • Define tokens first (colors, spacing, typography) and avoid hardcoded values in components
  • Use semantic names (e.g., primary, text-sm, space-2) rather than literal values
  • Follow a three-tier token model: Primitive → Semantic → Component
  • Document every decision with what, when, why, and when NOT to use it
  • Plan dark mode and platform exports up front to avoid costly retrofits
  • Limit component props; split complex components instead of adding excessive props

Example use cases

  • Create a color and spacing scale for a new product and export to Tailwind and CSS variables
  • Standardize button, input, and card components that share the same token system
  • Produce a migration guide and codemods for a breaking token rename across projects
  • Audit an existing UI library to remove token explosion and enforce semantic naming
  • Generate documentation pages that explain token intent, usage examples, and anti-patterns

FAQ

Where does the skill store its state and decisions?

All preferences, status, and decisions are stored locally under ~/design-system/, with memory.md as the primary context file.

Can tokens be exported to different platforms?

Yes. The system is designed to export a single source of truth to CSS custom properties, Tailwind config, iOS/Android formats, and Figma variables using tools like Style Dictionary.

How should breaking changes be handled?

Use semver bumps, provide migration guides and deprecation warnings, and offer codemods when possible to automate updates.