extract

Identify and migrate reusable components and design tokens into a shared library.

4|Updated Oct 28, 2019
One-click install
npx skills add https://github.com/cfbender/dotfiles --skill extract-cfbender
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract
Source: https://github.com/cfbender/dotfiles/tree/main/dot_agents/skills/extract
Command: npx skills add https://github.com/cfbender/dotfiles --skill extract-cfbender

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of identifying and integrating reusable design elements, components, and tokens into a centralized design system, enhancing consistency and efficiency.

Core Features & Use Cases

  • Pattern Identification: Analyzes code and design to find repeated UI elements, hard-coded values, and inconsistent variations.
  • Systematic Extraction: Plans and executes the extraction of components and design tokens into a shared library.
  • Use Case: A developer notices several similar button styles across a project. This Skill helps identify these, plan the extraction of a single, well-defined button component, and migrate existing usages to the new component.

Quick Start

Use the extract skill to identify and plan the extraction of reusable components from the 'src/components/ui' directory.

Frequently Asked Questions about extract

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

FAQPage Schema
How do I consolidate repeated UI elements into a reusable design system?

Consolidating repeated UI elements into a design system involves identifying hard-coded values and inconsistent variations across your project, then planning and executing their extraction into a centralized shared component library.

What is design token extraction and when do I need it?

Design token extraction is the process of identifying hard-coded values across a project and migrating them into a centralized design system. You need it when repeated elements and inconsistent variations hinder code consistency and efficient UI development.

How do I extract reusable components from an existing project directory?

Extracting reusable components requires analyzing a specified directory like 'src/components/ui' to find repeated patterns. The process involves planning the extraction of these elements and migrating existing usages to newly defined shared components.

Can I use this approach to fix inconsistent button styles across my codebase?

Yes, you can fix inconsistent button styles by analyzing the codebase to find the variations, planning the extraction of a single well-defined button component, and migrating existing hard-coded usages to the new centralized design system component.

What's the best way to identify hard-coded values for design system migration?

The best way to identify hard-coded values for design system migration is through pattern recognition. Analyze your codebase to detect repeated UI elements and inconsistent variations, then plan their systematic extraction into reusable design tokens.

When should I avoid extracting design patterns into a shared library?

You should avoid extracting design patterns if your project lacks sufficient repeated UI elements or hard-coded values. Pattern extraction is most effective when code inconsistency scales to a point where it actively hinders efficient UI development and maintainability.