PluginBench
Skill
Pass
Audit score 90

extract

pbakaus/impeccable

Extract and consolidate reusable components, design tokens, and patterns into your design system.

What is extract?

This skill identifies repeated UI patterns, hard-coded values, and inconsistent component implementations across your codebase, then extracts them into a centralized design system for systematic reuse. Use it when refactoring UI patterns, building or enriching a component library, or establishing design tokens.

  • Analyzes code to find repeated components, hard-coded design values, and inconsistent UI patterns
  • Assesses extraction opportunities based on reuse frequency and consistency impact
  • Creates a systematic extraction plan with component definitions, token hierarchies, and naming conventions
  • Builds improved, reusable components with proper props APIs, variants, accessibility, and documentation
  • Generates design tokens with clear naming, hierarchy, and semantic meaning
  • Migrates existing code to consume the new shared versions and removes dead code

How to install extract

npx skills add https://github.com/pbakaus/impeccable --skill extract
Claude Code
Cursor
Windsurf
Cline

How to use extract

  1. 1.Identify the target area or codebase section to analyze for extraction opportunities
  2. 2.Locate or confirm the design system structure, component organization, and naming conventions
  3. 3.Review the skill's analysis of repeated patterns, hard-coded values, and inconsistent variations
  4. 4.Approve the extraction plan including which components, tokens, and patterns to extract
  5. 5.Execute the extraction to create new reusable components and design tokens
  6. 6.Review and test the migrated code to ensure visual and functional parity
  7. 7.Update design system documentation with the new components and tokens

Use cases

Good for
  • Consolidating multiple button implementations into a single reusable component with variants
  • Extracting hard-coded colors and spacing values into a design token system
  • Identifying and systematizing repeated layout patterns across multiple pages
  • Refactoring inconsistent form input styles into a unified, accessible component library
  • Building a design system from scratch by analyzing existing UI patterns in a codebase
Who it's for
  • Design system maintainers
  • Frontend developers refactoring UI code
  • Product teams establishing design consistency
  • Teams migrating to component-driven architecture

extract FAQ

What if no design system exists yet?

The skill will ask before creating one and will work with you to understand your preferred location and structure first.

How does the skill decide what's worth extracting?

It considers whether a pattern is used 3+ times, whether systematizing it improves consistency, whether it's general enough to reuse, and whether the maintenance benefit outweighs the cost.

Does it handle component variants and props?

Yes, it creates components with clear props APIs, sensible defaults, proper variants for different use cases, and built-in accessibility features like ARIA and keyboard navigation.

Will it update all existing code that uses the old patterns?

Yes, it systematically finds all instances of extracted patterns and replaces them with the new shared versions, then removes the old implementations.

What about design tokens—does it create them automatically?

It identifies hard-coded values that should become tokens and creates them with clear naming, hierarchy, and documentation, but avoids creating tokens for every single value.

Full instructions (SKILL.md)

Source of truth, from pbakaus/impeccable.


name: extract description: Extract and consolidate reusable components, design tokens, and patterns into your design system. Identifies opportunities for systematic reuse and enriches your component library. Use when the user asks to create components, refactor repeated UI patterns, build a design system, or extract tokens. user-invocable: true argument-hint: "[target]"

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.