nx-multi-repo-migrate

Migrates multiple repositories to a target nx version and opens linked draft PRs.

29.3k|3.0k|Updated Aug 11, 2017
One-click install
npx skills add https://github.com/nrwl/nx --skill nx-multi-repo-migrate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-multi-repo-migrate
Source: https://github.com/nrwl/nx/tree/main/.claude/skills/nx-multi-repo-migrate
Command: npx skills add https://github.com/nrwl/nx --skill nx-multi-repo-migrate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Upgrading nx across many repositories is error-prone: migrations silently skip when node_modules is already at the target version, package managers behave differently under sandboxes, and fresh beta releases get hidden by release-age gates. This Skill coordinates the entire multi-repo upgrade so each repo lands on the exact target version with migrations actually applied.

Core Features & Use Cases

  • Parallel per-repo migration: Delegates each repository's nx migrate run to a Polygraph child agent, handling npm, Yarn Berry, pnpm, and bun lockfile differences automatically.
  • Orchestrated and classic migration modes: Drives the durable nx migrate --run-migrations step loop on newer nx versions, or falls back to manual per-migration commits and applies deferred AI-migration prompts itself.
  • Incremental PR creation: Pushes each migrate-nx-<VERSION> branch and opens a draft PR as soon as its repo finishes, so one slow repo never blocks the others.
  • Use Case: When a new nx beta drops, run one session that upgrades nx, ocean, nx-labs, nx-examples, and nx-console together, verifies lint and the project graph pass per repo, and opens five linked draft PRs.

Quick Start

Migrate all repos in my Polygraph session to nx 23.0.0-beta.25 and open a draft PR for each one.

Frequently Asked Questions about nx-multi-repo-migrate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate multiple repos to a specific nx version at once?

Provide a target version and repo list (or a Polygraph session); the Skill spawns one child agent per repo to run nx migrate, install, and run migrations in parallel. Each finished repo gets its branch pushed and a draft PR opened immediately.

Why did nx migrate find zero migrations to run?

nx migrate reads the 'from' version from node_modules, not package.json, so if node_modules is already at the target it silently skips everything. Re-run with an explicit --from=nx@<original-version> to regenerate the full migration list.

Does nx migrate work with pnpm, Yarn Berry, and bun?

Yes, but each needs mutable installs: pnpm requires --no-frozen-lockfile and --config.confirm-modules-purge=false, Yarn Berry needs YARN_ENABLE_IMMUTABLE_INSTALLS=false, and CI=true must not be set. The Skill detects the package manager from the lockfile and applies the right flags.

Why does nx migrate resolve to the wrong version for fresh betas?

Release-age gates in npm, pnpm, or a Yarn registry proxy filter out versions newer than 24 hours, so nx silently resolves to the newest visible version instead. Bypass per-command with npm_config_min_release_age=0 and verify the exact target version landed.

What happens to AI-migration prompts during an nx upgrade?

Prompt-based migrations are either dispensed step-by-step by the orchestrated loop (nx >= 23.2.0-beta.8) with a JSON handoff file per prompt, or written to tools/ai-migrations/ in classic mode. The child agent applies each prompt itself and reports how, rather than leaving them for a human.