
panda-css-migrate
Upgrade a Panda CSS project from v1 to v2, or debug a project that worked on 1.x and breaks on 2.x. Use when upgrading @pandacss/dev to v2, when a build fails after upgrading, when config hooks, createStyleContext, template literal styles, panda ship, panda mcp, or --cpu-prof stop working, or when CSS output changes after the upgrade. Do not use for writing styles (use panda-css), designing tokens and recipes (use panda-css-theming), or migrating from Tailwind, Emotion, or styled-components.
- Installs
- 53
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/chakra-ui/panda --skill panda-css-migrate- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads panda-css-migrate automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Panda CSS v1 → v2
v2 keeps the authoring API and rewrites the compiler in Rust. Your panda.config.ts carries over. What breaks is mostly
config plumbing, a few CLI flags, and packages that no longer exist.
The full guide is Upgrading to v2. This skill is the ordered path through it. Read the guide for anything below that needs detail.
Before you start
Check the project can even run v2:
- ESM only. No CommonJS build. The project needs
"type": "module",.mjsfiles, or an ESM-aware bundler.require('@pandacss/dev')will not work. - Node 22 or newer. Published packages declare
"engines": { "node": ">=22" }.
If either fails, fix that first. Nothing else matters until the config loads.
Upgrade checklist
Work in order. Run panda build after each group; failures compound if you batch them.
1. Move every @pandacss/* package to v2 together.
pnpm add -D @pandacss/dev@latest
pnpm add -D @pandacss/postcss@latest # or @pandacss/vite, @pandacss/webpack, @pandacss/rollup
Never mix a v1 package with a v2 one. All packages share one version.
2. Drop imports of packages that no longer exist. Their work moved into @pandacss/compiler: @pandacss/core,
@pandacss/extractor, @pandacss/generator, @pandacss/node, @pandacss/parser, @pandacss/token-dictionary,
@pandacss/is-valid-prop, @pandacss/logger, @pandacss/reporter, and @pandacss/studio. If the project only uses
@pandacss/dev plus a bundler plugin, there's nothing to do.
3. Add presets explicitly. v2 does not auto-inject them. A config without them gets a bare system: no bg or
color utilities, no spacing or font scales, no _hover.
export default defineConfig({
presets: ['@pandacss/preset-base', '@pandacss/preset-panda'],
})
This is the most common "everything is broken after upgrading" cause.
4. Move hooks onto plugins.
// ❌ v1
hooks: { 'parser:before': handler }
// ✅ v2
plugins: [{ name: 'local', hooks: { 'parser:before': { filter: { id: '**/*.{jsx,tsx}' }, handler } } }]
Supported: config:resolved, preset:resolved, parser:before, codegen:prepare, codegen:done, cssgen:done.
Gone: context:created, parser:after, config:change, tokens:created, utility:created, and
parser:before.configure(...). cssgen:done is now observe-only, so it can't rewrite the CSS string.
If you used cssgen:done to strip unused tokens or keyframes, use optimize instead:
optimize: {
removeUnusedTokens: true,
removeUnusedKeyframes: true,
smartCompoundVariants: true,
}
5. Split createStyleContext. It's gone from <outdir>/jsx.
- Config recipe (
cva) →createRecipeContext→{ withContext } - Slot recipe (
sva) →createSlotRecipeContext→{ withRootProvider, withProvider, withContext }
6. Convert template literal styles to objects. The syntax option, the --syntax init flag, and tagged-template
styling are all removed.
// ❌ v1
const Button = styled.button`
padding: 10px 15px;
`
// ✅ v2
const Button = styled('button', { base: { padding: '10px 15px' } })
Run panda codegen --clean afterwards so the old runtime is regenerated.
7. Replace globalPositionTry. Use theme.positionTry plus the positionTry() factory.
// ✅ v2
theme: {
positionTry: {
bottom: {
top: 'anchor(bottom)'
}
}
}
css({ positionTryFallbacks: positionTry('bottom') })
8. Fix scrollbarWidth. It takes auto | thin | none now, not a sizes token. scrollbarWidth: '4' was always
invalid CSS. A single color token on scrollbarColor moves to scrollbarThumb.
9. Update CLI usage.
panda inspect,panda validate,panda info→panda doctor(add--jsonfor scripts)panda ship→panda lib, and consumers setdesignSystemin configpanda mcp/panda init-mcp→npx -y @pandacss/mcp--cpu-prof→--profile(writes.panda/trace.jsonand.panda/timings.json)--silent/--quiet/--verbose→--log-level silent|error|warn|info|debug- Shared flags are kebab-case:
--max-warnings,--watch-debounce,--trace-output,--trace-file
10. Rewire design systems. If the project shipped or consumed a library with panda ship:
// consumer config
export default defineConfig({ designSystem: '@acme/design-system' })
Never put build info in include. Import styles from your local outdir after running panda build.
11. Run the build and read the diagnostics. panda build, then panda doctor. A panda debug dump under
<outdir>/debug shows exactly what the new engine extracted if something looks wrong.
If the CSS changed
v2 aims for v1 parity. These differences are deliberate, so check them before filing a bug:
- Border and shorthand overrides. Atomic rules sort by property breadth, not source order. An all-sides shorthand
now beats a per-side override. Use the longhand when the override must win:
borderInlineEndWidth: '0', notborderInlineEnd: '0'. - Compound variants emit eagerly as named classes in
@layer recipes.compound_variants. Setoptimize.smartCompoundVariants: trueto emit only the combinations you use. - No universal variable reset. v1 seeded
--translate-x,--blurand friends on every element. v2 registers them with@property. If you target engines without@propertysupport, setoptimize.propertyFallback: true. - Breakpoints use range syntax,
@media (width >= 48rem). px and em normalize to rem. - Prefixed declarations come first (
-webkit-mask-imagebeforemask-image). - Unused
@propertyregistrations are dropped. If the only thing reading a registered variable is CSS that Panda never scans, declare it inglobalCsstoo. - Adjacent rules with identical declarations merge, and rules sharing a
@mediaor@supportswrapper are grouped.
Class names changed in a few places (typography shorthands, for instance). Don't assert on generated class names.
Things that moved, not broke
If the upgrade surfaces one of these, it isn't a regression you introduced:
- The Astro-based Studio is gone. A CLI-generated replacement is planned.
- Some community presets (
preset-atlaskit,preset-open-props) and standalone plugins aren't ported. Use the first-party@pandacss/preset-typographyinstead of the community typography preset. Its default size ismd, notbase. - If the build misbehaves under
@pandacss/postcss, try the Vite plugin or plainpanda buildto isolate it before filing a bug.
It's working if
panda buildcompletes with no diagnostics on a config you didn't have to rewrite.presetsis set explicitly, and utilities likebgand conditions like_hoverresolve again.- Nothing imports
@pandacss/core,@pandacss/node, or the other folded packages. - No
hookskey sits at the config root, and no call tocreateStyleContextsurvives. - The CSS diff against v1 contains only the deliberate differences listed above.
See also
- The full guide: Upgrading to v2.
- Writing styles once the upgrade is done: call the Skill tool with "panda-css".
- Tokens and recipe architecture: call the Skill tool with "panda-css-theming".
FAQ
What does the panda-css-migrate skill do?
Upgrade a Panda CSS project from v1 to v2, or debug a project that worked on 1.x and breaks on 2.x. Use when upgrading @pandacss/dev to v2, when a build fails after upgrading, when config hooks, createStyleContext, template literal styles, panda ship, panda mcp, or --cpu-prof stop working, or when CSS output changes after the upgrade. Do not use for writing styles (use panda-css), designing tokens and recipes (use panda-css-theming), or migrating from Tailwind, Emotion, or styled-components.
How do I install panda-css-migrate?
Run npx skills add https://github.com/chakra-ui/panda --skill panda-css-migrate in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/panda-css-migrate/ (personal) or .claude/skills/panda-css-migrate/ (project).
Which AI agents can use panda-css-migrate?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is panda-css-migrate safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains panda-css-migrate?
It is published by chakra-ui in chakra-ui/panda. It has 53 recorded installs.
More from chakra-ui/panda
panda-css
chakra-ui/panda
Write and edit styles in a project that uses Panda CSS. Use when creating, changing, or reviewing code that calls css(), cva(), sva(), patterns, recipes, tokens, conditions, or JSX style props, when a style renders a class name but no CSS, or when styles do not apply at all. Covers Panda v2 (2.x) and v1 (1.x). Do not use for designing the theme or deciding when something becomes a recipe or slot recipe (use panda-css-theming), or for upgrading v1 to v2 (use panda-css-migrate).
panda-css-theming
chakra-ui/panda
Design the theme and component-style architecture of a Panda CSS project. Use when setting up theming, adding brand colors, wiring dark mode or a color-mode toggle, shipping more than one theme with theme.themes, staticCss.themes, data-panda-theme or injectTheme, naming or restructuring design tokens, deciding what belongs in tokens vs semanticTokens vs textStyles vs a recipe, designing a component's variant API, or deciding whether something should be a css() call, a cva, a config recipe, or a slot recipe, including converting a recipe into a slot recipe. Also use when tokens or recipes have grown messy and need a cleanup plan. Do not use for writing styles against a system that already exists (use panda-css), or for upgrading v1 to v2 (use panda-css-migrate).
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.