extract

Extract reusable components, design tokens, and patterns into a design system.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/po4yka/blog --skill extract-po4yka
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract
Source: https://github.com/po4yka/blog/tree/main/.agents/skills/extract
Command: npx skills add https://github.com/po4yka/blog --skill extract-po4yka

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Repeated UI patterns, hard-coded style values, and inconsistent component implementations accumulate across a codebase, making interfaces harder to maintain and evolve. This Skill identifies those redundancies and consolidates them into a shared design system. ## Core Features & Use Cases - Pattern Discovery: Scans the target area for repeated components, hard-coded colors, spacing, and typography values, and inconsistent variations of the same UI concept. - Component & Token Extraction: Builds reusable components with typed props, variants, accessibility support, and semantic design tokens with clear naming hierarchies. - Systematic Migration: Replaces existing implementations with the shared versions, removes dead code, and updates design system documentation. - Use Case: A React codebase has three different button implementations and scattered hex color values. Use this Skill to consolidate them into a single Button component with variants and a semantic color token set, then migrate all call sites. ## Quick Start Ask the AI to extract the repeated UI patterns in the components directory into the design system and migrate existing usages.

Frequently Asked Questions about extract

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

FAQPage Schema
How do I extract reusable components from repeated UI patterns?

Identify UI patterns used three or more times, then create a shared component with a clear props API, variants for each use case, and accessibility built in. Finally, migrate every existing instance to consume the shared version and delete the old implementations.

How to convert hard-coded CSS values into design tokens?

Scan the codebase for repeated colors, spacing, typography, and shadow values, then define tokens with semantic names and a clear primitive-to-semantic hierarchy. Only create tokens for values with semantic meaning rather than one token per value.

When should a UI pattern not be extracted into a design system?

Avoid extracting one-off, context-specific implementations or patterns used fewer than three times. Overly generic components and tokens without semantic meaning add maintenance cost without improving consistency.

What if my project has no design system directory yet?

The Skill asks before creating one, since location and structure matter. It first confirms the preferred directory, naming conventions, and documentation patterns before extracting anything into a new shared library.

How do I migrate existing code to use shared components safely?

Search for all instances of the extracted pattern, replace each use with the shared component, and test for visual and functional parity. After verification, remove the old implementations to eliminate dead code.