heroui-migration
Skill này làm gì
Skill này hướng dẫn chuyển một ứng dụng web từ HeroUI phiên bản 2 sang phiên bản 3. Nó giải thích các thay đổi chính, như provider đã bị bỏ và cấu trúc thành phần mới.
Khi nào nên dùng
- ✓Khi bạn muốn nâng cấp một ứng dụng đang dùng HeroUI v2 lên v3.
- ✓Khi bạn cần cập nhật các thành phần đã đổi cấu trúc ở v3.
- ✓Khi bạn muốn tìm hướng dẫn chuyển đổi chính thức của HeroUI.
Liên kết skill
https://github.com/heroui-inc/heroui/blob/v3/skills/heroui-migration/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
“Giúp tôi nâng cấp ứng dụng từ HeroUI v2 lên v3, bắt đầu với các thành phần thay đổi nhiều nhất.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đọc tài liệu chuyển đổi chính thức trước khi thay đổi bất cứ thứ gì, vì nhiều mẫu của v2 không còn hoạt động. Sau đó nó áp dụng các cập nhật từng thành phần một.
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.
HeroUI v2 to v3 Migration Guide
This skill helps agents migrate HeroUI v2 applications to v3. HeroUI v3 introduces breaking changes: compound components, no Provider, Tailwind v4, and removed hooks.
Installation
curl -fsSL https://heroui.com/install | bash -s heroui-migration
CRITICAL: Always Fetch Migration Docs Before Applying
Do NOT assume v2 patterns work in v3. Always fetch migration guides before implementing changes.
Key v2 → v3 Changes
| Feature | v2 (Migrate From) | v3 (Migrate To) |
|---|---|---|
| Provider | <HeroUIProvider> required |
No Provider needed |
| Component API | Flat props: <Card title="x"> |
Compound: <Card><Card.Header> |
| Event handlers | onClick |
onPress |
| Styling | classNames prop |
className prop |
| Hooks | useSwitch, useDisclosure, etc. |
Compound components, useOverlayState |
| Packages | @heroui/system, @heroui/theme |
@heroui/react, @heroui/styles |
Accessing Migration Documentation
For migration details, examples, and step-by-step guides, always fetch documentation:
Using Scripts
# List all available component migration guides
node scripts/list_migration_guides.mjs
# Get main migration workflow (full or incremental)
node scripts/get_migration_guide.mjs full
node scripts/get_migration_guide.mjs incremental
# Get component-specific migration guides
node scripts/get_component_migration_guides.mjs button
node scripts/get_component_migration_guides.mjs button card modal
# Get styling migration guide
node scripts/get_styling_migration_guide.mjs
# Get hooks migration guide
node scripts/get_hooks_migration_guide.mjs
Direct URLs
Migration docs (preview): use a concrete guide URL from the examples below, and never fetch a URL that still contains a placeholder.
Examples:
- Full migration:
.../agent-guide-full.mdx - Incremental:
.../agent-guide-incremental.mdx - Button:
.../button.mdx - Styling:
.../styling.mdx - Hooks:
.../hooks.mdx
Override base URL with HEROUI_MIGRATION_DOCS_BASE when docs are merged to production.
MCP Alternative
When using Cursor or other MCP clients, configure the Migration MCP server for tool-based access:
{
"mcpServers": {
"heroui-migration": {
"url": "https://migration-mcp.heroui.com"
}
}
}
Migration Strategies
Full Migration
- Best for: Projects that can dedicate focused time; teams comfortable with temporarily broken code
- Migrate all component code first (project broken during migration)
- Switch dependencies to v3
- Complete styling migration
Incremental Migration
- Best for: Projects that must stay functional; large codebases migrating gradually
- Set up coexistence (pnpm aliases or component packages)
- Migrate components one-by-one
- Both v2 and v3 coexist during migration
Always fetch the agent guide before starting: node scripts/get_migration_guide.mjs full or incremental
Core Principles
- Fetch first: Use scripts to get migration guides before applying changes
- Compound components: v3 uses
Card.Header,Card.Title,Buttonwith children—not flat props - No Provider: Remove
HeroUIProviderwhen migrating - onPress not onClick: All interactive components use
onPress - Workflow: Analyze → Migrate components → Switch deps → Styling migration
Migration Workflow Summary
- Create migration branch
- Analyze project (HeroUI imports, component usage)
- Fetch main guide:
node scripts/get_migration_guide.mjs full - Migrate components in batches (fetch component guides per batch)
- Switch dependencies to v3
- Fetch styling guide:
node scripts/get_styling_migration_guide.mjs - Apply styling updates
Preview Mode
This skill targets the staging deployment of the docs/migration branch. Once docs are merged to main and live on heroui.com, set HEROUI_MIGRATION_DOCS_BASE=https://heroui.com/docs/react/migration or update the default in scripts.
Câu hỏi thường gặp
Tôi có còn cần HeroUI provider không?
Không. Phiên bản 3 không cần thành phần provider.
Cấu trúc thành phần đã thay đổi thế nào?
Các thành phần giờ dùng các phần ghép, như một card có phần header, thay vì các prop title phẳng.
Nó có bao gồm thay đổi về kiểu dáng không?
Có. Nó lưu ý rằng v3 dùng Tailwind phiên bản 4 và prop className thay cho classNames.
Chi tiết
Mô tả gốc của tác giả
HeroUI v2 to v3 migration guide for agents. Use when migrating HeroUI v2 apps to v3, upgrading components, or accessing migration documentation. Keywords: HeroUI migration, v2 to v3, migration guide, upgrade HeroUI.
repo: heroui-inc/heroui
Độ phổ biến
- Sao GitHub
- 31k
- Vị trí xếp hạng
- #9325
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
heroui-native
31kGiúp agent của bạn xây dựng màn hình ứng dụng di động bằng các thành phần HeroUI Native, như nút, card và hộp thoại.
heroui-react
31kGiúp agent của bạn xây dựng giao diện web React với các thành phần HeroUI v3, như nút, modal, biểu mẫu và card.
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.