# Extract

> Refactoring pass — extracts repeated Tailwind class combos and markup into components, and lifts magic values into design tokens. Use when the codebase has obvious duplication, hardcoded hex values or pixel sizes, or when the user says "clean this up" / "extract components" / "tokenize styles". Invoke when the user asks for extract on their UI, or mentions 'extract' alongside design / UI / fronte…

- **Type:** Skill
- **Install:** `agentstack add skill-educlopez-ui-craft-extract`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [educlopez](https://agentstack.voostack.com/s/educlopez)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [educlopez](https://github.com/educlopez)
- **Source:** https://github.com/educlopez/ui-craft/tree/main/.codex/skills/extract
- **Website:** https://skills.smoothui.dev/

## Install

```sh
agentstack add skill-educlopez-ui-craft-extract
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

**Context:** 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 the target the user described. 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`/`tv` variant 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` / `InviteRow` beats `Card` / `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**:
1. The new component file(s) + any token additions.
2. A table showing every call-site update:

| File | Before | After |
| --- | --- | --- |

3. A one-line delta: "Extracted N components, M tokens. Call-sites updated: X."

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [educlopez](https://github.com/educlopez)
- **Source:** [educlopez/ui-craft](https://github.com/educlopez/ui-craft)
- **License:** MIT
- **Homepage:** https://skills.smoothui.dev/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-educlopez-ui-craft-extract
- Seller: https://agentstack.voostack.com/s/educlopez
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
