author-migration

Author or scope a first-party Nx migration. Use whenever code removes, renames, or deprecates an option/flag/executor/generator-schema field, changes a default, or bumps a dependency, and someone asks whether existing workspaces need a migration so they don't break on `nx migrate`/upgrade. Covers writing the colocated update-VER/NAME.{ts,spec.ts,md} set, the migrations.json entry (version, requires, implementation, prompt, documentation) or packageJsonUpdates group, and the AI-agent prompt/runbook .md for prompt-only or hybrid (generator + prompt) migrations. Also covers porting an upstream framework's own migrations into Nx. Invoke BEFORE writing, fixing, or editing any migration, migration prompt/runbook, or packageJsonUpdates group, and before concluding a breaking change needs no migration at all.

Install
npx skills add 'https://github.com/nrwl/nx/tree/master/.claude/skills/author-migration'
Download bundle ↓
master · 646e806Scanned 2026-09-17

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗
View on GitHub
← Back to SKILL.md

Prompt .md template (runbook genre)

For files wired as prompt. These are executed by an AI agent during agentic migration runs; write them as an operator runbook, not as documentation. Exemplars: packages/react/src/migrations/update-23-1-0/ai-instructions-for-react-19.md (whole-framework upgrade), packages/eslint/src/migrations/update-23-1-0/migrate-ban-types-rule.md (scoped task with a no-op guard).

Structure:

# <Thing> Migration Instructions for LLM

## Overview

One paragraph: what changed upstream, what this migration accomplishes, and what
is out of scope.

## Pre-Migration Checklist

Preconditions to confirm before changing anything. For scoped tasks this is a hard
no-op guard: "Confirm both conditions before changing anything. If either fails,
make no changes and stop."

1. <condition, with the exact command or file check to run>
2. <condition>

## Step 1: <action>

Concrete instructions. Show code shapes:

**Before:**

```ts
<before>
```

**After:**

```ts
<after>
```

## Step 2: <action>

...

## Post-Migration Validation

Concrete commands and the loop to run them until green:

1. `npx nx run-many -t build,test,lint -p <affected projects>`
2. Fix failures caused by this migration and re-run until green.
3. <manual checks that commands cannot cover>

## Nx-Specific Notes

Anything about executors, inferred targets, or workspace layout the upstream guide
does not cover.

Rules:

  • Shipped exemplars predate this template and vary their heading names; match the elements (the guard, stepwise before/after, the validation loop, explicit scope), not the exact headings.
  • Hybrid prompts additionally instruct the agent to verify (not redo) the deterministic pre-pass: review the changed files, and treat every advisory-context item as pending work.
  • When upstream publishes an npx-runnable codemod, instruct the agent to run it and verify the result rather than reimplementing the transform.
  • Scope statements are load-bearing: state explicitly what the agent must not touch.
  • The filename must differ from any implementation basename in the same directory (the documentation .md owns that name; SKILL.md section 4).
Referenced from SKILL.md