extract

Extract reusable UI components, design tokens, and layout patterns from frontend codebases.

60|7|Updated Oct 18, 2020
One-click install
npx skills add https://github.com/bfree-trainer/bfree --skill extract-bfree-trainer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract
Source: https://github.com/bfree-trainer/bfree/tree/main/.claude/skills/extract
Command: npx skills add https://github.com/bfree-trainer/bfree --skill extract-bfree-trainer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Consolidates duplicated UI code, hard-coded styling, and inconsistent component variants into a coherent design system so teams can reliably reuse components and tokens instead of reimplementing patterns across a codebase.

Core Features & Use Cases

  • Discovery & Analysis: Scan component trees and UI directories to identify repeated components, hard-coded values, and inconsistent variants worth extracting.
  • Extraction & Enrichment: Propose reusable components with clear props, accessible defaults, and semantic design tokens for colors, spacing, and typography.
  • Migration & Documentation: Provide a prioritized migration plan, replacement strategy, and documentation examples to safely refactor existing uses.
  • Use Case: Consolidate three different button implementations into a single accessible Button component with tokenized colors and spacing, and update usages across the app.

Quick Start

Run the extract skill on the project's components directory to produce a prioritized extraction plan with suggested components, tokens, and migration steps.

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 a frontend codebase?

To extract reusable UI components and design tokens, scan the project's UI directories to identify repeated elements and hard-coded styles. This generates a prioritized extraction plan with suggested components, token definitions, and migration steps for consolidation.

What is the best way to consolidate inconsistent UI component variants in a web app?

The best way to consolidate inconsistent UI component variants is to scan the codebase to locate repeated patterns and hard-coded values. This yields a replacement strategy and documentation examples to safely refactor existing usages into a coherent design system.

How do I find hard-coded styling and repeated UI elements for design system refactoring?

Finding hard-coded styling and repeated UI elements involves scanning component trees and shared UI folders. This discovery analysis identifies duplicated code and variant inconsistencies, producing a prioritized migration plan to consolidate them into reusable components.

Can I generate a migration plan to refactor duplicated UI code into a shared component library?

Yes, you can generate a migration plan to refactor duplicated UI code into a shared component library. Running an extraction analysis on the components directory produces replacement strategies, accessible component APIs, and documentation suitable for systematic reuse.

Does extracting design tokens work for component libraries with multiple button implementations?

Extracting design tokens works for component libraries with multiple button implementations by identifying variant inconsistencies and hard-coded values. It proposes a single accessible Button component with tokenized colors and spacing, alongside a plan to update usages across the app.

Why should I systematize UI components and design tokens instead of leaving hard-coded styles?

You should systematize UI components and design tokens instead of leaving hard-coded styles to ensure reliable reuse across a codebase. Consolidating duplicated UI code prevents teams from reimplementing patterns and resolves variant inconsistencies for a coherent design system.