[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78F88R9FE375P83RH3WCRX7":3,"skill-same:01M78F88R9FE375P83RH3WCRX7":73},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M78F88R9FE375P83RH3WCRX7","design-tokens",null,"poppyTM\u002Foride","poppyTM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339400917?v=4","01M78F6YNKFR5S5JQR27X9F09Z","Poppy Team","01M78F6YP8ZZTRES9X8Q2ZAD21",1,"MIT","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-tokens\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# W3C Design Tokens Architecture & Multi-Platform Compilation\n\n## 1. Purpose\nDesign, maintain, validate, and compile cross-platform design tokens adhering strictly to the **W3C Design Tokens Community Group (DTCG 2025.10)** specification. This skill enforces a 3-tier token topology (Primitive $\\rightarrow$ Semantic $\\rightarrow$ Component), automated WCAG 2.2 contrast compliance across light and dark themes, eradication of hardcoded aesthetic values in component implementations, and automated code generation for CSS Custom Properties, TypeScript constants, and native Rust\u002FC++ configurations.\n\n---\n\n## 2. Use When\n- Establishing or modifying design token definitions (color palettes, typography scales, spacing grids, corner radii, elevation shadows, motion curves).\n- Designing multi-theme systems (light, dark, high-contrast, brand variants) using semantic aliasing.\n- Building or auditing automated token compilation pipelines (Style Dictionary, DTCG compilers).\n- Validating contrast ratios between semantic foreground and background token pairs.\n- Operating in mode(s): `implementation`, `design`, `review`, `audit`.\n\n---\n\n## 3. Do Not Use When\n- Writing low-level GPU fragment shaders or hardware vertex layout descriptors (use `shaders`).\n- Implementing raw immediate-mode canvas primitives without design system contracts.\n- Building disposable throwaway mockups that explicitly do not require design tokens.\n\n---\n\n## 4. Required Context\nBefore declaring or compiling design tokens, verify:\n- **DTCG Schema Conformance**: Format requires `$value`, `$type`, and optional `$description` attributes.\n- **Three-Tier Hierarchy Mapping**:\n  1. *Tier 1 (Primitive\u002FGlobal)*: Raw values without context (`color.slate.900: { \"$value\": \"#0f172a\", \"$type\": \"color\" }`).\n  2. *Tier 2 (Semantic\u002FAlias)*: Purpose-driven abstractions (`color.surface.canvas: { \"$value\": \"{color.slate.900}\", \"$type\": \"color\" }`).\n  3. *Tier 3 (Component)*: Scoped variables (`button.primary.background: { \"$value\": \"{color.surface.canvas}\", \"$type\": \"color\" }`).\n- **Target Export Platforms**: CSS custom properties, TypeScript const objects, Rust enums\u002Fstructs, or Android XML \u002F iOS Swift.\n\n---\n\n## 5. Procedure\n\n```\n[Design Intent \u002F Figma Tokens]\n         |\n         v\n[1. DTCG JSON Schema Authoring] -----> Declare Primitives with explicit $type\n         |\n         v\n[2. Semantic & Mode Aliasing] -------> Map Light\u002FDark semantic aliases {token.ref}\n         |\n         v\n[3. Contrast & Math Validation] -----> Audit 4.5:1 text and 3:1 focus ratios\n         |\n         v\n[4. Multi-Target Compilation] -------> Generate CSS, TS, Rust, C++ headers\n         |\n         v\n[5. Component Invariant Check] ------> Verify 0 raw hex colors in UI source\n```\n\n### Step 1: Declare Primitive Tokens with Explicit Types\nEvery token definition must specify its formal DTCG `$type`:\n`color`, `dimension`, `duration`, `cubicBezier`, `number`, `fontFamily`, `fontWeight`, `shadow`, `typography`.\n```json\n{\n  \"color\": {\n    \"neutral\": {\n      \"0\": { \"$value\": \"#ffffff\", \"$type\": \"color\" },\n      \"900\": { \"$value\": \"#0f172a\", \"$type\": \"color\" }\n    }\n  },\n  \"spacing\": {\n    \"sm\": { \"$value\": \"0.5rem\", \"$type\": \"dimension\" },\n    \"md\": { \"$value\": \"1rem\", \"$type\": \"dimension\" }\n  }\n}\n```\n\n### Step 2: Semantic Mapping & Theme Invariance\nComponents must never bind directly to primitive tokens. Bind components exclusively to semantic aliases:\n```json\n{\n  \"semantic\": {\n    \"color\": {\n      \"surface\": {\n        \"canvas\": {\n          \"$value\": \"{color.neutral.0}\",\n          \"$type\": \"color\",\n          \"$description\": \"Main background surface\"\n        }\n      },\n      \"text\": {\n        \"primary\": {\n          \"$value\": \"{color.neutral.900}\",\n          \"$type\": \"color\"\n        }\n      }\n    }\n  }\n}\n```\nIn dark mode, override `{semantic.color.surface.canvas}` to `{color.neutral.900}` and `{semantic.color.text.primary}` to `{color.neutral.0}`.\n\n### Step 3: Automated Contrast Verification\nVerify that every semantic foreground token paired with a background token satisfies WCAG 2.2 contrast invariants:\n- Body text: $\\ge 4.5:1$.\n- Large text ($\\ge 18\\text{pt}$ or $\\ge 14\\text{pt}$ bold): $\\ge 3:1$.\n- Interactive focus rings and icons: $\\ge 3:1$.\n\n### Step 4: Multi-Target Code Generation\nCompile tokens deterministically:\n1. **CSS Output**:\n   ```css\n   :root {\n     --color-surface-canvas: #ffffff;\n     --color-text-primary: #0f172a;\n     --spacing-md: 1rem;\n   }\n   [data-theme=\"dark\"] {\n     --color-surface-canvas: #0f172a;\n     --color-text-primary: #ffffff;\n   }\n   ```\n2. **TypeScript \u002F Rust Output**: Emit immutable, strongly typed structures for native codebases.\n\n### Step 5: Static Component Linting\nRun static scanners across all frontend \u002F UI components to guarantee zero raw color literals (`#fff`, `rgb(...)`) exist outside design token definitions.\n\n---\n\n## 6. Decision Rules & Invariants\n- **RULE 1 (No Component-to-Primitive Binding)**: UI components must reference Semantic Tokens (`var(--color-surface-canvas)`), never raw Primitive Tokens (`var(--color-neutral-0)`).\n- **RULE 2 (Contrast Conformance)**: Any semantic text\u002Fbackground pairing with contrast $\u003C 4.5:1$ is rejected at build time.\n- **RULE 3 (Strict DTCG Syntax)**: Token JSON files must strictly adhere to the `$value` and `$type` attributes of W3C DTCG specification.\n- **RULE 4 (Relative Units for Dimensions)**: Spacing and typography tokens must use relative units (`rem`, `ch`, `em`) rather than hardcoded physical pixels (`px`) to support user zoom and reflow.\n\n---\n\n## 7. Evidence Required\n- **Schema Validation Evidence**: Clean validation of token JSON against the DTCG schema.\n- **Contrast Audit Matrix**: Mathematical evidence proving all semantic foreground\u002Fbackground pairs meet WCAG AA requirements.\n- **Hardcoded Aesthetic Audit**: Zero raw hex or pixel strings detected in production UI components.\n\n---\n\n## 8. Output Contract\n- Canonical DTCG Token definitions (`tokens\u002F*.json`).\n- Compiled CSS Custom Properties (`dist\u002Ftokens.css`) and TypeScript bindings (`dist\u002Ftokens.ts`).\n- Design Token Audit & Contrast Report (`templates\u002Fdesign-tokens-report.md`).\n\n---\n\n## 9. Stop Conditions\n- All token files validate against DTCG schema.\n- All theme contrast checks pass with $\\ge 4.5:1$ score.\n- Token budget exhausted.\n- Blocked on external dependency.\n\n---\n\n## 10. Escalation Rules\n- Escalate to brand lead if brand guideline primary colors fail WCAG AA contrast against required background surfaces.\n- Escalate if multi-brand theming requirements exceed token compiler alias resolution capabilities.\n",{},"main","1cd515630b8ceb57777d466bee4970fe7c2e30e0",".agents\u002Fskills\u002Fdesign-tokens",0,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride","https:\u002F\u002Fgithub.com\u002FpoppyTM","https:\u002F\u002Fpoppy.lat","Construímos linguagens de programação e ferramentas para quem lê código com o mesmo cuidado com que escreve.","2026-09-30 10:15:52",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add poppyTM\u002Foride --skill design-tokens",{"tool":37,"command":38},"bunx","bunx skills add poppyTM\u002Foride --skill design-tokens",{"tool":40,"command":41},"pnpm","pnpm dlx skills add poppyTM\u002Foride --skill design-tokens","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-tokens\u002FSKILL.md",true,[45,51,55,59,63,69],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"checks\u002Fdesign-tokens-checklist.md","REFERENCE","参考文档",1892,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-tokens\u002Fchecks\u002Fdesign-tokens-checklist.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"examples\u002Fdesign-tokens.json",2581,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-tokens\u002Fexamples\u002Fdesign-tokens.json",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"manifest.json",1992,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-tokens\u002Fmanifest.json",{"path":60,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fdesign-tokens-guide.md",3858,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-tokens\u002Freferences\u002Fdesign-tokens-guide.md",{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"scripts\u002Fverify.sh","SCRIPT","脚本",3298,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-tokens\u002Fscripts\u002Fverify.sh",{"path":70,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":71,"sourceHtmlUrl":72},"templates\u002Fdesign-tokens-report.md",1859,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-tokens\u002Ftemplates\u002Fdesign-tokens-report.md",[74,80,86,93,100,107],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M78FHQN254KEH0DETXT5JM29","zoom-reflow","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M78FHP1880S695V8GQEE0RXK","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M78FHHYM6AN2H819FABW01DZ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M78FHE53D8DD0QVRY5C37DA4","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M78FHBJ1KXFF734GFE509TBJ","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":18},"01M78FH9X6CPJX1H61ZDWTTVW8","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]