Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions .scd/plans/20261109-233523-d3-reference-corpus/decisions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
status: approved
version: 1
created_at: 2026-11-09T23:35:23+08:00
updated_at: 2026-11-09T23:35:23+08:00
recorded_timezone: Asia/Shanghai
---

# 决策与事件

- 事件ID:DEC-1
- 类型:开工
- 文件及文档版本:本目录四份 v1;依据 Issue #125 契约 + Initiative #122 图版本 2 确认 + 用户执行授权
- 目标Git SHA:main @ 5d30ce4
- 用户实际依据:Initiative 摘要"ok"(含"全部搬入"决策)+ "全部完成 scdexcute"
- 任务或Issue范围:Issue #125 范围;NOTICES 仅追加 vendor 两节
- occurred_at:null
- recorded_at:2026-11-09T23:35:23+08:00
- 未决选择:无
11 changes: 11 additions & 0 deletions .scd/plans/20261109-233523-d3-reference-corpus/implementation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
status: approved
version: 1
created_at: 2026-11-09T23:35:23+08:00
updated_at: 2026-11-09T23:35:23+08:00
recorded_timezone: Asia/Shanghai
---

# 实施计划

tarball 提取(/tmp/d3-corpus.*)→ 拷贝入 data/vendor/ → 计数与抽样 sha256 对比源 → NOTICES → 测试 → 三平台安装验证 → PR/验收/合并/关单/图版本 5
13 changes: 13 additions & 0 deletions .scd/plans/20261109-233523-d3-reference-corpus/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
status: approved
version: 1
created_at: 2026-11-09T23:35:23+08:00
updated_at: 2026-11-09T23:35:23+08:00
recorded_timezone: Asia/Shanghai
---

# 任务索引

