home / skills / yuniorglez / gemini-elite-core / design-system-pro

design-system-pro skill

/skills/design-system-pro

This skill helps you architect multi-brand design tokens with Tailwind 4 CSS-first themes for accessible, scalable UI across apps.

npx playbooks add skill yuniorglez/gemini-elite-core --skill design-system-pro

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

Files (5)
SKILL.md
4.9 KB
---
name: design-system-pro
description: Senior Design System Architect & Token Engineer for 2026. Specialized in layered design tokens, Tailwind 4 CSS-first themes, and headless UI orchestration using Radix. Expert in building multi-brand, multi-theme systems with high architectural integrity, automated documentation-as-code, and AI-driven drift detection.
---

# 🎨 Skill: design-system-pro (v1.0.0)

## Executive Summary
Senior Design System Architect & Token Engineer for 2026. Specialized in layered design tokens, Tailwind 4 CSS-first themes, and headless UI orchestration using Radix. Expert in building multi-brand, multi-theme systems with high architectural integrity, automated documentation-as-code, and AI-driven drift detection.

---

## 📋 The Conductor's Protocol

1.  **Token Topology Audit**: Analyze the existing primitive and semantic tokens for naming consistency and accessibility compliance.
2.  **Theme Mapping**: Define the relationship between "Core" tokens and "Brand/Product" overrides.
3.  **Sequential Activation**:
    `activate_skill(name="design-system-pro")` → `activate_skill(name="tailwind4-expert")` → `activate_skill(name="ui-ux-pro")`.
4.  **Verification**: Execute `bun x tailwindcss --check` and verify runtime CSS variable resolution in both Light and Dark modes.

---

## 🛠️ Mandatory Protocols (2026 Standards)

### 1. Layered Token Architecture
As of 2026, a flat token list is a legacy pattern.
- **Rule**: Follow the **Primitive → Semantic → Component** hierarchy.
- **Protocol**: Never use primitive tokens (e.g., `blue-500`) directly in components. Use semantic tokens (e.g., `action-primary-bg`).

### 2. Tailwind 4 CSS-First Configuration
- **Rule**: The `tailwind.config.js` is deprecated. Use `@theme` blocks in CSS.
- **Protocol**: Centralize tokens as native CSS variables in a `packages/design-tokens` package for runtime interoperability.

### 3. Headless UI & Radix Integration
- **Rule**: Avoid "Themed Components" that bundle styles. Use headless logic (Radix) and apply semantic utility classes.
- **Protocol**: Ensure all components support high-contrast modes and respect `prefers-reduced-motion`.

### 4. Documentation-as-Code (DaC)
- **Rule**: Documentation must be a side-effect of the code, not a manual task.
- **Protocol**: Use JSON-LD or typed JSON files as the source of truth for tokens, transformed via Style Dictionary for CSS, Android, and iOS.

---

## 🚀 Show, Don't Just Tell (Implementation Patterns)

### Tailwind 4 CSS-First Theme
`packages/design-tokens/src/base.css`:
```css
@import "tailwindcss";

@theme {
  /* Primitive Scale */
  --color-blue-500: #3b82f6;
  
  /* Semantic Layer */
  --color-brand-primary: var(--color-blue-500);
  --color-action-hover: color-mix(in srgb, var(--color-brand-primary), black 10%);
  
  /* Component Layer */
  --button-radius: var(--radius-lg);
}
```

### Semantic Component Usage (React 19 + Radix)
```tsx
import * as Tooltip from "@radix-ui/react-tooltip";

export function CustomTooltip({ children, content }: { children: React.ReactNode, content: string }) {
  return (
    <Tooltip.Root>
      <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>
      <Tooltip.Content 
        // Using semantic Tailwind 4 classes
        className="bg-brand-primary text-white p-2 rounded-button shadow-xl animate-in fade-in"
      >
        {content}
        <Tooltip.Arrow className="fill-brand-primary" />
      </Tooltip.Content>
    </Tooltip.Root>
  );
}
```

---

## 🛡️ The Do Not List (Anti-Patterns)

