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:
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.
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
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.
1---2name: extract3description: Extract and consolidate reusable components, design tokens, and patterns into your design system. Identifies opportunities for systematic reuse and enriches your component library.4user-invokable: true5args:6 - name: target7 description: The feature, component, or area to extract from (optional)8 required: false9metadata:10 source: https://skillmd.com/skills/eliferjunior/extract11---1213Identify reusable patterns, components, and design tokens, then extract and consolidate them into the design system for systematic reuse.1415## Discover1617Analyze the target area to identify extraction opportunities:18191. **Find the design system**: Locate your design system, component library, or shared UI directory (grep for "design system", "ui", "components", etc.). Understand its structure:20 - Component organization and naming conventions21 - Design token structure (if any)22 - Documentation patterns23 - Import/export conventions24 25 **CRITICAL**: If no design system exists, ask before creating one. Understand the preferred location and structure first.26272. **Identify patterns**: Look for:28 - **Repeated components**: Similar UI patterns used multiple times (buttons, cards, inputs, etc.)29 - **Hard-coded values**: Colors, spacing, typography, shadows that should be tokens30 - **Inconsistent variations**: Multiple implementations of the same concept (3 different button styles)31 - **Reusable patterns**: Layout patterns, composition patterns, interaction patterns worth systematizing32333. **Assess value**: Not everything should be extracted. Consider:34 - Is this used 3+ times, or likely to be reused?35 - Would systematizing this improve consistency?36 - Is this a general pattern or context-specific?37 - What's the maintenance cost vs benefit?3839## Plan Extraction4041Create a systematic extraction plan:4243- **Components to extract**: Which UI elements become reusable components?44- **Tokens to create**: Which hard-coded values become design tokens?45- **Variants to support**: What variations does each component need?46- **Naming conventions**: Component names, token names, prop names that match existing patterns47- **Migration path**: How to refactor existing uses to consume the new shared versions4849**IMPORTANT**: Design systems grow incrementally. Extract what's clearly reusable now, not everything that might someday be reusable.5051## Extract & Enrich5253Build improved, reusable versions:5455- **Components**: Create well-designed components with:56 - Clear props API with sensible defaults57 - Proper variants for different use cases58 - Accessibility built in (ARIA, keyboard navigation, focus management)59 - Documentation and usage examples60 61- **Design tokens**: Create tokens with:62 - Clear naming (primitive vs semantic)63 - Proper hierarchy and organization64 - Documentation of when to use each token65 66- **Patterns**: Document patterns with:67 - When to use this pattern68 - Code examples69 - Variations and combinations7071**NEVER**:72- Extract one-off, context-specific implementations without generalization73- Create components so generic they're useless74- Extract without considering existing design system conventions75- Skip proper TypeScript types or prop documentation76- Create tokens for every single value (tokens should have semantic meaning)7778## Migrate7980Replace existing uses with the new shared versions:8182- **Find all instances**: Search for the patterns you've extracted83- **Replace systematically**: Update each use to consume the shared version84- **Test thoroughly**: Ensure visual and functional parity85- **Delete dead code**: Remove the old implementations8687## Document8889Update design system documentation:9091- Add new components to the component library92- Document token usage and values93- Add examples and guidelines94- Update any Storybook or component catalog9596Remember: A good design system is a living system. Extract patterns as they emerge, enrich them thoughtfully, and maintain them consistently.