Foundation extractor

From ShuaiMXu/happyhands · View interactive version

Foundation extractor is an AI agent skill from the GitHub repository ShuaiMXu/happyhands. Inventory an existing product's design tokens and component sources when establishing or updating its Design Foundation.

How to use this skill

Skill file

Foundation Extractor

Build a traceable inventory from the repository before proposing rules. Distinguish what exists from what is approved.

The deterministic handler inventories CSS custom properties with their declared values: each token records its most frequent value, an inferred category (color, radius, type, space, shadow, motion — name first, value shape second) and, when a name resolves to several values, the full set as observed variants. Component files in component/UI directories complete the inventory. Every entry is promotable into the Experience Spec token shape without re-typing, and stays observed until a person approves it. Brand intent, component semantics, variants and states still require human or model-assisted review.

JS/TS theme/token/palette declarations, static object exports in theme files and Tailwind default-export theme objects are parsed from the source snapshot without execution. Literal values, static property access, spreads, relative named imports and explicit re-exports retain original file/line references. Object paths namespace candidates so unrelated palettes are not silently merged. Explicit primitive/semantic/component object keys supply observed layer labels; missing labels remain unclassified. Dynamic expressions, unsupported module resolution, syntax errors and extraction budgets produce missing-evidence diagnostics. These observations do not prove runtime values, theme activation, complete consumers or rendered component coverage.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.