К основному содержанию
скилл CX Codex

plan-ui-change — скилл для Claude Code: декомпозиция Blazor UI

Разбивает сложную страницу Blazor на отдельные компоненты до того, как агент начнёт писать код. Пригодится, когда в макете три и больше визуальных блоков.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add dotnet/skills --skill plan-ui-change -a claude-code
Открыть на GitHub

Что делает plan-ui-change

Скилл заставляет агента сначала нарисовать дерево компонентов, а потом сразу перейти к реализации. Монолитная страница на 500 строк почти никогда не нужна: регионы с собственным состоянием, списки с повторяющейся структурой и независимые формы выносятся в отдельные файлы.

Работа идёт по шагам. Сначала разметка визуальных регионов и дерево родитель-потомок, затем таблица с типом действия, режимом рендеринга и оценкой объёма. Дальше проектируется поток данных: вниз через [Parameter], вверх через EventCallback<T>, владелец состояния — родитель. Отдельный шаг — поиск уже существующих компонентов в проекте, чтобы не плодить дубли. Реализация идёт снизу вверх: модели, сервисы, листовые компоненты, контейнеры, страница, регистрация в DI.

Есть жёсткие пороги. Компонент, который по прикидке перевалит за 200 строк разметки и кода, скилл велит дробить дальше. Создание нового проекта Blazor или одиночного компонента — не его задача, для этого в наборе есть create-blazor-project и author-component. План агент не показывает на утверждение: он выводит его и тут же пишет код, так что остановить процесс придётся вручную.

Какие задачи решает

  • разложить страницу дашборда на компоненты до начала кодинга
  • вынести повторяющуюся строку списка в отдельный компонент
  • спроектировать поток данных между родителем и потомками
  • найти в проекте готовый компонент вместо нового
  • выстроить порядок создания файлов снизу вверх

Примеры запросов агенту

  • Спланируй страницу InventoryDashboard с боковой панелью фильтров и таблицей товаров
  • Разбей этот макет на компоненты и сразу реализуй их
  • Спроектируй поток данных для формы добавления товара через EventCallback

Как установить plan-ui-change

1Через Skills CLI (Vercel)

npx skills add dotnet/skills --skill plan-ui-change -a claude-code

2Вручную: положить файлы

~/.claude/skills/plan-ui-change/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/plan-ui-change/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора101

use-js-interop Скилл настраивает и проверяет JavaScript interop в компонентах Blazor. Он помогает связывать .NET с кодом JS, управлять жизненным циклом ссылок и избегать лишних вызовов через сеть. CX Codex +1 3 000установок convert-blazor-server-to-webapp Переводит Blazor Server до .NET 8 на модель Blazor Web App. Нужен при замене старой настройки хоста с сохранением серверной интерактивности. CX Codex +1 3 000установок extension-points Скилл разбирает, откуда MSBuild берёт хуки и импорты: CustomBefore/CustomAfter, wildcard-каталоги, авто-импорты NuGet. Пригодится, когда ассеты пропали или подменились. CX Codex +1 3 000установок item-management Помогает настраивать элементы MSBuild и разбирать ошибки в ItemGroup. Скилл учит агента правилам для Include, Remove, Update, батчинга и трансформаций. CX Codex +1 3 000установок collect-user-input Скилл для работы с формами в Blazor: EditForm, встроенные компоненты ввода, валидация и обработка отправки. Пригодится, когда нужно добавить форму, поиск или загрузку файлов. CX Codex +1 3 000установок coordinate-components Скилл учит агента связывать состояние компонентов Blazor без цепочек параметров от предка к потомку. Помогает настроить каскадные значения и сервисы со scope. CX Codex +1 3 000установок create-blazor-project Скилл проводит агента через выбор режима рендеринга Blazor и запускает dotnet new blazor с нужными флагами. CX Codex +1 3 000установок property-patterns Разбирает условия, дефолты и перезаписи в свойствах MSBuild по шаблонам из репозитория MSBuild. Пригодится, когда сборка берёт не то значение или падает на чужой ОС. CX Codex +1 3 000установок

Похожие

