Source of Truth
Code component library is the single SoT. Figma is reference only. Semantic tokens override ad-hoc values.
隨時自動套用
技術細節
source-of-truthL1-sotruleglobalautoalwaysCLAUDE.md > Source of Truth這裡是 Opinion Trade 系統裡、會檢查你 / 引導你 / 提醒你的所有角色 ── 包含開發流程、CLAUDE.md 規則、build 檢查腳本、audit skill 等。
依「你什麼時候會遇到它」分組。想查規則 → 看「CLAUDE.md 規則」;想知道 build 會自動跑什麼 → 看「build 時自動跑的腳本」;想理解 audit 從哪冒出來 → 看「Skill」。
點一個分組會自動篩選下方清單。可以選多個,或再清除。
Code component library is the single SoT. Figma is reference only. Semantic tokens override ad-hoc values.
隨時自動套用
source-of-truthL1-sotruleglobalautoalwaysCLAUDE.md > Source of TruthInspect before building. Compose, don't create. Scoped changes only. No extras. Show before editing.
寫 code 前
page-building-rulesL1-sotruleglobalpre-outputpre-writeCLAUDE.md > Page Building RulesRepo is the new DS. Legacy output must route through new-ds-to-legacy-translation at output stage; never written into src/.
隨時自動套用、你明確呼叫時
cross-ds-handoffL1-sotruleglobalauto, user-invokealwaysCLAUDE.md > External Skill Governance > Cross-DS HandoffAnalysis phase. No code output. Produces 6-section decomposition ending in Recommended Build Order.
隨時自動套用
phase-aL1-sotprocessphase-aautophase-aCLAUDE.md > Work Phases > Phase ABuild phase. Composes from existing components. No re-design, no Figma re-interpretation, no token override.
隨時自動套用
phase-bL1-sotprocessphase-bautophase-bCLAUDE.md > Work Phases > Phase BPhase A sub-process: Understand → Section → Map → Gap → Decide → Build.
隨時自動套用
migration-workflowL1-sotprocessphase-aautophase-aCLAUDE.md > Migration WorkflowPre-defined UI-intent → component mapping table. Mandatory consult during Phase A Step 3.
隨時自動套用
pattern-mappingL1-sotreferencephase-aautophase-aCLAUDE.md > Pattern MappingAllowed Product Components list + governance. Similar intent (≥70%) must reuse, not recreate. New entries need full spec.
隨時自動套用
product-components-layerL1-sotrulecomponentautophase-a, phase-bCLAUDE.md > Product Components LayerDark-first, token-based light mode. Every token must resolve in both modes; no mode-specific raw values in components.
寫 code 前
rendering-contextL1-sotruleglobalpre-outputpre-writeCLAUDE.md > Rendering ContextPressed State Enforcement. active: banned; pressed via React Aria data-pressed; pressed visible in both modes.
寫 code 前
interaction-state-rulesL1-sotrulecomponentpre-outputpre-writeCLAUDE.md > Interaction & State RulesCard pattern, section layout, inline elements. Forbidden: arbitrary spacing / pixel values.
寫 code 前
layout-spacing-rulesL1-sotruleglobalpre-outputpre-writeCLAUDE.md > Layout & Spacing RulesOutcome A/B are categorical (YES/NO), NOT trend. Outcome ≠ Up/Down. Disabled uses neutral, never outcome-at-opacity.
寫 code 前
outcome-color-systemL1-sotrulecomponentpre-outputpre-writeCLAUDE.md > Outcome Color SystemEvery preview page needs Interactive Demo + Static State Matrix. Missing either = incomplete. Enforced by verify-preview-coverage.
build 時
preview-completeness-ruleL1-sotrulebuild-timebuildpre-buildCLAUDE.md > Preview Page Completeness RuleSystem-level changes (agents, skills, pipeline, preview architecture, rules, token architecture) must append a system-log entry.
手動執行
system-log-ruleL1-sotrulemetamanualpost-changeCLAUDE.md > System Log RulePhase A gaps status-tagged (unresolved / default-decided / deferred). Phase B may only implement default-decided; others → TODO placeholder.
隨時自動套用
gap-list-bindingL1-sotrulephase-bautophase-a, phase-bCLAUDE.md > External Skill Governance > Gap List BindingSoT ordering (CLAUDE.md > components+theme > project skills > external skills). Per-skill boundaries. Conflict resolution.
隨時自動套用
external-skill-governanceL1-sotrulemetaautoalwaysCLAUDE.md > External Skill Governancedesign_auditor is the sole default audit. /exam and plugin design:* only on explicit invoke. Multi-audit fires → design_auditor primary.
audit 被觸發時
audit-authorityL1-sotrulemetaaudit-requestaudit-requestCLAUDE.md > External Skill Governance > Audit 權威Audit must read system-log decisions[] and skip B/C findings marked domain-correct / product-specific / intentional. Match by findingId OR signature.
audit 被觸發時
re-evaluation-guardL1-sotrulemetaaudit-requestaudit-requestCLAUDE.md > External Skill Governance > Re-evaluation Guard6-section self-check before writing .tsx/.ts/style.css: token validity, DS isolation, component governance, gap binding, skill source, confirmation line.
寫 code 前
pre-output-validationL1-sotenforcementglobalpre-outputpre-writeCLAUDE.md > Pre-output Validation6 grep-able bans: raw hex, tone-number Tailwind, arbitrary values (incl. typography), in-component CSS vars, brand lock, active:* pseudo-class.
寫 code 前、手動執行
grep-bansL1-sotenforcementglobalpre-output, manualpre-writeCLAUDE.md > External Skill Governance > 可驗證禁止項On rule violation: immediately stop, point out violation, return to correct step. No continuation in violated state.
隨時自動套用
rule-enforcementL1-sotrulemetaautoalwaysCLAUDE.md > Rule EnforcementLive DS semantic + primitive token definitions (@olab/components production truth). Authoritative token values; changes propagate via live-bridge.css.
隨時自動套用
live-style-cssL2-runtimereferenceglobalautoalwayspackages/configs/style/style.cssRuntime truth for component behavior, composition, and interaction patterns. Product layer gated by Allowed List.
隨時自動套用
components-registryL2-runtimereferencecomponentautoalwayssrc/components/Append-only record of system-level changes (markdown, newest first). Per-entry **Decisions** tables are read by Re-evaluation Guard during audit.
手動執行、audit 被觸發時
system-logL2-runtimelogmetamanual, audit-requestpost-change, audit-requestdocs/governance/system-log.mdAsserts every product component has a preview page. Exit 1 blocks dev/build. COMPOSITION_ONLY allowlist for documented exceptions.
build 時
verify-preview-coverageL3-gatescriptbuild-timebuildpre-buildscripts/verify-preview-coverage.mjsScans git log for recently changed preview pages and writes recent-updates.generated.ts consumed by the sidebar.
build 時
generate-recent-updatesL3-gatescriptbuild-timebuildpre-buildscripts/generate-recent-updates.mjsDefault audit skill. Scope: tokens, typography, color, spacing, component API, interaction, preview completeness. Must defer to CLAUDE.md on conflict.
audit 被觸發時
design-auditorL4-skill-blockingskillglobalaudit-requestaudit-request.claude/skills/design_auditor.mdPhase A analysis skill. Produces 6-section decomposition from Figma / screenshot / description.
隨時自動套用、你明確呼叫時
design-analyzerL4-skill-blockingskillphase-aauto, user-invokephase-a.claude/skills/design_analyzer.mdPhase A Step 3 helper. Maps analyzed patterns to Allowed Product / application / base components via Pattern Mapping.
隨時自動套用
system-mapperL4-skill-blockingskillphase-aautophase-a.claude/skills/system_mapper.mdReference catalog: WCAG palettes, font pairings, chart types. Lookup only. Concrete values must reconcile to Live DS style.css before entering code.
你明確呼叫時
ui-ux-pro-maxL5-advisoryskillglobaluser-invokephase-a.claude/skills/ui-ux-pro-max/59 brand DESIGN.md references. Moodboard / discovery only. Extract visual direction; never copy tokens into source.
你明確呼叫時
awesome-design-mdL5-advisoryskillglobaluser-invokephase-a.claude/skills/awesome-design-md/Visual design principles (Design for Hackers). Only on explicit /exam /hone etc. Advisory; design_auditor wins on conflict.
你明確呼叫時
design-for-aiL5-advisoryskillglobaluser-invokeaudit-request.claude/skills/design-for-ai/Translates new DS output to legacy styles at output stage. Never pollutes src/ source code.
你明確呼叫時
new-ds-to-legacy-translationL5-advisoryskillglobaluser-invokepost-change.claude/skills/new-ds-to-legacy-translation/8 slash commands tied to design-for-ai: /brand /color /design /exam /flow /fonts /hone /design-for-ai.
你明確呼叫時
design-for-ai-commandsL5-advisoryskillglobaluser-invokeaudit-request.claude/commands/進階欄位對應原始 schema:governance-registry.ts 的 Entity 型別。同組內多選用 OR、跨組用 AND、空組代表全選。