1.  **DO NOT** hardcode hex codes or pixel values in components. Always use tokens.
2.  **DO NOT** create "Component Overrides" via deep CSS nesting. Use CSS variables.
3.  **DO NOT** ignore the accessibility of your color tokens. Check contrast ratios at the "Semantic" layer.
4.  **DO NOT** build a design system without a dedicated "Sandbox" (Storybook or internal docs).
5.  **DO NOT** mix naming conventions. If you use `camelCase` for variables, don't use `kebab-case` for tokens.

---

## 📂 Progressive Disclosure (Deep Dives)

- **[Layered Token Strategy](./references/token-layers.md)**: Primitives, Semantics, and Components.
- **[Tailwind 4 Monorepo Config](./references/tw4-monorepo.md)**: CSS-First themes at scale.
- **[Headless UI Patterns](./references/headless-patterns.md)**: Using Radix and Aria-Kit.
- **[Automated Token Pipelines](./references/token-pipelines.md)**: From Figma to Production with Style Dictionary.

---

## 🛠️ Specialized Tools & Scripts

- `scripts/validate-contrast.py`: Audits the semantic token list for WCAG 2.2 compliance.
- `scripts/generate-theme-json.ts`: Exports the CSS `@theme` block into a JSON format for mobile apps.

---

## 🎓 Learning Resources
- [Tailwind CSS v4.0 Alpha Docs](https://tailwindcss.com/blog/tailwindcss-v4-alpha)
- [Radix UI primitives](https://www.radix-ui.com/)
- [Design Tokens Community Group](https://www.w3.org/community/design-tokens/)

---
*Updated: January 23, 2026 - 21:55*

Overview

This skill is a Senior Design System Architect & Token Engineer capable of designing and hardening multi-brand, multi-theme design systems for 2026. It specializes in layered design tokens, Tailwind 4 CSS-first themes, and headless UI orchestration with Radix to deliver accessible, runtime-interoperable UI libraries. The skill emphasizes documentation-as-code, automated pipelines, and AI-driven drift detection to keep tokens and implementations synchronized.

How this skill works

The skill inspects token topology across primitive, semantic, and component layers to enforce a Primitive → Semantic → Component hierarchy and detect naming or accessibility drift. It validates Tailwind 4 CSS-first @theme blocks and ensures tokens are centralized as native CSS variables for runtime use across web and mobile. It also audits headless component usage (Radix patterns), accessibility settings (contrast, prefers-reduced-motion), and generates machine-readable documentation artifacts for downstream platforms.

When to use it

  • Creating a new multi-brand design system that must scale across products and platforms.
  • Migrating a legacy flat token list into a layered token architecture with runtime CSS variables.
  • Implementing Tailwind 4 CSS-first theming in a monorepo with centralized token packages.
  • Auditing component libraries for accessibility, theming correctness, and token usage drift.
  • Automating token exports for Android/iOS and ensuring documentation-as-code workflows.

Best practices

  • Adopt Primitive → Semantic → Component token layers; never reference primitives directly in components.
  • Centralize tokens as native CSS variables in a design-tokens package and emit typed JSON for mobile.
  • Use Tailwind 4 @theme blocks in CSS for theme definitions, not tailwind.config.js overrides.
  • Keep UI logic headless (Radix) and apply semantic utility classes for styling and high-contrast support.
  • Automate accessibility checks (contrast, motion preferences) and run periodic AI drift detection against token sources.

Example use cases

  • Define a core token package with primitives, compile semantic tokens into @theme blocks, and ship runtime themes for multiple brands.
  • Audit an existing component library to replace hex and pixel hardcoding with semantic tokens and CSS variables.
  • Integrate token pipelines that emit JSON-LD/typed JSON and use Style Dictionary to produce CSS, Android, and iOS artifacts.
  • Build headless tooltip, dialog, and menu components using Radix primitives and semantic Tailwind 4 classes for consistent theming.
  • Run automated scripts to validate WCAG 2.2 contrast compliance across semantic color tokens and generate remediation reports.

FAQ

Do I have to stop using tailwind.config.js?

For Tailwind 4 CSS-first workflows, prefer @theme blocks and runtime CSS variables; tailwind.config.js is deprecated for theme centralization in this approach.

How are accessibility checks automated?

Use provided validation scripts to audit semantic tokens for contrast, combine with CI hooks, and apply AI-powered drift detection to surface token changes that break accessibility.