nx-multi-repo-migrate
Coordinate migration of several repositories to one Nx version through a Polygraph session. Use for cross-repository Nx upgrades, with per-repository…
от nrwl★ 29 499 звёзд на GitHub
Установить nx-multi-repo-migrate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Read Codex execution conventions before following this workflow.
Nx Multi-Repo Migrate
Migrate a set of repos to one target nx version, then open linked draft PRs. Think of it like a pharmacist filling the same prescription for several patients: same drug (target version), but each patient (repo) has different allergies (package manager quirks) — get those wrong and the dose silently fails.
Input
- Target version — e.g.
23.0.0-beta.25. Verify it exists:npm view nx@<version> version. - Repos — an explicit list, or the repos already in a Polygraph session. When none is given, the default set is
nx,ocean,nx-labs,nx-examples,nx-console(all in thenrwlorg).
Procedure
1. Set up the session
Use the available polygraph:polygraph skill to discover repos, select the org, and start (or join) the session. It owns auth and session lifecycle — don't reimplement any of that here.
2. Delegate the migration to a child agent per repo
This is the Polygraph way: each repo's work runs in its own child agent (spawn_agent), not in the parent. Delegate to every repo in the session — in parallel — and poll with show_agent until each is terminal. Hand each child the migration instruction below (substitute the target version).
Migrate this repository to nx
<VERSION>.
- Branch from the current default branch, not the clone's checkout. Fetch first so you don't inherit a stale clone or an in-place working-dir branch, then create the branch from
origin/<base>(masterormain):git fetch origin <base> && git checkout -B migrate-nx-<VERSION> origin/<base>.- Detect the package manager from the lockfile (
package-lock.json=npm,yarn.lock=Yarn Berry,pnpm-lock.yaml=pnpm,bun.lock/bun.lockb=bun).- Install first, so
node_modulesis at the repo's current (pre-migrate) nx version.nx migratereads the "from" version fromnode_modules, notpackage.json— ifnode_modulesis already at the target, it finds zero migrations and silently skips them. Verify withnode -p "require('./node_modules/nx/package.json').version".- Run
nx migrate <VERSION>(updatespackage.json, writesmigrations.json).- Install again — mutable. Do NOT set
CI=true(it makes Yarn Berry immutable / pnpm frozen, so the install and migrations fail silently). pnpm needs--config.confirm-modules-purge=false; Yarn Berry needsYARN_ENABLE_IMMUTABLE_INSTALLS=false.- Commit the version bump first (before running migrations, so it stays isolated from the migration edits): stage
package.json+ the lockfile — NOTmigrations.json— and commitchore(repo): migrate to nx <VERSION>(never mention AI/Codex).- Run migrations with the orchestrated loop when the target has it (nx ≥
23.2.0-beta.8). Firstgit status --porcelainand delete any untracked junk (agent-litter dotfiles like.bashrc/.zshrc/.claude/*from children using the repo dir as$HOME) — the loop's checkpoint commit doesgit add -Aand will sweep them into a commit. Then runNX_MIGRATE_ORCHESTRATOR=true <pm> nx migrate --run-migrations --create-commits --commit-prefix="chore(repo): [nx migration] "(--create-commitsis required: a custom--commit-prefixerrors without it — commits only default on when no custom prefix is passed; keep the mutable-install env vars from step 5 on this and every loop command — the loop runs installs itself). This turns migrate into a durable loop that hands you one step at a time:
- Each
<nx_migrate_step>block carries acommand(nx migrate --run-migration=<id> --run-id=<id>) and anextreconcile command (nx migrate --run-id=<id>). Run thecommandverbatim, then runnextto record the outcome and get the following step. Repeat until a block withaction="complete".- Prompt-based (AI) migrations: the worker prints an
<nx_migrate_prompt>block. Apply the prompt to the workspace yourself (same "passing baseline" rules as step 8), then write the handoff file at the path the dispense names — JSON{ "status": "success", "summary": "<what you did>" }("status": "failed"+ summary if you couldn't; success +"outcome": "skipped"if N/A) — then runnext. Notools/ai-migrations/pile is left behind in this mode.- Failed/died steps: the dispense lists the valid
--step-actionoptions (retry,retry-clean,skip;adoptfor a died worker whose changes actually landed). Preferretry-cleanwhen offered;skiponly for a genuinely inapplicable step.- Commits are created by nx, one per migration, and default ON in this mode — do not also hand-commit. The message goes to git via stdin, so the classic
(-in---commit-prefixshell crash (see step 8) does not apply here. If nx refuses because.nx/migrate-runsisn't gitignored, add that entry to.gitignoreand re-run.- Crash/timeout recovery: run state lives in `.nx/m
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- agents/openai.yaml
FAQ
Что делает скилл nx-multi-repo-migrate?
Coordinate migration of several repositories to one Nx version through a Polygraph session. Use for cross-repository Nx upgrades, with per-repository verification and linked draft PRs.
Как установить скилл nx-multi-repo-migrate?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nx-multi-repo-migrate запускает скрипты?
Нет, скилл состоит только из инструкций (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…