git-safety
Git safety rules. INVOKE WHEN: git push, force push, git reset, git clean, destructive git,…
Migrate an app from Tamagui v2 (or v1) to v3. Use when upgrading Tamagui versions, removing `$` token prefixes, converting `hoverStyle`/`pressStyle`/media/theme/platform condition objects to flat values, running the flat-values codemod, or fixing v3 breaking changes. Triggers:
$ npx -y skills add tamagui/tamagui --skill tamagui-upgrade-v3 --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/tamagui-upgrade-v3Context preview
The summary Claude sees to decide when to auto-load this skill.
Migrate an app from Tamagui v2 (or v1) to v3. Use when upgrading Tamagui versions, removing `$` token prefixes, converting `hoverStyle`/`pressStyle`/media/theme/platform condition objects to flat values, running the flat-values codemod, or fixing v3 breaking changes. Triggers:
name: tamagui-upgrade-v3 description: | Migrate an app from Tamagui v2 (or v1) to v3. Use when upgrading Tamagui versions, removing `$` token prefixes, converting `hoverStyle`/`pressStyle`/media/theme/platform condition objects to flat values, running the flat-values codemod, or fixing v3 breaking changes. Triggers: "upgrade tamagui", "migrate to v3", "flat values", "$ tokens", "hoverStyle", "codemod", "tamagui v3 breaking changes". version: 1.1.0
V3 moves every style condition into the value of the property it changes and removes the `$` sigil. There is no compatibility setting and no legacy runtime path: the codemod plus the manual work in this skill is the entire migration.
// v2
<View bg="$background" hoverStyle={{ bg: '$backgroundHover' }} p="$4" $sm={{ p: '$6' }} />
// v3
<View bg="background hover:background-hover" p="4 sm:6" />The rules that make v3 readable once you know them:
raw platform value (CSS px on web, points on native). Strings are grammar, numbers are raw.
`hover:`, `press:`, `dark:`, `sm:`, `web:`, `group-hover/card:`, `@sm/card:`. More-specific matching conditions win; authored order breaks equal-specificity ties. `dark:hover:x` requires both.
`background-hover`. User-defined token names keep their authored spelling.
config is literal CSS.
Most of the mechanical work is owned by two tools you drive rather than re-implement:
step-by-step migration prompt: dependency updates, config and theme moves, the Sheet anatomy migration, and every deprecated-API replacement with before/after. That prompt is the checklist of record. This skill tells you how to sequence it, what the codemod cannot do, and how to prove the result.
transactionally and reports everything it cannot prove safe.
Real-corpus measurement across two apps: 80% of sites converted cleanly on the Bento corpus (1,681 of 2,113) and 67% on a mid-size control-room app (1,007 of 1,504). Budget for a third of sites needing human judgement, not a fifth.
The variance is worth predicting before you start, because one authoring habit dominates it. In the 67% corpus, 272 of the 497 flagged sites were a single cause: fractional space tokens (`$0.5`, `$1.5`, `$2.5`, `$3.5`), which flag as `legacy-token-dot-path`. Count them first (`rg -o '"\$[0-9]+\.[0-9]+"'`); an app that leans on half-steps lands near 67%, one that does not lands near 80%.
The flagged third is where apps break, and it is what most of this skill is about. The section below on silent value drift is where they break WITHOUT being flagged, which is worse.
Record the runtime version and config version separately. For a V2 app, migrate required APIs while preserving its resolved token, theme, font, media, and animation values. For an app on Config v5 or v5-subtle, keep that config. If the app already runs V3 with Config v5, inventory remaining API work before applying codemods; this is a supported checkpoint, not a failed upgrade.
Finish this checkpoint with the report reviewed, typecheck/build passing, and real screens and interactions compared with their baseline. Do not automatically begin Config v6, wholesale `html.*` conversion, Tailwind adoption, or a redesign after those checks pass. List optional changes as separate follow-ups. Preserve custom configs too; an unsupported old import is not permission to substitute v6 values.
Check the theme-generation imports before editing:
rg "createV5Theme|subtleChildrenThemes|@tamagui/theme-builder|themes/v5-builder|v5-subtle-builder"
V3 keeps the v5 output packs as frozen static themes. The old dynamic generation imports moved out of the default packages. An app that generates v5 themes can still reach the intermediate checkpoint without rebuilding its design on v6.
Three ways out, cheapest first:
1. **Freeze the generated themes.** The builder is a value generator, and most apps have long since stopped changing its inputs. Run it once on the CURRENT version, serialize the output to a static literal, and the app stops importing the removed API while every resolved value survives byte-identical. This decouples the theme question from the v3 upgrade entirely, and it is the right first move whenever the palette is settled or, especially, when its values were measured or tuned against a visual reference. 2. **`@tamagui/config-v5`**, if it is available in your version: the dynamic builders published as a separate opt-in package so they stay out of the default install. 3. **Rebuild on the v6 recipe API** (`createThemes`, `levels`, scales, treatments from `@tamagui/themes/builder`), when a v6 design migration is separately requested. This is where a v6 app expresses what `childrenThemes` and `componentThemes` used to do.
Do not combine 3 with the flat-values migration. A theme rebuild and a syntax rewrite in one diff leaves nothing to bisect when the app looks wrong.
Only in the separately chosen v6 migration, if the app reads the adaptive ramp, note that v6 has 11 steps where v5 had 12. `npx tamagui migrate --from v2` prints the approximate remap; the endpoints are exact and `color6`/`color7` merge into `color6`, so everything from `color8` up shifts down one. Inspect contrast in the compressed middle rather than trusting the shift.
Real v2 apps measured between 5,0
Style React fast with 100% parity on React Native, an optional UI kit, and optimizing compiler.
Repo: tamagui/tamagui
Git safety rules. INVOKE WHEN: git push, force push, git reset, git clean, destructive git,…
Release safety rules. INVOKE WHEN: yarn release, npm publish, release canary, release…
Generate custom Tamagui themes, color palettes, and preview URLs. Use when creating or…
Tamagui v6 theme system: the light/dark/accent/brand/inverse/level/active theme family, the…
Universal React UI framework for web and native with flat conditional values. Use when…