Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ShuaiMXu/happyhands --skill foundation-extractor -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/foundation-extractor/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/foundation-extractor/

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

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set34

The whole set →
component-reuse-planner component-reuse-planner is a Claude Code skill that decides whether to reuse, extend, or create UI components. The decision relies on the governed project inventory and approved states. CX Codex +1 ★ 529repo stars content-design-reviewer content-design-reviewer is a Claude Code skill that checks interface labels and guidance for clarity and consistency. It ties findings to a user task and its outcome. CX Codex +1 ★ 529repo stars interaction-reviewer interaction-reviewer is a Claude Code skill that reviews interaction flow and control behavior. It detects missing feedback, unnecessary steps, and unsafe UI state transitions. CX Codex +1 ★ 529repo stars information-architecture-reviewer information-architecture-reviewer is a Claude Code skill that audits navigation and content hierarchy against user tasks. It identifies dead ends and ambiguous labels along target flows. CX Codex +1 ★ 529repo stars component-inventory component-inventory is a Claude Code skill that maps components to source paths, variants, composition, and known consumers. It supports reuse decisions and drift analysis. CX Codex +1 ★ 529repo stars visual-qa-evaluator Visual-qa-evaluator is a Claude Code skill that prepares evidence for visual QA and regression analysis. It supports matching interface states to evaluate design changes. CX Codex +1 ★ 529repo stars brand-foundation-extractor brand-foundation-extractor is a Claude Code skill that gathers candidate brand principles, voice cues, and visual assets from project files and rendered content. It keeps each finding tied to its source. CX Codex +1 ★ 529repo stars token-contrast-auditor The token-contrast-auditor skill for Claude Code verifies color pair contrast against WCAG standards. It runs during project analysis to check design tokens and CSS styles. CX Codex +1 ★ 529repo stars

Project sponsors

Companies that keep this analytics open