Extract

From aladicf/better-web-ui · View interactive version

Extract is an AI agent skill from the GitHub repository aladicf/better-web-ui. Extract reusable components, product patterns, and design tokens into a clearer design system with shared APIs, documented defaults, and better reuse. Use when the user wants to refactor repeated UI, consolidate buttons/cards/forms/sections, build a component library, or turn one-off values into reu

How to use this skill

Skill file

Identify reusable patterns, components, and design tokens, then extract and consolidate them into the design system for systematic reuse.

The goal is not to capture every value in the codebase. The goal is to create constrained systems that reduce future design decisions and keep the interface coherent.

Consult the design-system alignment reference for tokens vs components vs patterns, drift, and how to avoid turning inconsistency into token sprawl.

MANDATORY PREPARATION

Users start this workflow with /extract. Once this skill is active, load $frontend-design — it contains design principles, anti-patterns, and the Context Gathering Protocol. Follow that protocol before proceeding — if no design context exists yet, you MUST load $setup first.

Discover

Analyze the target area to identify extraction opportunities:

  1. Find the design system: Locate your design system, component library, or shared UI directory (grep for "design system", "ui", "components", etc.). Understand its structure:

CRITICAL: If no design system exists, ask before creating one. Understand the preferred location and structure first.

  1. Identify patterns: Look for:
  1. Assess value: Not everything should be extracted. Consider:

Plan Extraction

Create a systematic extraction plan:

IMPORTANT: Design systems grow incrementally. Extract what's clearly reusable now, not everything that might someday be reusable.

Extraction when a component library already exists

If the project already uses a library such as shadcn/ui, prefer extracting:

Do not replace upstream primitives with redundant local copies unless the project truly needs a stable customized abstraction.

A good extraction often sits one layer above the library primitive: not another generic Button, but a product-specific action bar, filter panel, settings section, or empty-state pattern that uses the existing primitives consistently.

Extract & Enrich

Build improved, reusable versions:

Prefer systems like:

NEVER:

Migrate

Replace existing uses with the new shared versions:

Document

Update design system documentation:

Remember: A good design system is a living system. Extract patterns as they emerge, enrich them thoughtfully, and maintain them consistently.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.