skills/extract/SKILL.md
Extract reusable components, product patterns, and design tokens into a clearer design system with shared APIs, documented defaults, and better reuse. Use when the user wants to refactor repeated UI, consolidate buttons/cards/forms/sections, build a component library, or turn one-off values into reusable tokens.
npx skillsauth add aladicf/better-web-ui extractInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Identify reusable patterns, components, and design tokens, then extract and consolidate them into the design system for systematic reuse.
The goal is not to capture every value in the codebase. The goal is to create constrained systems that reduce future design decisions and keep the interface coherent.
Consult the design-system alignment reference for tokens vs components vs patterns, drift, and how to avoid turning inconsistency into token sprawl.
Users start this workflow with /extract. Once this skill is active, load $frontend-design — it contains design principles, anti-patterns, and the Context Gathering Protocol. Follow that protocol before proceeding — if no design context exists yet, you MUST load $setup first.
Analyze the target area to identify extraction opportunities:
Find the design system: Locate your design system, component library, or shared UI directory (grep for "design system", "ui", "components", etc.). Understand its structure:
CRITICAL: If no design system exists, ask before creating one. Understand the preferred location and structure first.
Identify patterns: Look for:
Create a systematic extraction plan:
IMPORTANT: Design systems grow incrementally. Extract what's clearly reusable now, not everything that might someday be reusable.
If the project already uses a library such as shadcn/ui, prefer extracting:
Do not replace upstream primitives with redundant local copies unless the project truly needs a stable customized abstraction.
A good extraction often sits one layer above the library primitive: not another generic Button, but a product-specific action bar, filter panel, settings section, or empty-state pattern that uses the existing primitives consistently.
Build improved, reusable versions:
Components: Create well-designed components with:
Design tokens: Create tokens with:
Prefer systems like:
Spacing: A small scale with meaningful jumps, not every number between 4 and 64
Typography: A hand-crafted set of sizes and weights for UI roles
Color: Defined ramps instead of ad-hoc lighten/darken variations
Elevation: A few shadows with semantic meaning, not endless custom box-shadows
Patterns: Document patterns with:
NEVER:
Replace existing uses with the new shared versions:
Update design system documentation:
Remember: A good design system is a living system. Extract patterns as they emerge, enrich them thoughtfully, and maintain them consistently.
development
Build or improve a UI testing strategy covering visual regression, interaction testing, and accessibility assertions. Use when the user asks to add tests, set up testing, fix flaky tests, improve test coverage, validate UI behavior, catch visual bugs, or establish confidence in shipping frontend changes.
development
Design security-conscious interfaces that protect users without frustrating them. Use when the user asks about MFA, password UX, breach notifications, trust indicators, secure forms, account recovery, or making security feel safe rather than scary.
development
Design or improve search experiences, result presentation, and filtering interfaces. Use when the user asks to add search, redesign search results, improve findability, build autocomplete, add filters, or fix zero-results dead ends.
development
Plan, implement, or improve an internationalization and localization strategy for UI content, formatting, and regional adaptation. Use when the user asks to add i18n, localize, translate, support multiple languages, handle regional formats, manage locale switching, or build a multilingual product.