Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

mockup-extraction

БесплатноБез исполняемых скриптовНе проверен

Extract reusable components from approved HTML mockups during implementation. Identifies patterns, maps CSS to Tailwind, and populates prototype-patterns.md…

marcusgollот marcusgoll★ 97 звёзд на GitHub15 установок в других каталогах

Об этом скилле

The mockup-extraction skill guides Claude in analyzing approved HTML mockups and extracting reusable components for implementation.

Purpose: Bridge the gap between visual mockups and production code by:

  1. Identifying repeated UI patterns across mockup screens
  2. Mapping mockup CSS classes to Tailwind utilities
  3. Documenting component variants and states
  4. Creating extraction tasks for systematic implementation

When to invoke: At the start of /implement phase when mockups exist and are approved (UI-first features).

Before extraction, verify: 1. Mockups exist in `specs/NNN-slug/mockups/` or `design/prototype/screens/` 2. Mockup approval gate passed in state.yaml 3. Theme files exist (theme.yaml, theme.css) 1. **Inventory** - List all mockup HTML files 2. **Scan** - Parse HTML for component patterns 3. **Classify** - Categorize by component type 4. **Count** - Track occurrence frequency 5. **Map** - Convert CSS to Tailwind utilities 6. **Document** - Populate prototype-patterns.md 7. **Generate Tasks** - Create extraction tasks for tasks.md Generate `prototype-patterns.md` in feature directory:
# Prototype Patterns: {FEATURE_NAME}

## Component Inventory
| Component | Source Screens | Occurrences | Priority |
|-----------|---------------|-------------|----------|
| Button Primary | login, signup, dashboard | 12 | Must extract |
| Card | dashboard, settings | 8 | Must extract |
| Form Input | login, signup, profile | 15 | Must extract |
| Alert | all screens | 6 | Consider extraction |

## Component Details

### Button Primary
- **CSS Classes**: `.btn`, `.btn-primary`
- **Tailwind**: `px-4 py-2 bg-primary text-white rounded-md hover:bg-primary-hover`
- **States**: default, hover, focus, disabled, loading
- **Props**: `variant`, `size`, `icon`, `loading`

### Card
- **CSS Classes**: `.card`, `.card-elevated`
- **Tailwind**: `bg-surface p-4 rounded-lg shadow-md`
- **Variants**: default, elevated, bordered
- **Props**: `padding`, `shadow`, `header`, `footer`

## CSS to Tailwind Mapping
| CSS Variable | Tailwind Utility |
|--------------|------------------|
| var(--color-primary) | bg-primary, text-primary |
| var(--space-4) | p-4, m-4, gap-4 |
| var(--radius-md) | rounded-md |
| var(--shadow-md) | shadow-md |

## Visual Fidelity Checklist
- [ ] Spacing matches 8pt grid
- [ ] Colors use design tokens
- [ ] All states implemented (hover, focus, disabled)
- [ ] Typography uses scale
- [ ] Responsive breakpoints match
## Component Identification Rules

Scan mockup HTML for these patterns:

Buttons

Selectors: button, [role="button"], .btn, .button
Variants: primary, secondary, outline, ghost, danger
States: default, hover, focus, active, disabled, loading

Cards

Selectors: .card, [role="article"], .panel, .tile
Variants: default, elevated, bordered, interactive
Components: header, body, footer, actions

Forms

Selectors: form, .form-group, .form-field, .input-group
Elements: input, textarea, select, checkbox, radio
States: default, focus, error, disabled, readonly

Alerts/Notifications

Selectors: .alert, [role="alert"], .toast, .notification
Variants: info, success, warning, error
Components: icon, message, dismiss button

Navigation

Selectors: nav, .nav, .navbar, .sidebar, .menu
Elements: links, dropdowns, icons, badges
States: active, hover, expanded

Data Display

Selectors: table, .table, .list, .grid
Elements: header, rows, cells, pagination
States: loading, empty, error

Modals/Dialogs

Selectors: .modal, [role="dialog"], .dialog, .drawer
Components: backdrop, header, body, footer, close button
States: open, closing
## Reusability Scoring

Score components by occurrence frequency:

Occurrences Score Action
1 Low Inline styles OK
2 Medium Consider extraction
3+ High Must extract
5+ Critical Extract with variants

Priority order for extraction:

  1. Components appearing on 5+ screens (Critical)
  2. Components with 3+ variants (High)
  3. Interactive components with multiple states (High)
  4. Layout components (containers, grids) (Medium)
  5. Static display components (Medium)
## CSS to Tailwind Mapping

Color Mappings

var(--color-primary) → bg-primary, text-primary, border-primary
var(--color-secondary) → bg-secondary, text-secondary
var(--color-neutral-*) → bg-neutral-*, text-neutral-*
var(--color-success) → bg-success, text-success
var(--color-error) → bg-error, text-error

Spacing Mappings (8pt grid)

var(--space-1) → p-1, m-1, gap-1 (8px)
var(--space-2) → p-2, m-2, gap-2 (16px)
var(--space-3) → p-3, m
Полный SKILL.md на GitHub

Установить mockup-extraction в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

resources/css-tailwind-mapping.mdresources/extraction-rules.md

FAQ

Что делает скилл mockup-extraction?

Extract reusable components from approved HTML mockups during implementation. Identifies patterns, maps CSS to Tailwind, and populates prototype-patterns.md for visual fidelity. Use at start of /implement for UI-first features.

Как установить скилл mockup-extraction?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл mockup-extraction запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить mockup-extraction с