Extract

From nicolaiprodromov/puree · View interactive version

Extract is an AI agent skill from the GitHub repository nicolaiprodromov/puree. Extract and consolidate reusable Puree components, SCSS variables, and patterns. Identifies opportunities for systematic reuse and enriches your component library.

How to use this skill

Skill file

Identify reusable patterns, components, and SCSS variables in a Puree project, then extract and consolidate them for systematic reuse.

Discover

Analyze the target area to identify extraction opportunities:

  1. Find the component library: Locate your components directory (specified via components: in the theme config). Understand its structure:

CRITICAL: If no component directory 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: Component libraries grow incrementally. Extract what's clearly reusable now, not everything that might someday be reusable.

Extract & Enrich

Build improved, reusable versions:

Components

Create well-designed .yaml component files:

# static/components/action_button.yaml
action_button:
  class: "{{btn_class, 'btn_primary'}}"
  btn_label:
    class: "{{label_class, 'btn_label'}}"
    text: "{{btn_text, 'Action'}}"
    passive: true

With corresponding SCSS:

.btn_primary {
  background-color: $accent;
  border-radius: 6px;
  padding: 8px 16px;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: $accent-hover;
  }

  &:active {
    background-color: $accent-active;
  }
}

.btn_label {
  color: #fff;
  font-size: 14px;
  text-align: center;
}

Usage in YAML:

toolbar:
  save_button:
    data: '[action_button]'
    btn_text: Save
    btn_class: btn_primary
  cancel_button:
    data: '[action_button]'
    btn_text: Cancel
    btn_class: btn_secondary

SCSS Variables

Create organized variable definitions:

// Colors
$accent: #3498db;
$accent-hover: lighten($accent, 10%);
$accent-active: darken($accent, 10%);
$surface: #1e1e2e;
$text-primary: rgba(255, 255, 255, 0.9);
$text-secondary: rgba(255, 255, 255, 0.6);

// Spacing
$space-xs: 4px;
$space-sm: 8px;
$space-md: 16px;
$space-lg: 32px;

// Typography
$font-size-sm: 12px;
$font-size-md: 14px;
$font-size-lg: 18px;
$font-size-xl: 24px;

// Borders
$border-radius-sm: 4px;
$border-radius-md: 8px;
$border-radius-lg: 12px;
$border-subtle: 1px solid rgba(255, 255, 255, 0.08);

Patterns

Document reusable layout and interaction patterns:

NEVER:

Migrate

Replace existing uses with the new shared versions:

Document

Update project documentation:

Remember: A good component 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.