- 任务与Issue:Delivery Issue #125(design-reference-corpus),Initiative #122 图版本 4
- 基线来源:main @ 5d30ce4(#129 合并后)
- 批准与开工事件:decisions.md DEC-1
13 changes: 13 additions & 0 deletions .scd/plans/20261109-233523-d3-reference-corpus/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
status: approved
version: 1
created_at: 2026-11-09T23:35:23+08:00
updated_at: 2026-11-09T23:35:23+08:00
recorded_timezone: Asia/Shanghai
---

# 需求(Issue #125 契约)

- data/vendor/design-systems/:plugin87 design-systems/ 全量(实测 2148 文件/31MB;Issue 中"4293"系 tree API 重复计数,搬运范围"全部"不变,验收以与源一致为准)
- data/vendor/:ui-ux-pro-max 的 google-fonts.csv、phosphor-icons-upstream.json、google-font-licenses.json
- NOTICES 追加节;A1 计数与源一致+抽样校验和;A2 全量测试绿;A3 三平台 refresh+verify-install 含完整语料
6 changes: 6 additions & 0 deletions skills/scd-uiux/data/THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@
- 许可:MIT License,版权归属上游作者
- 收录范围:`knowledge/`(styles/typography/products/ui-reasoning/ux-guidelines/icons/charts/motion/landing 共 9 张 CSV + catalog-summary.json + data-provenance.json)、`stacks/`(22 张框架 CSV)
- 改动:无(原样搬运);检索脚本 `scripts/search.mjs` 为本项目自研(node 零依赖),非上游代码

## 大体量参考语料(vendor/)

- `vendor/design-systems/`:来自 plugin87/ux-ui-agent-skills(MIT License,<https://github.com/plugin87/ux-ui-agent-skills>,main 分支)design-systems/ 目录全量原样收录(2148 文件,约 31MB;设计系统实物参照语料)
- `vendor/google-fonts.csv`、`vendor/google-font-licenses.json`、`vendor/phosphor-icons-upstream.json`:来自 nextlevelbuilder/ui-ux-pro-max-skill(MIT License,<https://github.com/nextlevelbuilder/ui-ux-pro-max-skill>,main 分支)data/ 目录原样收录;Google Fonts 元数据及其许可声明、Phosphor Icons 上游数据随文件内附
- 改动:无(原样搬运)
2,330 changes: 2,330 additions & 0 deletions skills/scd-uiux/data/vendor/design-systems/catalog.md

Large diffs are not rendered by default.

91 changes: 91 additions & 0 deletions skills/scd-uiux/data/vendor/design-systems/crosswalk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Design-System Crosswalks (curated)

Concrete role mappings for the most-requested systems, applying the [Interop Protocol](./interop-protocol.md). Map by **role/intent**. For systems not listed, derive a mapping with the protocol's Crosswalk Method.

---

## Color-role crosswalk (the universal spine)

| Our semantic role | Material 3 | Apple HIG | Fluent 2 | Carbon | shadcn/ui | Radix Colors |
|-------------------|-----------|-----------|----------|--------|-----------|--------------|
| `action.primary` | `primary` | `tintColor` / accent | `brand` / `accent` | `interactive` / `$button-primary` | `--primary` | step `9` (solid) |
| `action.primary-hover` | `primary` + state layer | accent (pressed) | `brand hover` | `$button-primary-hover` | `--primary` (hover) | step `10` |
| `on-action` (text on primary) | `onPrimary` | label-on-accent | `text-on-accent` | `$text-on-color` | `--primary-foreground` | contrast step `12`/`1` |
| `surface.page` | `surface` / `background` | systemBackground | `neutralBackground1` | `$background` | `--background` | step `1`/`2` |
| `surface.card` | `surfaceContainer` | secondarySystemBackground | `neutralBackground2` | `$layer` | `--card` | step `2`/`3` |
| `border.default` | `outlineVariant` | separator | `neutralStroke2` | `$border-subtle` | `--border` | step `6` |
| `border.strong` | `outline` | opaqueSeparator | `neutralStroke1` | `$border-strong` | `--input` | step `7`/`8` |
| `text.primary` | `onSurface` | label | `neutralForeground1` | `$text-primary` | `--foreground` | step `12` |
| `text.secondary` | `onSurfaceVariant` | secondaryLabel | `neutralForeground2` | `$text-secondary` | `--muted-foreground` | step `11` |
| `feedback.error` | `error` | systemRed | `dangerForeground` | `$support-error` | `--destructive` | `red` step `9` |
| `feedback.success` | `tertiary`/custom | systemGreen | `successForeground` | `$support-success` | custom | `green` step `9` |
| `focus-ring` | `primary` outline | focusRing/keyboard | `strokeFocus` | `$focus` | `--ring` | step `8` (focus) |

> Material 3 conveys hover/press via **state layers** (opacity overlays), not separate hex. Map our `-hover`/`-active` tokens to the equivalent state-layer opacity (`tokens/opacity.json`). Radius/elevation differ per system; see below.

---

## Other axes

| Axis | Material 3 | Apple HIG | Fluent 2 | Carbon | shadcn/ui |
|------|-----------|-----------|----------|--------|-----------|
| **Base grid** | 4dp | 8pt (4pt half-steps) | 4px | 8px (2x grid) | 4px (Tailwind) |
| **Type ramp** | Display/Headline/Title/Body/Label | Large Title→Caption (SF) | Display→Caption | Productive/Expressive | Tailwind text-* |
| **Radius** | xs-xl (`shape`) | continuous-corner, ~`8-14pt` | `borderRadius` 2-8px | `0-8px` (sharp-leaning) | `--radius` (0.5rem default) |
| **Elevation** | dp tonal + shadow (0-5) | thin shadows / materials | depth 4/8/16/64 | `01-05` boxshadow | `shadow-sm…lg` |

---

## Per-system notes

### Material Design 3 (Google)
Tokens are role-based and dynamic-color-driven. Map our semantics → MD3 roles above; for **dynamic color**, treat MD3's generated tonal palette as primitives and our semantics as the role layer. Use `tokens/opacity.json` for state layers. Built-in motion → our `tokens/motion.json`. For the **React implementation (MUI)**, theme via `createTheme` (see `frameworks/adapters/mui.md`).

### Apple HIG (iOS/macOS)
No hex token file: uses semantic system colors that adapt to light/dark/accessibility automatically. Map our semantics → system colors; let the OS handle dark mode. See `frameworks/swiftui.md` for the asset-catalog mechanism. Respect Dynamic Type (our type scale → `@ScaledMetric`).

### Fluent 2 (Microsoft)
Neutral-heavy with `brand` ramp + depth tokens. Map via the table; Fluent's `neutralBackground1..6` ladder → our `surface.*` elevation. Strong high-contrast-mode story; verify against our `accessibility` rules.

### Carbon (IBM)
Sharp, grid-strict, enterprise. 2x grid (8px), restrained radius. Map `$layer`/`$field`/`$border-*` tokens; Carbon's token names are role-based already, near-1:1 with our semantics.

### shadcn/ui
Copy-in components using CSS variables (`--primary`, `--background`, …): the **closest match to our model**. Re-point shadcn's `:root` variables to our token values and components inherit instantly. Built on Radix primitives (behavior + a11y). Best low-friction target for web.

### Radix (Primitives + Colors)
Primitives = unstyled behavior/a11y; Colors = 12-step scales. Map roles to steps (table). Style entirely from our tokens. Ideal headless foundation.

### Chakra / Mantine
Theme via their config (`createSystem` / `createTheme`). Both mirror our 3-tier model closely (Chakra has primitive **tokens** + **semanticTokens**; Mantine has primitive scales + `primaryColor`). Override base unit, radius, primary; keep our 8-state + a11y. See `frameworks/adapters/chakra.md` and `frameworks/adapters/mantine.md`.

---

## Extended crosswalks (Ant · Polaris · Primer · Atlassian · Bootstrap)

### Color-role crosswalk (extended)

| Our semantic role | Ant Design 5 | Shopify Polaris | GitHub Primer | Atlassian (ADS) | Bootstrap 5 |
|-------------------|--------------|-----------------|---------------|-----------------|-------------|
| `action.primary` | `colorPrimary` | `--p-color-bg-fill-brand` | `--button-primary-bgColor-rest` / `accent.fg` | `color.background.brand.bold` | `--bs-primary` |
| `action.primary-hover` | `colorPrimaryHover` | `…bg-fill-brand-hover` | `…bgColor-hover` | `…brand.bold.hovered` | `--bs-primary` + `:hover` (shade) |
| `on-action` | `colorTextLightSolid` | `--p-color-text-brand-on-bg-fill` | `--button-primary-fgColor-rest` | `color.text.inverse` | `--bs-btn-color` (`#fff`) |
| `surface.page` | `colorBgLayout` | `--p-color-bg` | `--bgColor-default` / `canvas.default` | `color.background.surface` | `--bs-body-bg` |
| `surface.card` | `colorBgContainer` | `--p-color-bg-surface` | `--bgColor-muted` / `canvas.subtle` | `color.background.surface.raised` | `--bs-card-bg` |
| `border.default` | `colorBorderSecondary` | `--p-color-border` | `--borderColor-muted` | `color.border` | `--bs-border-color` |
| `border.strong` | `colorBorder` | `--p-color-border-strong` | `--borderColor-default` | `color.border.bold` | `--bs-border-color` (darker) |
| `text.primary` | `colorText` | `--p-color-text` | `--fgColor-default` / `fg.default` | `color.text` | `--bs-body-color` |
| `text.secondary` | `colorTextSecondary` | `--p-color-text-secondary` | `--fgColor-muted` | `color.text.subtle` | `--bs-secondary-color` |
| `feedback.error` | `colorError` | `--p-color-text-critical` | `--fgColor-danger` / `danger.fg` | `color.text.danger` | `--bs-danger` |
| `feedback.success` | `colorSuccess` | `--p-color-text-success` | `--fgColor-success` / `success.fg` | `color.text.success` | `--bs-success` |
| `focus-ring` | `colorPrimaryBorder` (+ outline) | `--p-color-border-focus` | `--focus-outlineColor` / `accent.emphasis` | `color.border.focused` | `--bs-focus-ring-color` |

> Bootstrap also exposes `--bs-border-radius`, `--bs-body-font-family`, `$spacer`. Primer ships **both** functional vars (`--fgColor-*`, `--bgColor-*`) and the older `@primer/primitives` scale names (`fg.default`, `accent.emphasis`). Prefer the functional vars.

### Per-system notes

- **Ant Design 5 (`theme.token` + algorithm):** token-based theming via `ConfigProvider theme={{ token, algorithm }}`. Set `colorPrimary`, `borderRadius`, `fontFamily`, `controlHeight` from our tokens; `algorithm: theme.darkAlgorithm` for dark mode (align with `[data-theme]`). Component-level overrides under `theme.components`. Very opinionated motion/shadows: map to our `tokens/motion.json` + `tokens/shadows.json`.
- **Shopify Polaris (CSS custom properties):** consumes a fixed set of `--p-color-*` / `--p-space-*` / `--p-border-radius-*` design tokens. You theme by re-pointing those vars to our values within an `AppProvider`. Polaris is purpose-built for admin/commerce density, so respect its spacing rhythm. Strong a11y baseline; still validate against our checklist.
- **GitHub Primer (`@primer/primitives`):** ships CSS variables + a React lib. Map roles to the **functional** layer (`--fgColor-*`, `--bgColor-*`, `--borderColor-*`); `data-color-mode="dark"` + `data-dark-theme` drive theming; align with our `[data-theme]`. Primer's scale is GitHub-flavored; expect to override accent + radius.
- **Atlassian Design System (`@atlaskit/tokens`):** role/intent token names (`color.background.brand.bold`, `color.text.subtle`), near-1:1 with our semantics. Themed via the token package + `setGlobalTheme({ colorMode })`. Migration is mostly a name remap; keep the 8-state coverage where ADS components are sparse.
- **Bootstrap 5:** override Sass `$variables` (build-time) or `--bs-*` CSS vars (runtime); `data-bs-theme="dark"` for dark mode. Map base spacing (`$spacer`), `$border-radius`, `$primary`/`$danger`/etc., and `$font-family-base`. **Supplement focus-visible contrast and the error/loading/selected states** Bootstrap leaves thin. Full worked example: `frameworks/adapters/bootstrap.md`.
61 changes: 61 additions & 0 deletions skills/scd-uiux/data/vendor/design-systems/interop-protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Design-System Interop Protocol

Map this token system **to or from** any external design system: Material Design 3, Apple HIG, Fluent, Carbon, Ant, Polaris, Primer, Radix, shadcn/ui, Chakra, Mantine, Bootstrap, or a bespoke brand system. Like the [Framework Adapter Protocol](../frameworks/adapter-protocol.md), this is a *method*, not one file per system. Curated concrete crosswalks for the most common targets live in [`crosswalk.md`](./crosswalk.md); the 138 brand specs in [`library/`](./library/) are sources you can map from.

> Goal: adopt, migrate, or bridge, without a rewrite. You produce a **mapping**, then optionally a thin **bridge layer**, then **verify** nothing regressed (especially contrast and states).

---

## The Crosswalk Method

For any system, map these six axes. Match by **role/intent**, not by name.

| Axis | Our side | What to find in the other system |
|------|----------|----------------------------------|
| **Color roles** | `semantic.action.*`, `surface.*`, `text.*`, `feedback.*` | their primary/secondary, surface/background, on-color, error/warning/success roles |
| **Type scale** | `tokens/typography.json` (Major Third) | their type ramp / "type scale" / text styles; map by step, not px |
| **Spacing unit** | 4px base scale | their base unit (4dp/8dp grids common); convert by ratio |
| **Radius** | `tokens/borders.json` | their shape/corner scale |
| **Elevation** | `tokens/shadows.json` (5 levels) | their elevation/shadow tiers (Material: dp; Fluent: depth) |
| **Motion** | `tokens/motion.json` | their duration/easing tokens |

Output a table: *our token → their token → value note*. Flag any role they have that we don't (and vice-versa) as a gap to decide on.

---

## Directions

### A. Map FROM an external system → our tokens (adopt their look)
1. Pull their published tokens (or read the relevant `library/<name>/DESIGN.md`).
2. Re-point our **semantic** tokens to their values (primitives stay; see `tokens/colors.json` dark strategy).
3. Keep our **component** token structure. Only the resolved values change.
4. Verify contrast/state coverage (below).

### B. Map TO an external system → our components on their foundation (adopt their stack)
1. Identify their component primitives (e.g. Radix unstyled, shadcn copy-in, MUI components).
2. Apply our token values as their theme (their `ThemeProvider` / CSS vars / config).
3. Keep our 8-state + a11y requirements; fill any state they omit.

### C. Migrate between systems (replace one with another)
**Audit → Map → Bridge → Verify:**
1. **Audit**: inventory the current system's tokens + components in the codebase.
2. **Map**: build the crosswalk table; mark 1:1, approximate, and missing.
3. **Bridge**: introduce a compatibility layer that aliases old names to new tokens, so migration is incremental, not big-bang. Deprecate aliases over time.
4. **Verify**: see below; migrate screen-by-screen behind the bridge.

---

## Headless vs. styled targets

- **Headless (Radix, Headless UI, Ark, React Aria):** they provide behavior + a11y; you provide *all* styling from our tokens. Best fit, least conflict.
- **Copy-in (shadcn/ui):** components live in your repo; re-skin their Tailwind classes to our CSS-var tokens directly. See `crosswalk.md`.
- **Styled libraries (MUI, Ant, Chakra, Mantine, Bootstrap):** theme via their config object/CSS vars; accept their component API, override tokens. Watch for opinionated defaults that fight our spacing/radius; override globally.

---

## Verification (every interop)
- **Contrast:** re-check every mapped color pair against `accessibility/wcag-checklist.md` (4.5:1 text, 3:1 UI). A brand value that fails must be adjusted: taste never overrides POUR. Use `scripts/contrast.py` / the `a11y-audit` skill.
- **State coverage:** confirm the target renders all applicable of the 8 states; add missing focus-visible/disabled/loading.
- **Dark mode:** verify the mapping swaps correctly at the semantic layer.
- **Density/RTL:** if the target supports them, confirm tokens flow through.
- **Visual + functional spot-check** per migrated screen.
Loading
Loading