Skip to content

Adonis0123/adonis-skills / skills/design-system

design-system

Verified

Run a shared multi-site design system where every product swaps only its interface accent color: analyze any website's theme colors and roles, wire a new site or plugin to the semantic tokens, and lint plugins for hard-coded colors, fallback values and unknown roles. Use when the user gives a URL and asks what its theme or palette is, asks to connect a site to the design system, add an accent theme, or check whether a plugin follows the theme contract. Skip one-off styling tweaks, logo or illustration work, and plugin-architecture refactors (code-plugin-architecture).

FileKindSize
SKILL.mdskill md9.6 KB
references/token-format.mdmarkdown3.2 KB
scripts/check_tokens.pyscript5.6 KB
scripts/lint_plugin.pyscript2.8 KB
scripts/test_check_tokens.pyscript2.6 KB

references/token-format.md

View on GitHub
# tokens.json 格式

`scripts/check_tokens.py` 读这份格式。一个文件放完整个设计系统,所有主题共用同一组角色名。

```jsonc
{
  "scales": {                       // 共用色阶,每条浅、深各 12 阶(Radix 式:1–2 背景,3–5 组件底,6–8 边框,9–10 实色,11–12 文字)
    "neutral": { "light": ["#…", …12], "dark": ["#…", …12] },   // 必有
    "amber":   { "light": [...], "dark": [...] }                 // 其他色阶按需加,引用名是 {amber-11}
  },
  "functional": { "success": "#…", "warning": "#…", "danger": "#…", "info": "#…" },  // 引用名 {fn-success}
  "themes": {                       // 每套主题只换界面强调色
    "<主题 id>": {
      "name": "显示名",
      "scale": { "light": [12 阶], "dark": [12 阶] },          // 引用名 {accent-1} … {accent-12}
      "solid": "#…",                // 主按钮底,引用名 {accent-solid};深浅不同时写 { "light": "#…", "dark": "#…" }
      "solid-foreground": "#…"      // 主按钮字,引用名 {accent-solid-foreground};同样可分深浅
    }
  },
  "roles": {                        // 语义角色,名字用 shadcn 的成对写法
    "light": { "background": "{neutral-2}", "primary": "{accent-solid}", "selected": "color-mix(in srgb, {accent-9} 12%, {card})", … },
    "dark":  { … 同一组键 … }
  },
  "type": { … }, "radius": { … }, "space": { … }
}
```

## 引用规则

- `{名字}` 先在色阶、功能色、当前主题里找,找不到再找同一模式下的其他角色(例如 `{card}`)。
- `{accent-*}` 按当前主题解析,所以角色表只写一份,每套主题自动套用。
- 半透明叠色只写 `color-mix(in srgb, X p%, Y)`,`Y` 可以是 `transparent`。检查脚本能把这种写法算成实色,再测对比度。

## 检查脚本测哪些对比度

| 文字                          | 底                               | 最低                                           |
| ----------------------------- | -------------------------------- | ---------------------------------------------- |
| `foreground`                  | `background`、`card`、`selected` | 4.5                                            |
| `muted-foreground`            | `background`、`card`             | 4.5                                            |
| `primary-foreground`          | `primary`                        | 3.0(饱和原色配白字,见 SKILL.md「按钮规则」) |
| `link`                        | `card`                           | 4.5                                            |
| `accent-foreground`           | `accent`                         | 4.5                                            |
| `nav-active-foreground`       | `nav-active` 叠在 `sidebar` 上   | 4.5                                            |
| `warning-text`、`danger-text` | `card`                           | 4.5                                            |
| `subtle-foreground`           | `card`                           | 3.0(只给占位符和提示)                        |

缺这些角色时脚本会报错。不需要某个角色的设计系统,把对应行从脚本的 `PAIRS` 里删掉。
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall