Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

design-system-tokens设计系统代币

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

2,027

周安装

82

GitHub Stars

160

下载量

636
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:design-system-tokens(设计系统代币)
来源仓库:https://github.com/yonatangross/orchestkit
仓库路径:skills/design-system-tokens
安装命令:
npx skills add https://github.com/yonatangross/orchestkit --skill design-system-tokens
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill design-system-tokens

简介

用于管理符合 W3C 标准的 design tokens,实现设计工具与代码的无缝对接。

  • 适合多平台项目(Web/iOS/Android),提供色彩、间距和动效的统一控制。
  • 使用时需遵循 DTCG 规范,输出 JSON 格式的令牌文件供 Style Dictionary 转换。
  • 内置对比度检测和语义化命名规则,确保可访问性和长期可维护性。
  • design-system-tokens 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Design System Tokens

Design token management following the W3C Design Token Community Group (DTCG) specification. Tokens provide a single source of truth for design decisions — colors, spacing, typography, elevation — shared between design tools (Figma, Penpot) and code (CSS, Tailwind, iOS, Android). Major adopters include Figma (Variables API), Google (Material Design 3), Microsoft (Fluent UI), and Shopify (Polaris).

Quick Reference

CategoryRule FileImpactWhen to Use
W3C Token Formattokens-w3c-format.mdCRITICALCreating or reading .tokens.json files
Contrast Enforcementtokens-contrast-enforcement.mdCRITICALValidating WCAG contrast at token definition time
Three-Tier Hierarchytokens-three-tier.mdHIGHOrganizing tokens into global/alias/component layers
OKLCH Color Spacetokens-oklch-color.mdHIGHDefining colors with perceptual uniformity
Spacing & Depthtokens-spacing-depth.mdHIGHDefining elevation shadows and spacing scales as tokens
Style Dictionarytokens-style-dictionary.mdHIGHTransforming tokens to CSS/Tailwind/iOS/Android
Theming & Dark Modetokens-theming-darkmode.mdHIGHImplementing theme switching and dark mode
Versioningtokens-versioning.mdHIGHEvolving tokens without breaking consumers

Total: 8 rules across 8 categories

Quick Start

W3C DTCG token format (.tokens.json):

{
  "color": {
    "primary": {
      "50": {
        "$type": "color",
        "$value": "oklch(0.97 0.01 250)",
        "$description": "Lightest primary shade"
      },
      "500": {
        "$type": "color",
        "$value": "oklch(0.55 0.18 250)",
        "$description": "Base primary"
      },
      "900": {
        "$type": "color",
        "$value": "oklch(0.25 0.10 250)",
        "$description": "Darkest primary shade"
      }
    }
  },
  "spacing": {
    "sm": {
      "$type": "dimension",
      "$value": "8px"
    },
    "md": {
      "$type": "dimension",
      "$value": "16px"
    },
    "lg": {
      "$type": "dimension",
      "$value": "24px"
    }
  }
}

Three-Tier Token Hierarchy

Tokens are organized in three layers — each referencing the layer below:

TierPurposeExample
GlobalRaw valuescolor.blue.500 = oklch(0.55 0.18 250)
AliasSemantic meaningcolor.primary = {color.blue.500}
ComponentScoped usagebutton.bg = {color.primary}

This separation enables theme switching (swap alias mappings) without touching component tokens.

{
  "color": {
    "blue": {
      "500": { "$type": "color", "$value": "oklch(0.55 0.18 250)" }
    },
    "primary": { "$type": "color", "$value": "{color.blue.500}" },
    "action": {
      "default": { "$type": "color", "$value": "{color.primary}" }
    }
  }
}

OKLCH Color Space

OKLCH (Oklab Lightness, Chroma, Hue) provides perceptual uniformity — equal numeric changes produce equal visual changes. This solves HSL's problems where hsl(60, 100%, 50%) (yellow) appears far brighter than hsl(240, 100%, 50%) (blue) at the same lightness.

/* OKLCH: L (0-1 lightness), C (0-0.4 chroma/saturation), H (0-360 hue) */
--color-primary: oklch(0.55 0.18 250);
--color-primary-hover: oklch(0.50 0.18 250);  /* Just reduce L for darker */

Key advantage: adjusting lightness channel alone creates accessible shade scales with consistent contrast ratios.

Detailed Rules

Each rule file contains incorrect/correct code pairs and implementation guidance.

Read("${CLAUDE_SKILL_DIR}/rules/tokens-w3c-format.md")

Read("${CLAUDE_SKILL_DIR}/rules/tokens-contrast-enforcement.md")

Read("${CLAUDE_SKILL_DIR}/rules/tokens-three-tier.md")

Read("${CLAUDE_SKILL_DIR}/rules/tokens-oklch-color.md")

Read("${CLAUDE_SKILL_DIR}/rules/tokens-spacing-depth.md")

Read("${CLAUDE_SKILL_DIR}/rules/tokens-style-dictionary.md")

Read("${CLAUDE_SKILL_DIR}/rules/tokens-theming-darkmode.md")

