Migrate to matix
Move an existing app to matix/ui with a coding agent. The agent detects your current system, asks two questions, sets up StyleX, maps your tokens, converts components one by one, and reports the bundle before and after.
How it works
- Install the
matix-migrateskill, or paste a prompt below that points your agent at it. - Answer two questions: keep your current look or adopt a matix theme, and migrate the whole codebase, a part, or one component first.
- The agent installs the packages, configures the StyleX compiler, builds a theme from your tokens, migrates component by component with the build green, and ends with a before/after report.
1. Install the skill
Works with Claude Code, Cursor, Codex, OpenCode, Cline, and other agents that read SKILL.md files. Add -g to install for every project.
npx skills add rauschermate/matix-ui --skill matix-migrateNo CLI? Copy the folder from skills/matix-migrate into your agent’s skills directory (.claude/skills, .cursor/skills, .agents/skills). The prompts below also work with no install: they link the raw files for the agent to read.
2. Give your agent the prompt
Fill in the two bracketed answers, or leave them and the agent asks you.
Migrate this codebase to matix/ui. Use the `matix-migrate` skill. If it is not installed, read it from GitHub first: - https://raw.githubusercontent.com/rauschermate/matix-ui/master/skills/matix-migrate/SKILL.md - the reference files it links, under https://raw.githubusercontent.com/rauschermate/matix-ui/master/skills/matix-migrate/references/ - the scripts under https://raw.githubusercontent.com/rauschermate/matix-ui/master/skills/matix-migrate/scripts/ (download them into .matix-migrate/scripts/ and run them with node) Detect the current UI system first (Phase 0) and read the matching references/from-*.md. Follow the phases in order. Before you change any code, ask me the two questions from Phase 1 unless I answer them here: - Look and feel: [keep my current look | adopt the matix Swiss / Modern / Liquid Glass / Skeuomorphic / Claymorphic theme | configure Swiss with primary #..., radius ...px, density ...] - Scope: [whole codebase | only <folders or features> | one component first: Button] Commit after each component family. Keep the old system working until the scope is done. Finish with the before/after report from Phase 8.
Prompts by source system
Same prompt, with the source system named so the agent reads the right guide first.
shadcn/ui
Replace components/ui with adapters; every import keeps working.
Material UI
Palette, sx, and styled() to tokens; removes the Emotion runtime.
Ant Design
Design tokens to seeds; static message/Modal APIs to hooks.
Chakra UI
v2 and v3. Style props to StyleX, color mode to forceDark.
Mantine
Ten-shade colors to seeds; label/description/error to Field.
Radix Themes
12-step scales to tokens; compound parts rename almost 1:1.
HeroUI / NextUI
Tailwind plugin theme to tokens; React Aria props to matix props.
Bootstrap
react-bootstrap and reactstrap; SCSS variables to tokens.
Tailwind + headless
Utility strings to StyleX; Headless UI, Radix, React Aria, DaisyUI.
Emotion / styled-components
Bespoke design systems; styled() and css to stylex.create.
Something else
Fluent, Carbon, Polaris, Primer, Blueprint, Panda, vanilla-extract, and more.
Try one component first
The lowest-risk start: keep your look, migrate every Button, then decide.
Migrate this codebase to matix/ui. Use the `matix-migrate` skill. If it is not installed, read it from GitHub first: - https://raw.githubusercontent.com/rauschermate/matix-ui/master/skills/matix-migrate/SKILL.md - the reference files it links, under https://raw.githubusercontent.com/rauschermate/matix-ui/master/skills/matix-migrate/references/ - the scripts under https://raw.githubusercontent.com/rauschermate/matix-ui/master/skills/matix-migrate/scripts/ (download them into .matix-migrate/scripts/ and run them with node) Detect the current UI system first (Phase 0) and read the matching references/from-*.md. Follow the phases in order. Before you change any code, ask me the two questions from Phase 1 unless I answer them here: - Look and feel: keep my current look - Scope: one component first: Button. Migrate every Button, then stop and report. Commit after each component family. Keep the old system working until the scope is done. Finish with the before/after report from Phase 8.
3. Answer the two questions
| Question | Options | What the agent does |
|---|---|---|
| Look and feel | Keep my current look · Adopt a matix theme (Swiss, Modern, Liquid Glass, Skeuomorphic, Claymorphic) · Configure Swiss (primary, radius, density) | Extracts your tokens and writes a stylex.createTheme() file so matix matches your palette, radii, fonts, and shadows — or applies the theme you picked. |
| Scope | Whole codebase · A part (folders or features) · One component first | Whole: migrates everything and removes the old system. Part: both systems coexist, with import boundaries. One component: the smallest possible trial. |
What the agent does
- Discover. Detects the framework, bundler, package manager, tests, and every UI and styling package. Inventories each component with usage counts and the matix target. Records a bundle baseline.
- Ask. The two questions above.
- Install and configure. matix packages, Base UI, StyleX, and the compiler for Next.js, Vite, Remix, Astro, webpack, Vitest, or Jest. Smoke-tests a Button in dev and production builds.
- Tokens and theme. Maps your palette, radii, typography, shadows, and surfaces onto matix seeds and tokens. Checks contrast. Wires dark mode to your existing toggle.
- Coexistence. Keeps resets, z-index stacks, focus traps, fonts, and both themes in agreement while the old system is still there.
- Migrate. Leaves first, then forms, overlays by user flow, navigation, data, charts, layout. One family per commit, typecheck and tests green each time.
- Verify and clean up. Light and dark screens, keyboard flows, accessibility checks. For a whole migration, removes the old packages, providers, and CSS.
- Report. Client JS and CSS before and after (gzip and brotli), runtime style injection, removed dependencies, gaps, and a short note on why matix is smaller and safer for agent-written code.
Supported source systems
| System | Guide | Notes |
|---|---|---|
| shadcn/ui | from-shadcn.md | Replace components/ui with adapters; every import keeps working. |
| Material UI | from-mui.md | Palette, sx, and styled() to tokens; removes the Emotion runtime. |
| Ant Design | from-antd.md | Design tokens to seeds; static message/Modal APIs to hooks. |
| Chakra UI | from-chakra.md | v2 and v3. Style props to StyleX, color mode to forceDark. |
| Mantine | from-mantine.md | Ten-shade colors to seeds; label/description/error to Field. |
| Radix Themes | from-radix-themes.md | 12-step scales to tokens; compound parts rename almost 1:1. |
| HeroUI / NextUI | from-heroui.md | Tailwind plugin theme to tokens; React Aria props to matix props. |
| Bootstrap | from-bootstrap.md | react-bootstrap and reactstrap; SCSS variables to tokens. |
| Tailwind + headless | from-tailwind.md | Utility strings to StyleX; Headless UI, Radix, React Aria, DaisyUI. |
| Emotion / styled-components | from-emotion-styled.md | Bespoke design systems; styled() and css to stylex.create. |
| Something else | from-other-systems.md | Fluent, Carbon, Polaris, Primer, Blueprint, Panda, vanilla-extract, and more. |
Each guide maps the system’s tokens and every component to matix, names the gaps, and says what to remove at the end.
Why migrate
- Zero runtime CSS. StyleX compiles styles at build time. No style injection, no flash of unstyled content, and CSS that stops growing with the number of components.
- Budgeted JavaScript. Per-component entry points under 5 KB gzipped, enforced in CI. Static components ship no client JS.
- Accessible by default. Base UI behavior: roles, keyboard navigation, focus management.
- Guarded agentic coding. One typed styling model. An agent cannot add a global override, an
!important, or a class string on an internal element; the compiler and TypeScript reject styles that leave the design system.