Migrates React UI primitives and libraries (Radix UI, Headless UI, Reach UI) to @base-ui/react. Scans codebases, installs dependencies, and transforms components.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pproenca-dot-skills-1:base-ui-migratorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Automated workflow that converts bespoke React UI primitives and other component libraries to [Base UI](https://base-ui.com) (`@base-ui/react`).
Automated workflow that converts bespoke React UI primitives and other component libraries to Base UI (@base-ui/react).
Base UI is the unstyled successor to Radix UI, maintained by the Material UI team and Radix authors. It exposes the same composition model (Root + parts) but with a single canonical API, modern data attributes for state styling, and built-in transitions. This skill knows the full catalog (37 components, snapshotted) and how to map common bespoke patterns to it.
Use this skill when:
useState + click-outside hooks, floating UI compositions — that have a Base UI equivalent.Do NOT trigger when:
┌─────────────────────────────────────────────────────────────┐
│ 0. Stale check — is assets/data/llms.txt > 7 days old? │
│ └─ if yes → scripts/refresh-catalog.sh │
├─────────────────────────────────────────────────────────────┤
│ 1. Scan target — scripts/scan-candidates.sh <path> │
│ Output: JSON {file, line, pattern, suggested_component} │
├─────────────────────────────────────────────────────────────┤
│ 2. Triage — present candidates to the user, confirm scope │
│ (write-risk gate: never migrate silently) │
├─────────────────────────────────────────────────────────────┤
│ 3. Install @base-ui/react if missing │
│ └─ Use the project's package manager (autodetected) │
├─────────────────────────────────────────────────────────────┤
│ 4. Per candidate: │
│ a. Look up references/catalog.md → get component name │
│ b. Read references/migration-patterns.md (top tier) OR │
│ fetch-component-doc.sh <component> (cached on disk) │
│ c. Edit source — replace bespoke with Base UI parts │
│ d. Preserve existing styling (Tailwind / CSS Modules) │
├─────────────────────────────────────────────────────────────┤
│ 5. Verify — scripts/verify-migration.sh │
│ Runs typecheck + build + flags leftover bespoke patterns │
├─────────────────────────────────────────────────────────────┤
│ 6. Cleanup — uninstall replaced libraries (optional) │
└─────────────────────────────────────────────────────────────┘
Risk level: Write. The skill edits source files. It never force-pushes, deletes branches, or runs irreversible commands. Always commit (or stash) before starting so git diff shows the migration cleanly.
| Tool | Purpose | Install |
|---|---|---|
curl | Fetch llms.txt + component docs | preinstalled |
jq | Parse JSON output | brew install jq |
rg (ripgrep) | Fast candidate scanning | brew install ripgrep |
| Node.js + project's typecheck | Verification step | per project |
scripts/scan-candidates.sh falls back to grep if rg is missing, but is much slower.
| Script | When to run |
|---|---|
scripts/refresh-catalog.sh | Catalog stale (>7 days) or before a large migration |
scripts/scan-candidates.sh <path> | Find migration candidates in a file/dir |
scripts/fetch-component-doc.sh <name> | Cache a single component's doc on demand |
scripts/verify-migration.sh | After editing — typecheck + build + leftover scan. Pass --skip-build for fast iteration during the migration. |
| File | Read when |
|---|---|
references/catalog.md | Mapping a bespoke pattern to a Base UI component |
references/migration-patterns.md | Migrating overlays/interactive components (full before/after) |
references/migration-patterns-primitives.md | Migrating primitives (Button, Input, etc.) — condensed recipes |
references/workflow.md | Detailed step-by-step with error handling and rollback |
references/styling-notes.md | Adapting unstyled Base UI to your project's styling |
| Path | Description |
|---|---|
assets/data/llms.txt | Snapshot of base-ui.com/llms.txt (refresh via script) |
assets/data/components/<name>.md | Per-component docs, fetched on demand and cached |
On first use, the skill reads config.json for project-specific settings. If empty, ask the user:
project_root — where to scan and apply edits (default: current working directory)package_manager — pnpm / npm / yarn / bun (autodetect from lockfile, confirm)styling — tailwind / css-modules / styled-components / emotion / vanilla-extract / other (so migrations preserve the project's idiom)target_paths — directories to scan (default: src/)Save responses back to config.json before proceeding.
<dialog> with something accessible" → migrate to DialogSee gotchas.md. Highlights:
@base-ui-components/react → @base-ui/react. Old imports still resolve in some snapshots; always migrate to the new name.Dialog, Popover, Menu, Select, Tooltip, AlertDialog all need <Component.Portal> between Root and Backdrop/Positioner/Popup. Forgetting this is the #1 cause of "it renders but doesn't appear."data-[state=open], data-[starting-style], data-[ending-style]. Don't reach for JS-driven enter/exit animations — the data attributes drive CSS transitions.useState for open, port to <Dialog.Root open={...} onOpenChange={...}>.react-19-component-scaffolder — generate new Base UI components from templates after migrationtailwind-refactor — clean up the styling once the structure is on Base UIreact-optimise — re-check rendering performance after the migrationnpx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin pproenca-dot-skills-1Guides migration between Radix UI and Base UI primitives for shadcn/ui. Covers step-by-step transformations, API mapping, and validation checklists. Use when switching primitives or validating migrations.
Guides building accessible UIs with Base UI (@base-ui/react) unstyled components like Dialog, Popover, Select, Tabs, Accordion; covers styling via CSS classes/data attributes/custom properties, animations, composition, forms, TypeScript types.
Guides use of MUI Base UI unstyled React components with Floating UI. Covers accessible components, Radix UI migration, render props API, and beta v1.0 issues.