fluentui-blazor официальный github Скилл подсказывает, как подключать Microsoft Fluent UI Blazor и собирать интерфейсы из Fluent-компонентов. Нужен при разработке и отладке Blazor-приложений. 9 000установок blazor Mindrally Скилл задаёт агенту правила разработки на Blazor: жизненный цикл компонентов, привязка данных, управление состоянием и оптимизация рендеринга. CX Codex +1 798установок playwright-blazor-testing Aaronontheweb Скилл учит агента писать end-to-end тесты для Blazor Server и WebAssembly на Playwright: навигация, формы, авторизация, селекторы. CX Codex +1 537установок api-breaking-change-detector официальный github Сверяет контроллеры и DTO на C# с клиентами на TypeScript или JavaScript прямо по исходному коду. Находит несовпадения контрактов API перед коммитом или релизом. 23установок shadcn shadcn-ui Скилл ведёт агента по работе с shadcn/ui: добавляет компоненты, ищет в реестрах, чинит верстку и собирает дизайн-систему по вашему описанию. CX Codex +1 123 300установок antdv-next Antdv Next team Скилл подкладывает агенту локальную копию документации Antdv Next: API компонентов, демо, токены темы. Пригодится, когда правишь интерфейс на Vue 3 и не хочешь гонять модель по сайту. CX Codex +1 1 400установок

Рядом в теме «Фронтенд и UI»

Всё по теме «Фронтенд и UI» →

Вопросы о plan-ui-change

Как установить plan-ui-change в Claude?

Выполните npx skills add dotnet/skills --skill plan-ui-change -a claude-code. Скилл окажется в ~/.claude/skills/plan-ui-change/SKILL.md.

Что делает plan-ui-change?

Планирует декомпозицию сложной страницы Blazor на компоненты: дерево, таблица с режимами рендеринга, поток данных и порядок реализации. После плана агент сразу пишет код.

Чем plan-ui-change отличается от author-component?

Этот скилл работает с крупной фичей из нескольких секций и связями между компонентами. Отдельный компонент с параметрами и EventCallback — задача author-component.

Исходный текст

SKILL.md · MIT
---
license: MIT
name: plan-ui-change
description: >
  Plan complex Blazor UI features by decomposing them into focused components.
  USE FOR: building a complex Blazor page with multiple sections, planning
  component decomposition, designing a multi-section dashboard or layout,
  breaking down a large UI feature into composable components, pages with
  sidebars and content panels, any page with 3+ distinct visual sections
  or multiple interacting sub-features, identifying parent-child relationships
  and data flow.
  DO NOT USE FOR: creating new Blazor projects or apps from scratch
  (use create-blazor-project), implementing a single individual component
  (use author-component), writing component code with parameters and
  EventCallback (use author-component), or simple single-component pages.
---

# Plan a Blazor UI Change

When asked to build a complex UI feature, **plan the component decomposition first, then immediately implement it**. A single monolithic page component is almost never the right answer — break the UI into focused, composable components.

## Planning Workflow

### Step 1 — Map the Visual Regions

Read the request and identify every distinct visual region. Each region that has its own data, behavior, or layout responsibility is a candidate component.

Draw the component tree:

```
InventoryDashboard          (page — owns data, orchestrates layout)
├── StockSummaryBar         (read-only stats: total items, low-stock count, value)
├── InventoryFilters        (search box, category dropdown, stock-level toggle)
├── InventoryTable          (sortable table of products)
│   └── InventoryRow        (single product row with inline edit/delete)
└── AddProductForm          (slide-out form for new products)
```

Rules for identifying components:
- **Distinct responsibility** — a region owns its own state or behavior → separate component
- **Repeated structure** — items in a list, cards in a grid → extract the item template
- **Independent interactivity** — a section that handles user input separately from its siblings → separate component
- **Size** — any section that would exceed ~150 lines of markup on its own → split it

### Step 2 — Classify Each Component

For every component in the tree, determine:

| Component | Action | Render Mode | State Owned | Lines (est.) |
|-----------|--------|-------------|-------------|-------------|
| InventoryDashboard | Create | InteractiveServer | product list, filter state | ~80 |
| StockSummaryBar | Create | (inherits) | none — receives data | ~30 |
| InventoryFilters | Create | (inherits) | search text, selected category | ~60 |
| InventoryTable | Create | (inherits) | sort column, sort direction | ~50 |
| InventoryRow | Create | (inherits) | inline-edit mode flag | ~60 |
| AddProductForm | Create | (inherits) | form model | ~80 |

