foundation-extractor — Claude Code skill: what it does, how to install
Foundation-extractor is a Claude Code skill that builds an inventory of design tokens and component sources. It maps existing design elements in a repository before proposing foundation updates.
MIT ★ 529 updated 2026-11-17
npx skills add ShuaiMXu/happyhands --skill foundation-extractor -a claude-codeWhat foundation-extractor does
The tool creates a traceable inventory by parsing CSS custom properties, JS/TS theme files, and Tailwind configuration objects without executing the source code. It retains original file and line references for every token discovered. Every identified item remains marked as observed until a human review confirms it.
It categorizes tokens into types like color, space, motion, and shadow. If a name resolves to multiple values, the tool records the full set as observed variants. When source files or the repository are unavailable, it returns a needs-evidence diagnostic to notify the user.
What it helps with
- inventory existing design tokens
- identify duplicate or ambiguous style artifacts
- map component sources before system updates
- track token origins across large codebases
Example prompts for the agent
- foundation-extractor inventory all tokens in the repository
- use foundation-extractor to audit CSS custom properties
- find all theme object definitions with foundation-extractor
How to install foundation-extractor
1Skills CLI (Vercel)
npx skills add ShuaiMXu/happyhands --skill foundation-extractor -a claude-code2Manually: put the files in place
~/.claude/skills/foundation-extractor/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/foundation-extractor/
1Skills CLI (Vercel)
npx skills add ShuaiMXu/happyhands --skill foundation-extractor -a codex2Manually: put the files in place
.agents/skills/foundation-extractor/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ShuaiMXu/happyhands --skill foundation-extractor -a cursor2Manually: put the files in place
.cursor/skills/foundation-extractor/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ShuaiMXu/happyhands skills/product-design/foundation-extractor2Manually: put the files in place
.github/skills/foundation-extractor/SKILL.md1Skills CLI (Vercel)
npx skills add ShuaiMXu/happyhands --skill foundation-extractor -a gemini-cli2Platform CLI
gemini skills install https://github.com/ShuaiMXu/happyhands --path skills/product-design/foundation-extractorManually: put the files in place
.devin/skills/foundation-extractor/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about foundation-extractor
How to install foundation-extractor in Claude Code?
Run npx skills add ShuaiMXu/happyhands --skill foundation-extractor -a claude-code. The tool will be available at ~/.claude/skills/foundation-extractor/SKILL.md.
What does foundation-extractor do?
It generates a traceable inventory of design tokens and components from your source code, distinguishing between existing assets and approved design foundation rules.
What is required to use foundation-extractor?
You need a repository with accessible source files; the tool will provide a needs-evidence status if it cannot locate relevant design files.
Source text
SKILL.md · MIT
--- name: foundation-extractor description: Inventory an existing product's design tokens and component sources when establishing or updating its Design Foundation. --- # Foundation Extractor Build a traceable inventory from the repository before proposing rules. Distinguish what exists from what is approved. - Cite the source path for every extracted artifact. - Mark discoveries `observed`; never promote them to `approved` automatically. - Preserve aliases and semantic token names when present. Treat raw literal values as inventory candidates. - Report duplicate or ambiguous artifacts for review instead of silently merging them. - Return `needs-evidence` when the repository or relevant source files are unavailable. 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.
© ShuaiMXu · MIT · ShuaiMXu/happyhands