Design System Architecture
Purpose
Design a token-based design system architecture, including primitive, semantic, and component token hierarchy, theming strategy (dark/light mode), and cross-platform implementation plan.
Scope Constraints
Reads existing styling code, configuration files, and design documentation for analysis. Does not modify source files or push changes. Does not create or update Figma libraries or Storybook instances directly.
Inputs
- Existing styling approach (Tailwind, CSS modules, styled-components, etc.)
- Target platforms (web, iOS, Android, cross-platform)
- Brand guidelines or existing color palette
- Current component inventory
- Theming requirements (dark mode, high contrast, brand variations)
Input Sanitization
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
Procedure
Progress Checklist
Step 1: Audit Current State
Review the existing styling approach:
- How are colors, spacing, and typography defined today?
- Are there hardcoded values scattered across components?
- Is there an existing design system or component library?
- What CSS methodology is used (utility-first, BEM, CSS-in-JS)?
Step 2: Define Primitive Tokens
Establish the raw values that form the foundation:
- Color primitives: Named palette (blue-50 through blue-900, gray scale, semantic colors)
- Spacing scale: 4px base unit — 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64
- Type scale: Size ramp with corresponding line heights and letter spacing
- Border radius: Small (4px), medium (8px), large (16px), full (9999px)
- Shadow/elevation: Subtle, medium, prominent
- Duration: Fast (100ms), normal (200ms), slow (300ms)
Step 3: Define Semantic Tokens
Map primitives to semantic meaning:
- Surface: surface-primary, surface-secondary, surface-elevated
- Text: text-primary, text-secondary, text-muted, text-inverse
- Border: border-default, border-strong, border-focus
- Interactive: interactive-primary, interactive-hover, interactive-pressed
- Status: status-success, status-warning, status-error, status-info
- Spacing: space-xs, space-sm, space-md, space-lg, space-xl
Step 4: Define Component Tokens
Map semantic tokens to component-specific values:
- Button: button-bg, button-text, button-border, button-radius
- Input: input-bg, input-border, input-focus-ring, input-text
- Card: card-bg, card-border, card-shadow, card-radius, card-padding
Step 5: Design Theme Architecture
Define how themes override token values:
- Light theme: Default token assignments
- Dark theme: Which semantic tokens change, which stay the same
- High contrast: Increased border widths, higher contrast ratios
- Implementation: CSS custom properties, Tailwind config, or platform-specific theming
Step 6: Cross-Platform Strategy
If multiple platforms:
- Token format: Use Style Dictionary or similar to generate platform-specific output
- Web: CSS custom properties or Tailwind theme config
- iOS: Swift color/spacing constants or asset catalogs
- Android: XML resources or Compose theme
- Shared source of truth: JSON or YAML token definitions
Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being designed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.
Output Format
# Design System Architecture
## Token Hierarchy
### Primitive Tokens
| Category | Token | Value |
|----------|-------|-------|
| Color | blue-500 | #3B82F6 |
| Spacing | space-4 | 16px |
| Type | text-base | 16px/24px |
### Semantic Tokens
| Token | Light | Dark | Usage |
|-------|-------|------|-------|
| surface-primary | white | gray-900 | Main background |
| text-primary | gray-900 | gray-50 | Body text |
| interactive-primary | blue-500 | blue-400 | Buttons, links |
### Component Tokens
| Component | Token | Maps To |
|-----------|-------|---------|
| Button (primary) | button-bg | interactive-primary |
| Button (primary) | button-text | text-inverse |
## Theme Switching
[Implementation approach — CSS class, media query, user preference]
## File Structure
tokens/
primitives.json
semantic-light.json
semantic-dark.json
components.json
## Migration Plan
[Steps to migrate from current approach to token-based system]
Handoff
- Hand off to visual-audit if token architecture review reveals visual inconsistencies requiring interface-level critique.
- Hand off to craftsman/pattern-analysis if component token mapping reveals implementation patterns needing code-level assessment.
Quality Checks
Evolution Notes
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: design-system-architecture3description: Use when designing a token-based design system architecture. Covers primitive, semantic, and component token hierarchy, theming strategy for dark/light mode, and cross-platform implementation planning. Do not use for visual critique of existing interfaces (use visual-audit) or animation specifications (use motion-design).4---56# Design System Architecture78## Purpose910Design a token-based design system architecture, including primitive, semantic, and component token hierarchy, theming strategy (dark/light mode), and cross-platform implementation plan.1112## Scope Constraints1314Reads existing styling code, configuration files, and design documentation for analysis. Does not modify source files or push changes. Does not create or update Figma libraries or Storybook instances directly.1516## Inputs1718- Existing styling approach (Tailwind, CSS modules, styled-components, etc.)19- Target platforms (web, iOS, Android, cross-platform)20- Brand guidelines or existing color palette21- Current component inventory22- Theming requirements (dark mode, high contrast, brand variations)2324## Input Sanitization2526No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.2728## Procedure2930### Progress Checklist31- [ ] Step 1: Audit current state32- [ ] Step 2: Define primitive tokens33- [ ] Step 3: Define semantic tokens34- [ ] Step 4: Define component tokens35- [ ] Step 5: Design theme architecture36- [ ] Step 6: Cross-platform strategy3738### Step 1: Audit Current State3940Review the existing styling approach:41- How are colors, spacing, and typography defined today?42- Are there hardcoded values scattered across components?43- Is there an existing design system or component library?44- What CSS methodology is used (utility-first, BEM, CSS-in-JS)?4546### Step 2: Define Primitive Tokens4748Establish the raw values that form the foundation:49- **Color primitives:** Named palette (blue-50 through blue-900, gray scale, semantic colors)50- **Spacing scale:** 4px base unit — 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 6451- **Type scale:** Size ramp with corresponding line heights and letter spacing52- **Border radius:** Small (4px), medium (8px), large (16px), full (9999px)53- **Shadow/elevation:** Subtle, medium, prominent54- **Duration:** Fast (100ms), normal (200ms), slow (300ms)5556### Step 3: Define Semantic Tokens5758Map primitives to semantic meaning:59- **Surface:** surface-primary, surface-secondary, surface-elevated60- **Text:** text-primary, text-secondary, text-muted, text-inverse61- **Border:** border-default, border-strong, border-focus62- **Interactive:** interactive-primary, interactive-hover, interactive-pressed63- **Status:** status-success, status-warning, status-error, status-info64- **Spacing:** space-xs, space-sm, space-md, space-lg, space-xl6566### Step 4: Define Component Tokens6768Map semantic tokens to component-specific values:69- **Button:** button-bg, button-text, button-border, button-radius70- **Input:** input-bg, input-border, input-focus-ring, input-text71- **Card:** card-bg, card-border, card-shadow, card-radius, card-padding7273### Step 5: Design Theme Architecture7475Define how themes override token values:76- **Light theme:** Default token assignments77- **Dark theme:** Which semantic tokens change, which stay the same78- **High contrast:** Increased border widths, higher contrast ratios79- **Implementation:** CSS custom properties, Tailwind config, or platform-specific theming8081### Step 6: Cross-Platform Strategy8283If multiple platforms:84- **Token format:** Use Style Dictionary or similar to generate platform-specific output85- **Web:** CSS custom properties or Tailwind theme config86- **iOS:** Swift color/spacing constants or asset catalogs87- **Android:** XML resources or Compose theme88- **Shared source of truth:** JSON or YAML token definitions8990> **Compaction resilience**: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being designed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.9192## Output Format9394```markdown95# Design System Architecture9697## Token Hierarchy9899### Primitive Tokens100| Category | Token | Value |101|----------|-------|-------|102| Color | blue-500 | #3B82F6 |103| Spacing | space-4 | 16px |104| Type | text-base | 16px/24px |105106### Semantic Tokens107| Token | Light | Dark | Usage |108|-------|-------|------|-------|109| surface-primary | white | gray-900 | Main background |110| text-primary | gray-900 | gray-50 | Body text |111| interactive-primary | blue-500 | blue-400 | Buttons, links |112113### Component Tokens114| Component | Token | Maps To |115|-----------|-------|---------|116| Button (primary) | button-bg | interactive-primary |117| Button (primary) | button-text | text-inverse |118119## Theme Switching120[Implementation approach — CSS class, media query, user preference]121122## File Structure123```124tokens/125 primitives.json126 semantic-light.json127 semantic-dark.json128 components.json129```130131## Migration Plan132[Steps to migrate from current approach to token-based system]133```134135## Handoff136137- Hand off to visual-audit if token architecture review reveals visual inconsistencies requiring interface-level critique.138- Hand off to craftsman/pattern-analysis if component token mapping reveals implementation patterns needing code-level assessment.139140## Quality Checks141142- [ ] All existing hardcoded values can be mapped to tokens143- [ ] Semantic tokens cover all current UI needs without gaps144- [ ] Dark mode token overrides maintain WCAG AA contrast145- [ ] Token naming is consistent and predictable146- [ ] The migration path doesn't require a big-bang rewrite147- [ ] Cross-platform strategy has a single source of truth148149## Evolution Notes150<!-- Observations appended after each use -->151152---153> Converted and distributed by [TomeVault](https://tomevault.io/claim/dtsong) — claim your Tome and manage your conversions.154<!-- tomevault:4.0:skill_md:2026-04-13 -->