extract skill
✓ VerifiedRefactors codebases by extracting repeated Tailwind classes and markup into components and converting magic values into design tokens.
- GitHub stars
- 452
- Files
- 1
- Last commit
- Nov 6, 2026
- License
- MIT
- Allowed tools
- —
What does the extract skill do?
extract refactors codebases by extracting repeated Tailwind classes and markup into components and converting magic values into design tokens.
Summary generated from the skill's SKILL.md.
About the extract skill
Refactoring frontend codebases by identifying repetitive Tailwind class combinations and converting hardcoded magic values into design tokens is what this skill enables. Developers use it when they need to clean up UI code, extract components, or tokenize styles within a project. The tool scans for class strings appearing three or more times, hex colors, pixel sizes, and repeated markup blocks to create reusable components or CSS variables.
To ensure consistency, the process matches existing project conventions for naming, file locations, and export styles. It relies on the ui-craft skill for broader context and follows specific references for layout, typography, and color. The output includes new component files, updated token definitions, and a detailed table documenting every call-site migration to ensure no half-migrations occur.
What an agent can do with it
- 1Component ExtractionTransform repetitive Tailwind class strings and markup blocks into reusable components with props.
- 2Design TokenizationConvert hardcoded hex colors and pixel sizes into CSS variables or theme extensions.
- 3Codebase CleanupStandardize a messy UI by matching existing project naming and directory conventions.
- 4Migration TrackingGenerate a report showing exactly how every file was updated during the refactoring process.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the extract skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the extract skill in Claude Code
~/.claude/skills/extract/SKILL.md
$ npx degit educlopez/ui-craft/.agents/skills/extract ~/.claude/skills/extractInstall the extract skill in Claude Code (project)
.claude/skills/extract/SKILL.md
$ npx degit educlopez/ui-craft/.agents/skills/extract .claude/skills/extractInstall the extract skill in Codex
~/.agents/skills/extract/SKILL.md
$ npx degit educlopez/ui-craft/.agents/skills/extract ~/.agents/skills/extractInstall the extract skill in Gemini CLI
~/.gemini/skills/extract/SKILL.md
$ npx degit educlopez/ui-craft/.agents/skills/extract ~/.gemini/skills/extractInstall the extract skill in Claude.ai
npx degit educlopez/ui-craft/.agents/skills/extract extract && zip -r extract.zip extract # claude.ai → Customize → Skills → + → Create skill → Upload a skill → extract.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachableeduclopez/ui-craft/.agents/skills/extract is public and reachablegithub.com/educlopez/ui-craft/tree/HEAD/.agents/skills/extra ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-06github.com/educlopez/ui-craft/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/educlopez/ui-craft/blob/HEAD/.agents/skills/extra ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/educlopez/ui-craft/blob/HEAD/.agents/skills/extra ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 45 linesgithub.com/educlopez/ui-craft/blob/HEAD/.agents/skills/extra ↗Pass
SKILL.md
View on GitHubContext: this sub-skill is one lens of the broader ui-craft skill. If the ui-craft skill is also installed, read its SKILL.md first for Discovery + Anti-Slop + Craft Test, then apply the specific lens below.
Extract reusable pieces from $ARGUMENTS. Load the ui-craft skill.
Step 1 — Scan the target for extraction candidates:
- Repeated Tailwind class combos — any class string that appears ≥3 times becomes a component (or a
cva/tvvariant if the project uses one — check first). - Magic values — hex colors, pixel sizes, shadow definitions, font sizes, z-index values appearing in literal form. Lift into CSS variables or
theme.extend. - Repeated markup — blocks that differ only by text/props collapse into a single component with props.
Step 2 — Match the project's conventions, don't impose new ones:
- Naming — look at neighboring components. PascalCase file? kebab-case file? Named export vs default export? Match exactly.
- Location — check
components/ui/,ui/,primitives/,src/components/before creating a new directory. Reuse. - Tokens — respect existing CSS variable naming (
--color-*,--space-*,--font-*,--radius-*). Don't introduce a parallel system.
Step 3 — Anti-Slop Test on every new component (from SKILL.md):
- Component name must be domain-specific, not generic.
MetricCard/PricingTier/InviteRowbeatsCard/Box/Item. - If the component is generic ("a card with a title and description"), ask yourself whether it should instead be an inline composition — premature abstraction is worse than repetition.
Step 4 — Update every call-site. No half-migrations.
Knob-agnostic — DRY is not tunable.
References to read: references/layout.md (composition patterns), references/typography.md and references/color.md (token naming), plus the project's existing component library (scan before writing).
Output:
- The new component file(s) + any token additions.
- A table showing every call-site update:
| File | Before | After |
|---|
- A one-line delta: "Extracted N components, M tokens. Call-sites updated: X."
Next step: /tokens — lift the values you just centralized into the token spine (rung 2).
Files in this skill
1extract skill questions
How do I install the extract skill in Claude Code?
Run npx degit educlopez/ui-craft/.agents/skills/extract ~/.claude/skills/extract. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the extract skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
When should I use the extract skill?
Use this skill when the codebase contains obvious duplication, hardcoded hex values or pixel sizes, or when requested to clean up, extract components, or tokenize styles.
How does the skill decide what becomes a component?
Any Tailwind class string that appears three or more times is converted into a component or a variant if the project uses CVA or TV.
What are the rules for naming new components?
Component names must be domain-specific rather than generic, such as using 'MetricCard' instead of 'Card'.