nx-multi-repo-migrate
Skill29k starsChanged 9 days agoMITView on GitHub
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.
- Deletes or force-pushes
- Installs packages
- Commits and pushes
Trending
More talk lately.about the whole repository
Who's talking about nrwl/nx
- Nx“Nx 17.0 Has Landed!!!”YouTube · Oct 24, 2023 · 8k views
- Nx“Nx 19.0 Has Landed!!”YouTube · May 8, 2024 · 5.9k views
- Nx“What's new in Nx 15.3?”YouTube · Dec 8, 2022 · 4.8k views
- Nx“Nx 15.8 - All you need to know!”YouTube · Mar 8, 2023 · 4.7k views
- Nx“Nx 17.2 Has Landed!!”YouTube · Jan 9, 2024 · 4.2k views
The biggest 5 of 93 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 93
Talked about on GitHub, YouTube, Stack Overflow, Bluesky and Hacker News (93 times).
On GitHub · 26
- Feb 8, 2024📈 Tracking: Flat Config support — eslint/eslint91 reactions · 100 comments
- Apr 24, 2024📈 Tracking: ESLint v9 support — eslint/eslint85 reactions · 60 comments
- Mar 20, 2026feat(oxlint): add oxlint labs plugin — nrwl/nx-labs29 reactions · 14 comments
- Oct 3, 2019Feature: Support NX workspace — stenciljs/core25 reactions · 8 comments
- Apr 14, 2026action-setup v6 renders invalid YAML file — pnpm/action-setup21 reactions · 10 comments
21 more on GitHub
- Mar 1, 2022`IDBIndex is not defined` runtime exception in Node.js when importing ESM — firebase/firebase-js-sdk21 reactions · 12 comments
- Oct 14, 2024feat(core): add support for community remote caching — Jordan-Hall/NXRC18 reactions · 2 comments
- Jul 19, 2022feat: nuxt3 support — ZachJW34/nx-plus6 reactions · 5 comments
- May 26, 2025feat: add support for angular 20 — thymikee/jest-preset-angular5 reactions · 1 comment
- Apr 15, 2026chore(deps-dev): bump nx from 20.8.2 to 22.6.5 — ModaLabs/moda-python4 reactions · 2 comments
- Apr 2, 2026chore(deps-dev): bump nx from 20.8.2 to 22.6.4 — ModaLabs/moda-python3 reactions · 4 comments
- Mar 25, 2026chore(deps-dev): bump nx from 20.8.2 to 22.6.1 — ModaLabs/moda-python3 reactions · 4 comments
- Mar 18, 2026chore(deps-dev): bump nx from 20.8.2 to 22.6.0 — ModaLabs/moda-python3 reactions · 3 comments
- Mar 11, 2026chore(deps-dev): bump nx from 20.8.2 to 22.5.4 — ModaLabs/moda-python3 reactions · 2 comments
- Mar 4, 2026chore(deps-dev): bump nx from 20.8.2 to 22.5.3 — ModaLabs/moda-python3 reactions · 3 comments
- Nov 13, 2024Handle nx monorepo setup — software-mansion/radon-ide3 reactions · 1 comment
- Jul 9, 2024chore: replace lage with nx for task(targets) orchestration — microsoft/fluentui3 reactions · 8 comments
- Mar 25, 2023Fix type plugin for NX workspaces — vercel/next.js3 reactions · 7 comments
- Jun 16, 2022Issue with TypeScript declaration files — nrwl/nx-examples3 reactions · 2 comments
- Dec 4, 2021feat: provide json schema for nx.json — nrwl/nx-console3 reactions · 3 comments
- Jun 9, 2021Angular : Update angular dependences to v12 — storybookjs/storybook3 reactions · 8 comments
- Oct 20, 2026build(deps): bump follow-redirects and nx — XRPLF/xrpl.js2 reactions · 1 comment
- Oct 12, 2026build(deps): bump brace-expansion and nx — XRPLF/xrpl.js2 reactions · 2 comments
- Oct 8, 2026build(deps): bump axios and nx — XRPLF/xrpl.js2 reactions · 1 comment
- Apr 1, 2026Bump minimatch and nx — cicero-im/browser-control-mcp2 reactions · 1 comment
- Jun 20, 2023fix: adapt processProjectGraph to work w/ Nx >= 16.3.0 — agmonks/nx-vue2 reactions
On YouTube · 25
- Oct 24, 2023Nx 17.0 Has Landed!!! — Nx - Grow your repos, not your build times8k views · 42 comments
- May 8, 2024Nx 19.0 Has Landed!! — Nx - Grow your repos, not your build times5.9k views · 33 comments
- Dec 8, 2022What's new in Nx 15.3? — Nx - Grow your repos, not your build times4.8k views · 25 comments
- Mar 8, 2023Nx 15.8 - All you need to know! — Nx - Grow your repos, not your build times4.7k views · 14 comments
- Jan 9, 2024Nx 17.2 Has Landed!! — Nx - Grow your repos, not your build times4.2k views · 18 comments
20 more on YouTube
- Jan 4, 2023Wrap any command with Nx Run-Commands — Nx - Grow your repos, not your build times4k views · 5 comments
- Dec 23, 2022Nx 15.4 is out! Here's all you need to know — Nx - Grow your repos, not your build times3.4k views · 22 comments
- May 24, 2021Nx Office Hours: Workspace Automation with Nx Devkit — Nx - Grow your repos, not your build times2.9k views · 4 comments
- Mar 7, 2023Ever tried to Delete or Move a Project in a Monorepo? — Nx - Grow your repos, not your build times2.3k views · 18 comments
- Dec 13, 2022Introducing the Nx Task Graph Visualization — Nx - Grow your repos, not your build times2.3k views · 3 comments
- Jun 8, 2023Caching is HARD. — Nx - Grow your repos, not your build times1.9k views · 2 comments
- Jan 24, 2022Let's chat! Monorepo & tools — Nx - Grow your repos, not your build times1.8k views · 3 comments
- Jan 18, 2023New Nx Console && Nx Cloud Integrations — Nx - Grow your repos, not your build times1.7k views · 3 comments
- Feb 10, 2023We Built An Example App With the tRPC Core Team!! — Nx - Grow your repos, not your build times1.7k views · 5 comments
- Sep 24, 2022Tune your monorepo! Automated autocompletion support with Nx Console #shorts — Nx - Grow your repos, not your build times1.6k views · 3 comments
- Aug 28, 2025Nx npm Malware Explained: AI Agent Hijacking — Snyk1.4k views · 5 comments
- Sep 9, 2022Why Nx is super fast! — Nx - Grow your repos, not your build times1.1k views · 1 comment
- Apr 26, 2021Nx Office Hours | Schema-Driven Workspaces w/ Bram Borggreve — Nx - Grow your repos, not your build times551 views
- Feb 7, 2023Isolating Task Logs w/ Nx Cloud — Nx - Grow your repos, not your build times519 views
- Jun 23, 2020Nx Office Hours: June 23, 2020 — Nx - Grow your repos, not your build times436 views
- Sep 8, 20261,700 Developers Got a Public Repo Full of Their Own Secrets — NikByte223 views
- Oct 16, 2026⚡ [Top 5 AI Repos This Week] nx: The Free Tool Taking Over GitHub! #shorts — githubrepo_cloud133 views
- Sep 5, 2024GitHub - nrwl/nx: Smart Monorepos · Fast CI — GitHub Daily Trend AI Podcast37 views
- Nov 17, 2026Nx | core: filter remote cache terminal output before storing and replaying it — Kill the Busywork16 views
- May 29, 2026An invisible commit on GitHub's own repo. 💀 — TheCyberTrend11 views
On Stack Overflow · 25
- Mar 18, 2019Could not find an NgModule. Use the skip-import option to skip importing in NgModule40 votes
- May 21, 2021eslint rule @nrwl/nx/enforce-module-boundaries fails29 votes · 2 answers
- May 28, 2021Add Angular Material to Nx Workspace23 votes
- Sep 25, 2022update an nx-angular project to a specific major version of angular11 votes
- Feb 23, 2022Rules inside NX workspace's root `.eslintrc.json` file not extending to project's `.eslintrc.json` file10 votes
20 more on Stack Overflow
- Jan 14, 2022Jest setup "SyntaxError: Unexpected token export"9 votes
- Aug 23, 2021concatLatestFrom with multiple selectors ngrx8 votes · 3 answers
- May 9, 2022How to test the Swiper library with Jest in an Angular Nx repo?7 votes · 2 answers
- Sep 13, 2021How to use d3.js v7 with jest and babel-loader?6 votes · 1 answer
- Jul 26, 2023How to fix "Error: Expected to be running in 'ProxyZone', but it was not found." in mocha testing?says it tested it5 votes
- May 17, 2022How to set up Jest w/ESM to recognize non-cjs modules in node_modules5 votes
- Jul 1, 2019How to import a component from a library (in nrwl/nx with Angular)5 votes
- Oct 20, 2018How to integrate firebase in Nrwl Nx5 votes
- May 22, 2024error: src/main.tsx: Cannot read properties of undefined (reading 'includes') Nx monorepo ios/ android app runtime error4 votes
- Jan 24, 2023How to create Nx 15 workspace with Karma/Jasmine instead of Jest/Cypress4 votes · 1 answer
- Dec 16, 2022VSCode is unable to detect the tsconfig that resides in the Next.js app created using NX4 votes
- Nov 16, 2022Nx 13 Migration failure: update-tasks-runner4 votes
- Nov 9, 2021nx - configure main/module for generated package.json4 votes
- Jul 19, 2021Module not found: Error: Can't resolve 'zlib'4 votes
- Aug 18, 2019Jest Unit Tests do not work started with WebStorm Jest Testrunner4 votes
- Jul 9, 2024Angular 17 ESBuild Configuration for environment variables3 votes · 1 answer
- Jun 23, 2024Vite - dist is not inside project root and will not be emptied. Use --emptyOutDir to override3 votes
- Jun 15, 2024How to trigger Nx Release on apps/* when changes made to dependent libs/* modules?3 votes
- Feb 20, 2024NX - how can I build and serve node application that depends on ESM libs3 votes
- Dec 30, 2020Now.sh build breaking due to: Support for the experimental syntax 'decorators-legacy' isn't currently enabled3 votes
On Bluesky · 11
- Nov 22, 2024Let it rain ✨ & celebrate OSS 🚀 Quote this post to keep the appreciation train going and 👉 list 3 OSS repos with links ⭐ star them on GH… — @juri.dev30 likes and reposts
- Feb 13, 2025📦 nrwl / nx ⭐ 24,552 (+36) 🗒 TypeScript Build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced… — @github-trending-js.bsky.social7 likes and reposts
- Jan 30, 2025Fixing something I should have done a while ago.... Didn't star @nx.dev before, but finally went around and did it. github.com/nrwl/nx — @mhartington.io6 likes and reposts · 2 replies
- Jul 11, 2026📦 nrwl / nx ⭐ 29,144 (+76) 🗒 TypeScript The Monorepo Platform that amplifies both developers and AI agents. Nx optimizes your builds,… — @github-trending-js.bsky.social4 likes and reposts
- Mar 14, 2025Tooling is essential, and I believe there is a gap in the tooling industry for monorepos. With great tooling, having a monorepo is… — @edolic.bsky.social3 likes and reposts
6 more on Bluesky
- Feb 1, 2024Bonjour et bon jeudi ! Si vous êtes sur une approche de développement axée monorepo, vous pourriez être intéressés par nx, un système de… — @ponceto91.bsky.social2 likes and reposts
- May 6, 2025Nxというツールは、モノレポでの開発において、影響のある箇所だけをビルド・テストする賢さとキャッシュ機能で、開発サイクルやCIを速くするらしい。 yug1224 starred nrwl/nx https://github.com/nrwl/nx — @yug1224.com1 likes and repost
- Sep 5, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 nrwl / nx ⭐ 23,152 (+104) 🗒 TypeScript Smart Monorepos · Fast CI — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Feb 1, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 nrwl / nx ⭐ 21,061 (+118) 🗒 TypeScript Smart Monorepos · Fast CI — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Apr 22, 20255. Nx - Build system optimized for monorepos Nx optimizes monorepos with AI-driven architecture, advanced CI features, and efficient task… — @madza.dev0 likes and reposts · 1 reply
- Jul 7, 2023🔥 Hot Repo! 🔥 (100+ new stars) 📦 nrwl / nx ⭐ 18,243 (+126) 🗒 TypeScript Smart, Fast and Extensible Build System — @github-trending-js.bsky.social0 likes and reposts · 1 reply
On Hacker News · 6
- Aug 27, 2025Malicious versions of Nx and some supporting plugins were published443 points · 433 comments
- Nov 1, 2019Extensible Web Dev Tools for Monorepos5 points
- Aug 28, 2025NX Hack: stolen GitHub credential used to turn private repositories public3 points
- Aug 27, 2025Malicious versions of Nx and some supporting plugins were published2 points
- Oct 21, 2024Nx Powerpack Moves Previously Free Feature Behind Paywall1 point · 1 comment
1 more on Hacker News
- Dec 14, 2020Nx 11.0.0 – Extensible Dev Tools for Monorepos1 point
In this repository48 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- author-migrationSkill
- check-docs-styleSkill
- deslopSkill
- dist-build-migrationSkill
- docs-website-updateSkill
- grill-meSkill
- multi-version-complianceSkill
- nx-gradle-plugin-version-bumpSkill
- reproduce-issueSkill
- review-local-branchSkill
- review-many-prsSkill
- review-pending-pr-reviewsSkill
- review-prSkill
- run-nx-generatorSkill
- setup-review-sandboxSkill
- triage-issuesSkill
- triage-prsSkill
- triage-review-paneSkill
- update-cnw-templatesSkill
- author-migrationSkill
- check-docs-styleSkill
- deslopSkill
- dist-build-migrationSkill
- docs-website-updateSkill
- draft-security-advisorySkill
- grill-meSkill
- multi-version-complianceSkill
- nx-gradle-plugin-version-bumpSkill
- nx-multi-repo-migrateSkill
- reproduce-issueSkill
- review-local-branchSkill
- review-many-prsSkill
- review-pending-pr-reviewsSkill
- review-prSkill
- run-nx-generatorSkill
- setup-review-sandboxSkill
- triage-issuesSkill
- triage-prsSkill
- triage-review-paneSkill
- update-cnw-templatesSkill
- vitest-migrationSkill
- ci-monitorSkill
- nx-generateSkill
- nx-pluginsSkill
- nx-run-tasksSkill
- nx-workspaceSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 6
Read Codex execution conventions before following this workflow.
- Very specific: line 21
Use the available polygraph:polygraph skill to discover repos, select the org, and start (or join) the session.
- Very specific: line 62
Don't barrier on the slowest repo.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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/migrate-runs/<run-id>. Re-runningnx migrate --run-migrations(same env) resumes the same run instead of starting over — use this instead of re-migrating after a killed child.- If no
<nx_migrate_step>block appears (target older than23.2.0-beta.8, or the target version did not recognize the current agent environment and the classic loop ran), fall back to step 8.- Classic fallback — do NOT use
--create-commits. nx shells its--commit-prefix="chore(repo): [nx migration] "through/bin/shunescaped, and the(crashes it (Syntax error: "(" unexpected), which silently drops migrations. Instead run onenx migrate --run-migrationspass (apply the whole list, not a subset), then commit each migration's edits by hand, e.g.chore(repo): [nx migration] <name>(git commit -mhandles the parens fine). Then apply the AI migrations yourself — you are the agent nx defers them to.--run-migrationsapplies the deterministic codemods (importantlyremove-removed-typescript-eslint-extension-rules, which strips typescript-eslint v8-removed rules like@typescript-eslint/no-extra-semi; leaving one in a flat config crashes ESLint's loader → nx "Failed to process project graph" → red CI) AND writes prompt-only migrations totools/ai-migrations/**/*.md, printing "Next steps for the AI agent driving this run: apply the deferred prompts." That is addressed to you (the child) — read each prompt and make the described changes; do NOT leave them for a human. Honor each prompt's "passing baseline": keep lint/typecheck passing, never disable a rule the user explicitly configured, and disable a newly preset-enabled rule with a short comment rather than editing source to satisfy it. (nx auto-skipping its nested agentic flow inside an agent is the review skipping — NOT permission to skip the migrations.)- Verify before declaring done:
nx run-many -t lint --skip-nx-cachemust resolve the project graph and pass (the removed-rule crash only shows at graph-processing time), plus typecheck/build affected projects where feasible. Fix migration-introduced breaks; surface genuine framework-major incompatibilities (Angular/React/TS majors) for a human rather than hacking around them.- Delete
tools/ai-migrations/(classic path only — the orchestrated loop doesn't create it) andmigrations.json; leave.nx/migrate-runs/alone (gitignored scratch, kept for post-mortems). If migrations changed deps, re-install and commit the lockfile update.- Report: old→new version, packages bumped, which mode ran (orchestrated vs classic), deterministic migrations run (+ commits), each AI prompt and how you applied it (or why N/A, per handoff), any
--step-actionresolutions used, final lint/typecheck/build status, and any unresolved failures — type/name collisions, framework-major breaks. Leave true blockers for a human; do not invent workarounds.
Completing a partial / already-at-target run. If node_modules is already at the target, nx migrate <VERSION> finds zero migrations. To (re)apply migrations that a prior run skipped — the deterministic remove-removed-* codemod or the AI prompts — regenerate the full list with an explicit --from: nx migrate <VERSION> --from=nx@<original-version>. Migrations detect already-applied state and no-op, so this safely re-runs only what's missing, then finish with steps 7–11 above.
Package-manager cheat sheet:
| Lockfile | PM | run nx | install (mutable) |
package-lock.json | npm | npx nx | npm install |
yarn.lock (+ .yarnrc.yml) | Yarn Berry | yarn nx | yarn install (with YARN_ENABLE_IMMUTABLE_INSTALLS=false) |
bun.lock/bun.lockb | bun | bun nx | bun install |
pnpm-lock.yaml | pnpm | pnpm nx / pnpm exec nx | pnpm install --no-frozen-lockfile --config.confirm-modules-purge=false |
Migrations can rewrite source: a multi-beta jump (e.g. beta.23→beta.25) pulls migrations from every intervening version, so it may rewrite real code (e.g. CreateNodesContextV2→CreateNodesContext). The child should review the non-dep diff before committing. A single-beta jump on an already-current repo often legitimately has none.
3. Push + open a PR per repo, as each child finishes
Don't barrier on the slowest repo. The moment a child reports success, push_branch that repo (branch migrate-nx-<VERSION>) and create_pr for that repo alone — so its CI starts immediately and one slow repo (e.g. one stuck fighting the sandbox) doesn't gate the others:
for each repo, as its child reaches terminal success (not in a barrier):
push_branch(repo) → create_pr([repo])The PRs stay linked because they all join the same Polygraph session — the link is the session, not the single batched call. Commit-message scope repo passes nx's commitlint. Print the Polygraph session URL once all are open.
Verify once: a single batched
create_prwrites every PR body with its sibling cross-references at creation time; with incremental creation, confirm Polygraph back-fills the earlier PRs' bodies with links to the later ones (vs. each PR only linking to the session). If it doesn't back-fill and you need the in-body cross-links, fall back to one batchedcreate_prafter all children finish.
Verification checklist (per repo, before opening PRs)
package.jsonnx +@nx/*at the exact target version (not silently downgraded tolatestby an age gate)- Migrations ran (not skipped because
node_moduleswas already at target), including the deterministicremove-removed-*codemods - AI-migration prompts applied by the child (not just written): orchestrated runs have a success handoff per prompt step; classic runs have
tools/ai-migrations/applied then deleted.migrations.jsondeleted either way nx run-many -t lint --skip-nx-cacheresolves the project graph and passes; typecheck/build checked where feasible- Version-bump commit (
chore(repo): migrate to nx <VERSION>) plus onechore(repo): [nx migration] …commit per applied migration/prompt onmigrate-nx-<VERSION>(nx-authored in orchestrated mode, hand-made in classic — never both) - Orchestrated runs ended with the
completeblock — no step leftfailed/died/awaiting-prompt-outcome, and no unresolved commit-debt / failed-install warnings in it - Child reports verified against actual repo state (
git log,git status,git show --staton loop commits) — delegates can report steps as done that never ran, and a checkpoint commit can contain swept-in junk; a checkpoint whose only contents are junk is safe to drop (git reset --hardto the commit before it) when the run's migrations made no file changes - Any collision / compile / framework-major errors surfaced in the child's report for a human to resolve
Gotchas from real runs
These each cost real time on a live 5-repo run. Plan for them up front.
Fresh betas/canaries are hidden by release-age gates → silent downgrade to latest. A <24h-old target is filtered out by supply-chain age gates in up to three places on an nx-dev box: ~/.npmrc min-release-age=1 (npm/bun), ~/.config/pnpm/rc minimum-release-age=1440 (pnpm), and a ~/.yarnrc.yml registry pointed at a local age-gating proxy (http://localhost:7190) that is often down (→ ECONNREFUSED). When the target is filtered, nx migrate does not error — it silently resolves the whole @nx/* group to the newest visible version (e.g. latest 23.0.1 instead of 23.1.0-beta.5), so the repo "migrates" to the wrong version. Bypass per-command (do NOT edit global config): npm_config_min_release_age=0 npm_config_minimum_release_age=0 (npm/pnpm/bun), plus for Yarn Berry YARN_NPM_REGISTRY_SERVER=https://registry.npmjs.org/ YARN_NPM_MINIMAL_AGE_GATE=0. pnpm's nx-migrate temp-dir pnpm add also needs PNPM_CONFIG_STRICT_DEP_BUILDS=false (else ERR_PNPM_IGNORED_BUILDS aborts it). Always verify each repo landed on the exact target version, not latest. (Note: pnpm ignores the npm-style min-release-age key but honors its own minimum-release-age; that's why a pnpm repo may resolve the beta while a yarn/npm sibling silently downgrades.)
Package installation permissions. If an install fails with EPERM, reflink, or network errors, capture the failing operation and use the current runtime's approval mechanism when appropriate. Do not disable either the Codex or Polygraph sandbox, rewrite TLS settings, or relocate credentials to bypass a denial. Report an unresolved blocker for that repository and continue independent work.
The base can move after you start. Step 1 (branch from origin/<base>) handles the initial state, but the default branch can still advance mid-run — e.g. a separate version-bump PR merges underneath you, as happened when ocean's main jumped beta.23→beta.25 below an open migrate PR and turned it conflicting. Detect it with the behind-count (git rev-list --count migrate-nx-<V>..origin/<base>) and watch for open bump PRs; when the base moves, redo the branch onto the fresh base — only the repos whose base actually advanced need it. Redoing onto a newer base can also shrink the diff: a beta.25→rc.0 redo is dep-only, whereas the old beta.23→rc.0 ran 16 migrations and rewrote source.
The initiator repo runs in-place in your working dir, so migrating it switches branches and churns node_modules. Restore it afterward — or run its migration in a throwaway worktree off the real base (git worktree add -B migrate-nx-<V> /tmp/wt origin/<base>) so the working copy is never touched. But a fresh full install in the worktree duplicates the huge node_modules and can ERR_PNPM_ENOSPC (inode/disk pressure on top of the other clones' installs). Avoid it: run the nx migrate planning step in the main checkout (reuse its already-installed node_modules so migrate can bump the whole @nx/* group — without node_modules it only bumps nx itself), copy package.json+migrations.json onto the worktree branch, restore the main checkout; when there are no migrations to run, just pnpm install --lockfile-only in the worktree instead of a full install. Clean up the worktree with git worktree remove after pushing (the branch ref persists).
A concrete source collision. The CreateNodesContextV2→CreateNodesContext rename migration collided with a vendored local interface CreateNodesContext extends CreateNodesContextV2, producing a self-referential extends CreateNodesContext (TS2310). Surface it for a human; the minimal fix is aliasing the import: import { CreateNodesContext as NxCreateNodesContext } from '@nx/devkit'. (That rewrite is a beta.24 migration — starting from beta.25 skips it entirely.)
Push/auth pitfalls. (1) The SSH agent can drop mid-run (communication with agent failed) — SSH git push then fails; retry, or have the user re-ssh-add. (2) A read-only GH_TOKEN env var can shadow a write-capable keychain login: every write (push, pr edit, pr merge --auto) returns Resource not accessible by personal access token. Prefix gh writes with env -u GH_TOKEN to fall back to keychain auth. (3) Polygraph push_branch does an internal pull --rebase, so it cannot force-update a rebased branch — use a direct git push --force (SSH/HTTPS) for those. (4) Polygraph create_pr intermittently 401s (Bad credentials) on nrwl/nx specifically while succeeding on sibling nrwl repos in the same batch — just retry the failed repo; it usually goes through on the 2nd–3rd attempt. (5) The personal GH_TOKEN can push to nrwl/nx but is denied (403) on some other nrwl repos (e.g. nrwl/nx-examples) and cannot create PRs on nrwl/nx — so for those, use Polygraph push_branch/create_pr (backend auth), and since push_branch is fast-forward-only, prefer adding a new commit over amending when you need to update an already-pushed branch. nrwl/nx PR creation may still need the pushed-branch + pre-filled compare-URL fallback if create_pr keeps failing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