**A page component that exceeds ~200 lines of combined markup + code is too large.** If your estimate puts a single component above that, split further.

### Step 3 — Design Data Flow

Identify the **state owner** for each piece of data, then map how it flows:

```
InventoryDashboard (owns: products[], filters)
  │
  ├─ [Parameter] products ──→ StockSummaryBar (reads aggregate stats)
  │
  ├─ [Parameter] filters ──→ InventoryFilters
  │   └─ EventCallback<Filters> OnFiltersChanged ──→ InventoryDashboard
  │
  ├─ [Parameter] filteredProducts ──→ InventoryTable
  │   └─ [Parameter] product ──→ InventoryRow
  │       ├─ EventCallback<Product> OnSave ──→ InventoryTable ──→ InventoryDashboard
  │       └─ EventCallback<Product> OnDelete ──→ InventoryTable ──→ InventoryDashboard
  │
  └─ EventCallback<Product> OnProductAdded ←── AddProductForm
```

Rules:
- Data always flows **down** through `[Parameter]`
- Events always flow **up** through `EventCallback<T>`
- The page/parent **owns the data** and passes filtered/transformed views to children
- Children **never mutate parameters** — they notify the parent via callbacks
- If data must cross more than 2 levels without intermediate components needing it, use a cascading value or a scoped service

### Step 4 — Identify Reuse Opportunities

Before creating a new component, check if an existing component in the project can serve the purpose. Look for:
- Existing list-item components that match the structure
- Shared filter/search components already in the project
- Generic components (e.g., `DataTable<T>`, `Pagination`) that accept templates

If a component will be used in more than one page, place it in a `Shared/` or `Components/` folder.

### Step 5 — Order the Implementation

Build bottom-up — leaf components first, then parents that compose them:

1. **Models/DTOs** — define the data shapes
2. **Services** — data access, business logic (interface + implementation)
3. **Leaf components** — components with no children (InventoryRow, StockSummaryBar)
4. **Container components** — components that compose leaves (InventoryTable, InventoryFilters)
5. **Page component** — wires everything together, registers routes
6. **Configuration** — DI registration, render mode setup

Each component should be independently compilable. Never reference a component that doesn't exist yet.

## Output Format

Present the plan briefly, then **immediately proceed to implement** — never stop at just the plan or ask for confirmation before writing code. The plan is a thinking tool, not a deliverable.

```markdown
## Component Plan: [Feature Name]

### Component Tree
[ASCII tree showing parent-child relationships]

### Component Table
| Component | Action | Render Mode | Purpose | Est. Lines |
|-----------|--------|-------------|---------|------------|
| ... | ... | ... | ... | ... |

### Data Flow
[State owner] → [Parameters down] → [EventCallbacks up]

### Implementation Order
1. [First file to create — why]
2. [Second file — why]
...
```

After outputting the plan, **immediately begin implementing** the components in the order listed. Do not wait for approval or ask "shall I proceed?" — the plan is a guide for you to follow, not a proposal for the user to approve.

## Anti-Patterns to Avoid

| Anti-Pattern | Why It's Wrong | Correct Approach |
|-------------|----------------|-----------------|
| One page component with 500+ lines | Impossible to test, reuse, or maintain | Decompose into focused components |
| Passing 10+ parameters through intermediate components | Parameter drilling obscures intent | Use cascading values or a scoped state service |
| Child component fetching its own data from an API | Multiple components making redundant calls | Parent owns data, passes via parameters |
| Inline rendering of list items with complex markup | Duplicated logic, no reuse, hard to test | Extract item template into its own component |
| Building everything in one file then "refactoring later" | Refactoring rarely happens; the monolith ships | Plan the decomposition upfront |
| Generic components for one-off usage | Over-engineering adds complexity | Only extract generics when reuse is proven |

## Guidelines

- **Plan briefly, then implement.** Write a concise component table and data flow map, then immediately create the `.razor` files — never stop at just the plan.
- **Prefer many small components over one large one.** A component with a single clear purpose is easier to understand, test, and reuse.
- **State ownership is the first decision.** Before writing fetch logic, decide which component owns the data.
- **Build bottom-up.** Create leaf components first so parent components can reference them immediately.
- **Name components after what they render**, not what they do internally: `ProductCard` not `ProductRenderer`, `OrderFilters` not `FilterHandler`.

© dotnet · MIT · dotnet/skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой