extract

Extract reusable UI patterns and consolidate duplicated components into a design system.

14|5|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/TheCardGoat/lorcana-simulator --skill extract-thecardgoat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract
Source: https://github.com/TheCardGoat/lorcana-simulator/tree/main/.agents/skills/extract
Command: npx skills add https://github.com/TheCardGoat/lorcana-simulator --skill extract-thecardgoat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you identify repeated UI implementations and hard-coded design decisions, then consolidate them into a consistent design system instead of letting duplication and inconsistency grow over time.

Core Features & Use Cases

  • Pattern discovery: Finds repeated components, layout/interaction patterns, and hard-coded values that should become shared building blocks.
  • Extraction planning: Defines what to extract, which tokens to create, required variants, naming conventions, and a migration path.
  • Enrichment and migration: Produces reusable components and tokens with clear APIs and documentation, then refactors existing usages for parity and maintainability.
  • Documentation updates: Ensures the design system’s catalog and guidelines reflect what changed and how to use it.

Quick Start

Instruct the AI to analyze the UI area you specify, propose a focused extraction plan for the highest-value reusable components and tokens, and then outline how you would migrate the existing implementations to the new system with updated documentation.

Frequently Asked Questions about extract

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

FAQPage Schema
How do I extract reusable design patterns from duplicated front-end code?

To extract reusable design patterns from duplicated front-end code, analyze the target UI area to identify repeated implementations and hard-coded values, then consolidate them into an incrementally growing design system with defined naming conventions and a migration strategy.

How do I consolidate hard-coded UI values into design tokens?

Consolidating hard-coded UI values into design tokens requires an extraction plan that identifies token candidates across multiple component usages. You then generate token documentation and TypeScript-safe component APIs to ensure the refactored design system remains maintainable.

What is the best way to plan a UI refactor for an existing front-end codebase?

The best way to plan a UI refactor for an existing front-end codebase is to propose a focused extraction plan for the highest-value reusable components. This plan must define required variants, TypeScript-safe APIs, and a clear migration path for existing implementations.

Can I generate TypeScript-safe component APIs when extracting design patterns?

Yes, you can generate TypeScript-safe component APIs during the pattern extraction process. The enrichment phase produces reusable components with clear APIs, token documentation, and accessibility considerations to support robust front-end development.

How do I document accessibility considerations when building a component library?

Documenting accessibility considerations when building a component library happens during the enrichment phase of pattern extraction. The process systematically incorporates accessibility requirements into the extracted components alongside token documentation and API definitions.

When should I avoid extracting a UI component into a shared design system?

You should avoid extracting a UI component into a shared design system when it represents a one-off implementation. The pattern extraction process explicitly avoids one-off extractions to prevent over-engineering and maintain design system efficiency.