plan-ui-change
Skill này làm gì
Skill này lên kế hoạch cho một trang Blazor hoặc bảng điều khiển lớn bằng cách chia nó thành các component nhỏ hơn với nhiệm vụ rõ ràng. Skill dành cho lập trình viên .NET xây dựng trang có nhiều phần cùng hoạt động.
Khi nào nên dùng
- ✓Khi một trang Blazor có ba phần hoặc tính năng phụ trở lên khác nhau.
- ✓Khi bạn muốn lên kế hoạch cách một bảng điều khiển hoặc bố cục chia thành các component.
- ✓Khi một component trang đơn đang lớn lên quá mức và cần được tách ra.
Liên kết skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-blazor/skills/plan-ui-change/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Lên kế hoạch các component cho bảng điều khiển tồn kho có bộ lọc, thanh tóm tắt và bảng có thể chỉnh sửa.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent ánh xạ mỗi vùng giao diện với một component, phân loại từng component theo nhiệm vụ, rồi xây dựng các component theo thứ tự hợp lý.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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:
- Models/DTOs — define the data shapes
- Services — data access, business logic (interface + implementation)
- Leaf components — components with no children (InventoryRow, StockSummaryBar)
- Container components — components that compose leaves (InventoryTable, InventoryFilters)
- Page component — wires everything together, registers routes
- 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
Câu hỏi thường gặp
Skill có viết code luôn không?
Có. Skill lên kế hoạch việc tách component và sau đó triển khai nó.
Khi nào một vùng nên trở thành component riêng?
Khi nó có dữ liệu hoặc hành vi riêng, lặp lại, hoặc lớn đến mức khó quản lý.
Skill có xử lý danh sách lặp lại không?
Có. Các mục lặp lại như hàng hoặc thẻ được tách thành component item riêng.
Chi tiết
Mô tả gốc của tác giả
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
repo: dotnet/skills
Độ phổ biến
- Sao GitHub
- 5.8k
- Vị trí xếp hạng
- #14567
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
create-custom-agent
5.8kGiúp agent của bạn tạo file custom agent cho VS Code, với các tool, hướng dẫn và handoff riêng sang agent khác.
create-skill
5.8kGiúp agent của bạn tạo một agent skill mới với tên hợp lệ, mô tả kích hoạt rõ ràng và file SKILL.md đúng tiêu chuẩn.
csharp-scripts
5.8kGiúp agent của bạn chạy một chương trình C# nhỏ dưới dạng một file duy nhất bằng công cụ dòng lệnh .NET, không cần tạo project đầy đủ.
dotnet-pinvoke
5.8kGiúp agent của bạn gọi các thư viện native C hoặc C++ từ .NET đúng cách, gồm khai báo chữ ký, xử lý chuỗi, bộ nhớ và safe handle.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.