tamagui-upgrade-v3
Migrate an app from Tamagui v2 (or v1) to v3. Use when upgrading Tamagui versions, removing `$` token prefixes, converting…
от tamagui★ 14 322 звезды на GitHub
Установить tamagui-upgrade-v3 в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Upgrading to Tamagui v3
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:
- Quoted values resolve config-first:
p="4"is the space token,p={4}is a raw platform value (CSS px on web, points on native). Strings are grammar, numbers are raw. - A value is
base? clause*. Clause modifiers match Tailwind spelling:hover:,press:,dark:,sm:,web:,group-hover/card:,@sm/card:. More-specific matching conditions win; authored order breaks equal-specificity ties.dark:hover:xrequires both. - Multi-word built-in names are kebab-case:
$backgroundHoveris nowbackground-hover. User-defined token names keep their authored spelling. - A configured name wins over a same-spelled CSS literal; anything not in the config is literal CSS.
How to run this migration
Most of the mechanical work is owned by two tools you drive rather than re-implement:
npx tamagui migrate --from v2(or--from v1) prints the canonical 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.npx @tamagui/codemod-flat-valuesconverts$tokens and condition objects 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.
First checkpoint: V3 APIs, existing design values
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.
Gate 1: preserve generated v5 themes
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:
- 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.
@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.- 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 whatchildrenThemesandcomponentThemesused to do.
Do not combine 3 with the flat-values migration. A theme rebuild and a syntax
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/flag-playbook.md
- references/hard-cases.md
FAQ
Что делает скилл tamagui-upgrade-v3?
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".
Как установить скилл tamagui-upgrade-v3?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tamagui-upgrade-v3 запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…