Read("${CLAUDE_SKILL_DIR}/rules/tokens-versioning.md")

Style Dictionary Integration

Style Dictionary transforms W3C tokens into platform-specific outputs (CSS custom properties, Tailwind theme, iOS Swift, Android XML). Configure a single config.json to generate all platform outputs from one token source.

Style Dictionary 5.x (current) — pin style-dictionary >= 5.3.0. Relevant deltas vs the 4.x documented elsewhere: - Native OKLCH output — the custom color/oklch transform required in 4.x is no longer needed; the built-in css/variables formatter emits OKLCH directly when the input token uses $type: "color" with an OKLCH value. Remove hand-rolled transforms. - DTCG v2025.10 dimension object$type: "dimension" now takes an object {"value": 16, "unit": "px"} instead of the bare string "16px". 5.3+ parses both, but new tokens should use the object form. - Hooks API replaces the 4.x registerTransform / registerFormat global calls — pass hooks in the config instead for better tree-shaking.

See rules/tokens-style-dictionary.md for configuration patterns and custom transforms.

Dark Mode & Theming

Token-based theming maps alias tokens to different global values per theme. Dark mode is one theme — you can support any number (high contrast, brand variants, seasonal).

:root {
  --color-surface: oklch(0.99 0.00 0);
  --color-on-surface: oklch(0.15 0.00 0);
}

[data-theme="dark"] {
  --color-surface: oklch(0.15 0.00 0);
  --color-on-surface: oklch(0.95 0.00 0);
}

See rules/tokens-theming-darkmode.md for full theme switching patterns.

Versioning & Migration

Tokens evolve. Use semantic versioning for your token packages, deprecation annotations in token files, and codemods for breaking changes.

{
  "color": {
    "brand": {
      "$type": "color",
      "$value": "oklch(0.55 0.18 250)",
      "$extensions": {
        "com.tokens.deprecated": {
          "since": "2.0.0",
          "replacement": "color.primary.500",
          "removal": "3.0.0"
        }
      }
    }
  }
}

See rules/tokens-versioning.md for migration strategies.

shadcn/ui v4 Preset Integration

shadcn CLI v4 encodes style + theme + fonts + icons into a shareable preset code. Presets generate globals.css with CSS variables that map to the token hierarchy:

npx shadcn@latest init --preset b2D0xPaDb  # Luma + Emerald + Geist

Luma elevation tokens (the most token-rich style):

/* Luma elevation system — soft depth hierarchy */
--shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);  /* shadow-md */
--ring-card: 0 0 0 1px var(--foreground) / 0.05;  /* ring-1 ring-foreground/5 */
--shadow-dropdown: 0 4px 6px -1px rgb(0 0 0 / 0.1);  /* shadow-lg */
--shadow-dialog: 0 10px 15px -3px rgb(0 0 0 / 0.1);  /* shadow-xl */
--radius-button: var(--radius-4xl);  /* pill-shaped */
--radius-card: var(--radius-4xl);
--radius-input: var(--radius-3xl);

Detection: Read components.json"style" field to determine which elevation/radius tokens are active. Map preset-generated CSS variables to W3C DTCG tokens via Style Dictionary transforms.

Key Decisions

DecisionRecommendation
Token formatW3C DTCG .tokens.json with $type/$value
Color spaceOKLCH for perceptual uniformity
HierarchyThree-tier: global, alias, component
Build toolStyle Dictionary 4.x with W3C parser
ThemingCSS custom properties with data-theme attribute
Token referencesUse {path.to.token} alias syntax

Anti-Patterns (FORBIDDEN)

  • Hardcoded values in components: Always reference tokens, never raw #hex or 16px
  • Flat token structure: Use three-tier hierarchy for theme-ability
  • HSL for shade scales: OKLCH produces perceptually uniform scales; HSL does not
  • Skipping $type: Every token must declare its type for tooling compatibility
  • Theme via class toggling raw values: Use semantic alias tokens that remap per theme
  • Unversioned token packages: Token changes break consumers; use semver

References

ResourceDescription
references/w3c-token-spec.mdW3C DTCG specification overview
references/style-dictionary-config.mdStyle Dictionary 5.x configuration guide
references/token-naming-conventions.mdNaming patterns and conventions

Agent Integration

The design-system-architect agent orchestrates token workflows end-to-end — from Figma Variables extraction through Style Dictionary transformation to theme deployment. When working on token architecture decisions, the agent coordinates with frontend-ui-developer for component token consumption and accessibility skills for contrast validation.

Related Skills

  • ork:ui-components — Component library patterns (shadcn/ui, Radix)
  • ork:accessibility — WCAG compliance, contrast ratios
  • ork:responsive-patterns — Responsive breakpoints, fluid typography
  • ork:figma-design-handoff — Figma Variables to tokens pipeline

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.1%
按下载量换算223

Claude

31.76%
按下载量换算202

Cursor

20.73%
按下载量换算132

Gemini CLI

9.06%
按下载量换算58

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills