Design SystemInternalEntities

系統裡有哪些東西在管事

Internal維護者文件,不是 Design System 內容。

這頁是什麼

這裡是 Opinion Trade 系統裡、會檢查你 / 引導你 / 提醒你的所有角色 ── 包含開發流程、CLAUDE.md 規則、build 檢查腳本、audit skill 等。

依「你什麼時候會遇到它」分組。想查規則 → 看「CLAUDE.md 規則」;想知道 build 會自動跑什麼 → 看「build 時自動跑的腳本」;想理解 audit 從哪冒出來 → 看「Skill」。

分組一覽

點一個分組會自動篩選下方清單。可以選多個,或再清除。

清單(34 / 34)

Source of Truth

CLAUDE.md 規則

Code component library is the single SoT. Figma is reference only. Semantic tokens override ad-hoc values.

何時出現

隨時自動套用

技術細節
idsource-of-truth
authorityL1-sot
typerule
scopeglobal
triggersauto
lifecyclealways
sourceCLAUDE.md > Source of Truth

Page Building Rules

CLAUDE.md 規則

Inspect before building. Compose, don't create. Scoped changes only. No extras. Show before editing.

何時出現

寫 code 前

技術細節
idpage-building-rules
authorityL1-sot
typerule
scopeglobal
triggerspre-output
lifecyclepre-write
sourceCLAUDE.md > Page Building Rules

Cross-DS Handoff

CLAUDE.md 規則

Repo is the new DS. Legacy output must route through new-ds-to-legacy-translation at output stage; never written into src/.

何時出現

隨時自動套用、你明確呼叫時

技術細節
idcross-ds-handoff
authorityL1-sot
typerule
scopeglobal
triggersauto, user-invoke
lifecyclealways
sourceCLAUDE.md > External Skill Governance > Cross-DS Handoff

Phase A — Migration / Analysis

開發流程

Analysis phase. No code output. Produces 6-section decomposition ending in Recommended Build Order.

何時出現

隨時自動套用

技術細節
idphase-a
authorityL1-sot
typeprocess
scopephase-a
triggersauto
lifecyclephase-a
sourceCLAUDE.md > Work Phases > Phase A

Phase B — Builder / Implementation

開發流程

Build phase. Composes from existing components. No re-design, no Figma re-interpretation, no token override.

何時出現

隨時自動套用

技術細節
idphase-b
authorityL1-sot
typeprocess
scopephase-b
triggersauto
lifecyclephase-b
sourceCLAUDE.md > Work Phases > Phase B

Migration Workflow (6 steps)

開發流程

Phase A sub-process: Understand → Section → Map → Gap → Decide → Build.

何時出現

隨時自動套用

技術細節
idmigration-workflow
authorityL1-sot
typeprocess
scopephase-a
triggersauto
lifecyclephase-a
sourceCLAUDE.md > Migration Workflow

Pattern Mapping

參考資料

Pre-defined UI-intent → component mapping table. Mandatory consult during Phase A Step 3.

何時出現

隨時自動套用

技術細節
idpattern-mapping
authorityL1-sot
typereference
scopephase-a
triggersauto
lifecyclephase-a
sourceCLAUDE.md > Pattern Mapping

Product Components Layer

CLAUDE.md 規則

Allowed Product Components list + governance. Similar intent (≥70%) must reuse, not recreate. New entries need full spec.

何時出現

隨時自動套用

技術細節
idproduct-components-layer
authorityL1-sot
typerule
scopecomponent
triggersauto
lifecyclephase-a, phase-b
sourceCLAUDE.md > Product Components Layer

Rendering Context (Dark-first)

CLAUDE.md 規則

Dark-first, token-based light mode. Every token must resolve in both modes; no mode-specific raw values in components.

何時出現

寫 code 前

技術細節
idrendering-context
authorityL1-sot
typerule
scopeglobal
triggerspre-output
lifecyclepre-write
sourceCLAUDE.md > Rendering Context

Interaction & State Rules

CLAUDE.md 規則

Pressed State Enforcement. active: banned; pressed via React Aria data-pressed; pressed visible in both modes.

何時出現

寫 code 前

技術細節
idinteraction-state-rules
authorityL1-sot
typerule
scopecomponent
triggerspre-output
lifecyclepre-write
sourceCLAUDE.md > Interaction & State Rules

Layout & Spacing Rules

CLAUDE.md 規則

Card pattern, section layout, inline elements. Forbidden: arbitrary spacing / pixel values.

何時出現

寫 code 前

技術細節
idlayout-spacing-rules
authorityL1-sot
typerule
scopeglobal
triggerspre-output
lifecyclepre-write
sourceCLAUDE.md > Layout & Spacing Rules

Outcome Color System

CLAUDE.md 規則

Outcome A/B are categorical (YES/NO), NOT trend. Outcome ≠ Up/Down. Disabled uses neutral, never outcome-at-opacity.

何時出現

寫 code 前

技術細節
idoutcome-color-system
authorityL1-sot
typerule
scopecomponent
triggerspre-output
lifecyclepre-write
sourceCLAUDE.md > Outcome Color System

Preview Page Completeness Rule

CLAUDE.md 規則

Every preview page needs Interactive Demo + Static State Matrix. Missing either = incomplete. Enforced by verify-preview-coverage.

何時出現

build 時

技術細節
idpreview-completeness-rule
authorityL1-sot
typerule
scopebuild-time
triggersbuild
lifecyclepre-build
sourceCLAUDE.md > Preview Page Completeness Rule

System Log Rule

CLAUDE.md 規則

System-level changes (agents, skills, pipeline, preview architecture, rules, token architecture) must append a system-log entry.

何時出現

手動執行

技術細節
idsystem-log-rule
authorityL1-sot
typerule
scopemeta
triggersmanual
lifecyclepost-change
sourceCLAUDE.md > System Log Rule

Gap List Binding

CLAUDE.md 規則

Phase A gaps status-tagged (unresolved / default-decided / deferred). Phase B may only implement default-decided; others → TODO placeholder.

何時出現

隨時自動套用

技術細節
idgap-list-binding
authorityL1-sot
typerule
scopephase-b
triggersauto
lifecyclephase-a, phase-b
sourceCLAUDE.md > External Skill Governance > Gap List Binding

External Skill Governance

CLAUDE.md 規則

SoT ordering (CLAUDE.md > components+theme > project skills > external skills). Per-skill boundaries. Conflict resolution.

何時出現

隨時自動套用

技術細節
idexternal-skill-governance
authorityL1-sot
typerule
scopemeta
triggersauto
lifecyclealways
sourceCLAUDE.md > External Skill Governance

Audit Authority

CLAUDE.md 規則

design_auditor is the sole default audit. /exam and plugin design:* only on explicit invoke. Multi-audit fires → design_auditor primary.

何時出現

audit 被觸發時

技術細節
idaudit-authority
authorityL1-sot
typerule
scopemeta
triggersaudit-request
lifecycleaudit-request
sourceCLAUDE.md > External Skill Governance > Audit 權威

Re-evaluation Guard (B/C)

CLAUDE.md 規則

Audit must read system-log decisions[] and skip B/C findings marked domain-correct / product-specific / intentional. Match by findingId OR signature.

何時出現

audit 被觸發時

技術細節
idre-evaluation-guard
authorityL1-sot
typerule
scopemeta
triggersaudit-request
lifecycleaudit-request
sourceCLAUDE.md > External Skill Governance > Re-evaluation Guard

Pre-output Validation

會擋你的檢查

6-section self-check before writing .tsx/.ts/style.css: token validity, DS isolation, component governance, gap binding, skill source, confirmation line.

何時出現

寫 code 前

技術細節
idpre-output-validation
authorityL1-sot
typeenforcement
scopeglobal
triggerspre-output
lifecyclepre-write
sourceCLAUDE.md > Pre-output Validation

Grep-able Bans (6 rules)

會擋你的檢查

6 grep-able bans: raw hex, tone-number Tailwind, arbitrary values (incl. typography), in-component CSS vars, brand lock, active:* pseudo-class.

何時出現

寫 code 前、手動執行

技術細節
idgrep-bans
authorityL1-sot
typeenforcement
scopeglobal
triggerspre-output, manual
lifecyclepre-write
sourceCLAUDE.md > External Skill Governance > 可驗證禁止項

Rule Enforcement (meta)

CLAUDE.md 規則

On rule violation: immediately stop, point out violation, return to correct step. No continuation in violated state.

何時出現

隨時自動套用

技術細節
idrule-enforcement
authorityL1-sot
typerule
scopemeta
triggersauto
lifecyclealways
sourceCLAUDE.md > Rule Enforcement

style.css (Live DS)

參考資料

Live DS semantic + primitive token definitions (@olab/components production truth). Authoritative token values; changes propagate via live-bridge.css.

何時出現

隨時自動套用

技術細節
idlive-style-css
authorityL2-runtime
typereference
scopeglobal
triggersauto
lifecyclealways
sourcepackages/configs/style/style.css

Components (base / application / product)

參考資料

Runtime truth for component behavior, composition, and interaction patterns. Product layer gated by Allowed List.

何時出現

隨時自動套用

技術細節
idcomponents-registry
authorityL2-runtime
typereference
scopecomponent
triggersauto
lifecyclealways
sourcesrc/components/

system-log.md

歷史紀錄

Append-only record of system-level changes (markdown, newest first). Per-entry **Decisions** tables are read by Re-evaluation Guard during audit.

何時出現

手動執行、audit 被觸發時

技術細節
idsystem-log
authorityL2-runtime
typelog
scopemeta
triggersmanual, audit-request
lifecyclepost-change, audit-request
sourcedocs/governance/system-log.md

verify-preview-coverage.mjs

build 時自動跑的腳本

Asserts every product component has a preview page. Exit 1 blocks dev/build. COMPOSITION_ONLY allowlist for documented exceptions.

何時出現

build 時

技術細節
idverify-preview-coverage
authorityL3-gate
typescript
scopebuild-time
triggersbuild
lifecyclepre-build
sourcescripts/verify-preview-coverage.mjs

generate-recent-updates.mjs

build 時自動跑的腳本

Scans git log for recently changed preview pages and writes recent-updates.generated.ts consumed by the sidebar.

何時出現

build 時

技術細節
idgenerate-recent-updates
authorityL3-gate
typescript
scopebuild-time
triggersbuild
lifecyclepre-build
sourcescripts/generate-recent-updates.mjs

design_auditor

Skill(工作伙伴)

Default audit skill. Scope: tokens, typography, color, spacing, component API, interaction, preview completeness. Must defer to CLAUDE.md on conflict.

何時出現

audit 被觸發時

技術細節
iddesign-auditor
authorityL4-skill-blocking
typeskill
scopeglobal
triggersaudit-request
lifecycleaudit-request
source.claude/skills/design_auditor.md

design_analyzer

Skill(工作伙伴)

Phase A analysis skill. Produces 6-section decomposition from Figma / screenshot / description.

何時出現

隨時自動套用、你明確呼叫時

技術細節
iddesign-analyzer
authorityL4-skill-blocking
typeskill
scopephase-a
triggersauto, user-invoke
lifecyclephase-a
source.claude/skills/design_analyzer.md

system_mapper

Skill(工作伙伴)

Phase A Step 3 helper. Maps analyzed patterns to Allowed Product / application / base components via Pattern Mapping.

何時出現

隨時自動套用

技術細節
idsystem-mapper
authorityL4-skill-blocking
typeskill
scopephase-a
triggersauto
lifecyclephase-a
source.claude/skills/system_mapper.md

ui-ux-pro-max

Skill(工作伙伴)

Reference catalog: WCAG palettes, font pairings, chart types. Lookup only. Concrete values must reconcile to Live DS style.css before entering code.

何時出現

你明確呼叫時

技術細節
idui-ux-pro-max
authorityL5-advisory
typeskill
scopeglobal
triggersuser-invoke
lifecyclephase-a
source.claude/skills/ui-ux-pro-max/

awesome-design-md

Skill(工作伙伴)

59 brand DESIGN.md references. Moodboard / discovery only. Extract visual direction; never copy tokens into source.

何時出現

你明確呼叫時

技術細節
idawesome-design-md
authorityL5-advisory
typeskill
scopeglobal
triggersuser-invoke
lifecyclephase-a
source.claude/skills/awesome-design-md/

design-for-ai

Skill(工作伙伴)

Visual design principles (Design for Hackers). Only on explicit /exam /hone etc. Advisory; design_auditor wins on conflict.

何時出現

你明確呼叫時

技術細節
iddesign-for-ai
authorityL5-advisory
typeskill
scopeglobal
triggersuser-invoke
lifecycleaudit-request
source.claude/skills/design-for-ai/

new-ds-to-legacy-translation

Skill(工作伙伴)

Translates new DS output to legacy styles at output stage. Never pollutes src/ source code.

何時出現

你明確呼叫時

技術細節
idnew-ds-to-legacy-translation
authorityL5-advisory
typeskill
scopeglobal
triggersuser-invoke
lifecyclepost-change
source.claude/skills/new-ds-to-legacy-translation/

design-for-ai commands (8)

Skill(工作伙伴)

8 slash commands tied to design-for-ai: /brand /color /design /exam /flow /fonts /hone /design-for-ai.

何時出現

你明確呼叫時

技術細節
iddesign-for-ai-commands
authorityL5-advisory
typeskill
scopeglobal
triggersuser-invoke
lifecycleaudit-request
source.claude/commands/

技術細節

進階篩選 / 顯示已淘汰項目 / 原始 schema
Authority
Scope
Trigger

進階欄位對應原始 schema:governance-registry.ts 的 Entity 型別。同組內多選用 OR、跨組用 AND、空組代表全選。