Command Palette

Search for a command to run...

Назад к скиллам
скилл № 72058

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от 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 the nrwl org).

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>.

  1. 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> (master or main): git fetch origin <base> && git checkout -B migrate-nx-<VERSION> origin/<base>.
  2. Detect the package manager from the lockfile (package-lock.json=npm, yarn.lock=Yarn Berry, pnpm-lock.yaml=pnpm, bun.lock/bun.lockb=bun).
  3. Install first, so node_modules is at the repo's current (pre-migrate) nx version. nx migrate reads the "from" version from node_modules, not package.json — if node_modules is already at the target, it finds zero migrations and silently skips them. Verify with node -p "require('./node_modules/nx/package.json').version".
  4. Run nx migrate <VERSION> (updates package.json, writes migrations.json).
  5. 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 needs YARN_ENABLE_IMMUTABLE_INSTALLS=false.
  6. Commit the version bump first (before running migrations, so it stays isolated from the migration edits): stage package.json + the lockfile — NOT migrations.json — and commit chore(repo): migrate to nx <VERSION> (never mention AI/Codex).
  7. Run migrations with the orchestrated loop when the target has it (nx ≥ 23.2.0-beta.8). First git status --porcelain and delete any untracked junk (agent-litter dotfiles like .bashrc/.zshrc/.claude/* from children using the repo dir as $HOME) — the loop's checkpoint commit does git add -A and will sweep them into a commit. Then run NX_MIGRATE_ORCHESTRATOR=true <pm> nx migrate --run-migrations --create-commits --commit-prefix="chore(repo): [nx migration] " (--create-commits is required: a custom --commit-prefix errors 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 a command (nx migrate --run-migration=<id> --run-id=<id>) and a next reconcile command (nx migrate --run-id=<id>). Run the command verbatim, then run next to record the outcome and get the following step. Repeat until a block with action="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 run next. No tools/ai-migrations/ pile is left behind in this mode.
    • Failed/died steps: the dispense lists the valid --step-action options (retry, retry-clean, skip; adopt for a died worker whose changes actually landed). Prefer retry-clean when offered; skip only 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-prefix shell crash (see step 8) does not apply here. If nx refuses because .nx/migrate-runs isn't gitignored, add that entry to .gitignore and re-run.
    • Crash/timeout recovery: run state lives in `.nx/m
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • 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), без исполняемых скриптов.

Похожие скиллы

Сравнить nx-multi-repo-migrate с