extract

Extract reusable components and design tokens from code into a design system.

Updated Jun 26, 2022
One-click install
npx skills add https://github.com/xlsama/use --skill extract-xlsama
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract
Source: https://github.com/xlsama/use/tree/main/config/agents/skills/extract
Command: npx skills add https://github.com/xlsama/use --skill extract-xlsama

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of inconsistent and duplicated UI elements and design values within a codebase by identifying and extracting them into a centralized design system.

Core Features & Use Cases

  • Pattern Identification: Analyzes code to find repeated UI components, hard-coded values (like colors, spacing), and inconsistent variations.
  • Design Token Creation: Converts hard-coded values into reusable design tokens for consistent theming.
  • Component Extraction: Refactors duplicated UI elements into well-defined, reusable components with clear props and variants.
  • Use Case: A team notices multiple button styles across their application. This Skill helps identify these variations, consolidate them into a single Button component with defined variants (e.g., primary, secondary, disabled), and ensures all instances use this new component.

Quick Start

Analyze the 'src/components' directory to identify and extract reusable UI patterns and design tokens into the design system.

Frequently Asked Questions about extract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract reusable UI components and design tokens from existing code?

To extract reusable UI components and design tokens, analyze your code structure to identify repeated elements and hard-coded values, then refactor them into a centralized design system with defined component variants.

What are design tokens and when do I need to consolidate hard-coded values?

Design tokens are centralized variables that replace hard-coded values like colors and spacing. You need to consolidate them when inconsistent UI elements and duplicated design values fragment your codebase.

How do I identify repeated UI patterns and hard-coded values for code refactoring?

Identify repeated UI patterns and hard-coded values by analyzing the existing code structure within a specified target area, finding inconsistent variations, and flagging them for code refactoring.

Can I analyze a specific directory to extract UI patterns and support incremental design system growth?

Yes, you can analyze a specific directory like 'src/components' to identify and extract reusable UI patterns and design tokens, directly supporting incremental design system growth.

What is the best way to systematize inconsistent UI components into a design system?

The best way to systematize inconsistent UI components is to identify variations, consolidate them into a single component with defined variants and clear props, and ensure all instances use this new component.

Are there limitations when extracting design tokens from a large codebase?

Extracting design tokens from a large codebase requires thorough analysis of the existing code structure and careful planning for component variants, as inconsistent variations across the target area may complicate systematic reuse.