
Extract
Mine repeated UI patterns and hard-coded styles from your app and consolidate them into components and design tokens.
Overview
Extract is an agent skill for the Build phase that identifies reusable UI patterns and design tokens in your codebase and consolidates them into your design system.
Install
npx skills add https://github.com/pbakaus/impeccable --skill extractWhat is this skill?
- Discover phase locates existing design system or shared UI directories before changing structure
- Identifies repeated components, hard-coded colors/spacing/typography, and inconsistent variants
- Extracts and consolidates patterns into tokens and library components for systematic reuse
- CRITICAL gate: asks before creating a new design system if none exists
- Optional target argument hints scope extraction to a specific area of the codebase
- Discover workflow includes 3 pattern categories: repeated components, hard-coded values, inconsistent variations
Adoption & trust: 53.8k installs on skills.sh; 35.9k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your UI has duplicate components and scattered hard-coded styles, so every new screen reinvents buttons, spacing, and cards.
Who is it for?
Solo builders refactoring a growing React or similar frontend who already have multiple copies of the same UI patterns.
Skip if: Greenfield visual branding from scratch with no UI code yet, or back-end-only projects with no component surface to analyze.
When should I use this skill?
User asks to create components, refactor repeated UI patterns, build a design system, or extract tokens; optional [target] scopes the analysis area.
What do I get? / Deliverables
You get discovered patterns mapped to extracted components and tokens placed in your existing—or agreed—design system structure.
- Extracted reusable components in the design system structure
- Consolidated design tokens replacing hard-coded visual values
Recommended Skills
Journey fit
How it compares
A codebase-driven design-system workflow—not a Figma-only style guide generator or a generic CSS linter.
Common Questions / FAQ
Who is extract for?
Indie developers and small teams maintaining a frontend who want to pull real production patterns into a shared component library and token set.
When should I use extract?
Use when you ask to create components from repeated UI, refactor duplicated patterns, build or enrich a design system, or extract design tokens from existing screens.
Is extract safe to install?
Review the Security Audits panel on this Prism page; the skill expects filesystem access to read and refactor UI code—treat repo changes like any automated refactor.
SKILL.md
READMESKILL.md - Extract
Identify reusable patterns, components, and design tokens, then extract and consolidate them into the design system for systematic reuse. ## Discover Analyze the target area to identify extraction opportunities: 1. **Find the design system**: Locate your design system, component library, or shared UI directory (grep for "design system", "ui", "components", etc.). Understand its structure: - Component organization and naming conventions - Design token structure (if any) - Documentation patterns - Import/export conventions **CRITICAL**: If no design system exists, ask before creating one. Understand the preferred location and structure first. 2. **Identify patterns**: Look for: - **Repeated components**: Similar UI patterns used multiple times (buttons, cards, inputs, etc.) - **Hard-coded values**: Colors, spacing, typography, shadows that should be tokens - **Inconsistent variations**: Multiple implementations of the same concept (3 different button styles) - **Reusable patterns**: Layout patterns, composition patterns, interaction patterns worth systematizing 3. **Assess value**: Not everything should be extracted. Consider: - Is this used 3+ times, or likely to be reused? - Would systematizing this improve consistency? - Is this a general pattern or context-specific? - What's the maintenance cost vs benefit? ## Plan Extraction Create a systematic extraction plan: - **Components to extract**: Which UI elements become reusable components? - **Tokens to create**: Which hard-coded values become design tokens? - **Variants to support**: What variations does each component need? - **Naming conventions**: Component names, token names, prop names that match existing patterns - **Migration path**: How to refactor existing uses to consume the new shared versions **IMPORTANT**: Design systems grow incrementally. Extract what's clearly reusable now, not everything that might someday be reusable. ## Extract & Enrich Build improved, reusable versions: - **Components**: Create well-designed components with: - Clear props API with sensible defaults - Proper variants for different use cases - Accessibility built in (ARIA, keyboard navigation, focus management) - Documentation and usage examples - **Design tokens**: Create tokens with: - Clear naming (primitive vs semantic) - Proper hierarchy and organization - Documentation of when to use each token - **Patterns**: Document patterns with: - When to use this pattern - Code examples - Variations and combinations **NEVER**: - Extract one-off, context-specific implementations without generalization - Create components so generic they're useless - Extract without considering existing design system conventions - Skip proper TypeScript types or prop documentation - Create tokens for every single value (tokens should have semantic meaning) ## Migrate Replace existing uses with the new shared versions: - **Find all instances**: Search for the patterns you've extracted - **Replace systematically**: Update each use to consume the shared version - **Test thoroughly**: Ensure visual and functional parity - **Delete dead code**: Remove the old implementations ## Document Update design system documentation: - Add new components to the component library - Document token usage and values - Add examples and guidelines - Update any Storybook or component catalog Remember: A good design system is a living system. Extract patterns as they emerge, enrich them thoughtfully, and maintain them consistently.