/SKILL.md
AI-assisted migration and upgrade of npm packages. Handles breaking changes between major versions, deprecation cleanup within minor versions, adopting new APIs and patterns, security-driven upgrades from npm audit, and full dependency replacement (swapping one package for another, e.g. moment → dayjs). Analyzes changelogs, git diffs, and docs, scans your codebase for actual usage, cross-references to find what's affected, generates targeted code fixes or codemods, and verifies with your test suite. Use this skill whenever a user mentions upgrading, migrating, or updating npm packages, dealing with breaking changes, fixing deprecation warnings, replacing a dependency with an alternative, adopting new APIs from a package update, running npm audit fix with code changes, or comparing what changed between package versions. Trigger phrases include: "upgrade axios to v2", "migrate to express 5", "replace moment with dayjs", "fix deprecation warnings", "npm audit says vulnerable", "adopt the new API", "what changed between version X and Y", "swap lodash for es-toolkit", "help me upgrade my dependencies", "clean up deprecated calls".
npx skillsauth add alejandrorv/npm-migrate npm-migrateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
AI-assisted migration of npm packages: major version upgrades, deprecation cleanup, new API adoption, security-driven updates, and full dependency replacement. Analyzes what changed, scans your codebase, and generates targeted fixes.
Follow these steps in order for every migration request:
Determine what kind of migration this is:
| Type | Example | Key difference | |------|---------|---------------| | Major upgrade | express 4 → 5 | Breaking changes, must fix | | Minor/patch upgrade | react 18.2 → 18.3 | Deprecation cleanup, optional but recommended | | Deprecation cleanup | Remove deprecated APIs within same major | Proactive, avoids future breakage | | Feature adoption | Adopt React Server Components | New patterns, not strictly required | | Security fix | npm audit vulnerability | Urgency varies, may require code changes | | Dependency swap | moment → dayjs, enzyme → testing-library | Map old API to new package's API |
Then determine the package(s), source version, and target version (or replacement).
# Read current version from package.json
cat package.json | jq '.dependencies["<package>"] // .devDependencies["<package>"]'
# If upgrading: find latest major
npm view <package> version
# If swapping: check the replacement package
npm view <new-package> version
# If security: check what npm audit recommends
npm audit --json | jq '.vulnerabilities["<package>"]'
If the user says "upgrade X" without specifying versions, detect the current version from package.json and target the latest major.
If the user says "replace X with Y", treat it as a dependency swap — the intelligence gathering step will focus on API mapping between the two packages.
Read references/intelligence-gathering.md for the full procedure.
Collect migration data from multiple sources in this priority order:
For version upgrades (major, minor, patch):
For dependency swaps (replacing one package with another):
For security-driven upgrades:
Read references/codebase-analysis.md for the full procedure.
Scan the project to build a usage map of the package being migrated:
Read references/peer-dependencies.md to check for peer dependency conflicts
before planning changes. If the upgrade triggers cascading peer dependency
updates, document the full chain and present it to the user first.
Match the breaking changes (or API differences for swaps) found in Step 2 against the usage map from Step 3. Categorize each item as:
| Category | Meaning | Action |
|----------|---------|--------|
| AFFECTED | User's code uses a changed/removed API | Must fix |
| SAFE | Change exists but user doesn't use it | No action |
| REVIEW | Behavioral change that may affect user subtly | Manual review |
| DEPRECATED | Still works but will break in next major | Recommend fix |
| NO_EQUIVALENT | Used API has no direct replacement (swaps only) | Needs workaround or custom code |
| SECURITY | Vulnerable code path in user's usage | Priority fix |
Read references/migration-patterns.md for common transformation patterns.
For each AFFECTED item, generate the fix. Prefer this order:
references/codemod-generation.md for templates and patterns)# For version upgrades:
npm install <package>@<target-version>
# For dependency swaps:
npm uninstall <old-package>
npm install <new-package>
Run the post-migration verification script to check everything at once:
# For version upgrades:
node <skill-path>/scripts/post-migration-verify.mjs --package <package>
# For dependency swaps (also checks old package is fully removed):
node <skill-path>/scripts/post-migration-verify.mjs --package <new-package> --swap-from <old-package>
The script automatically detects and runs: dependency resolution, TypeScript compilation, test suite, linter, build, old package removal check (swaps), and deprecation warning detection. It outputs a JSON report.
If the verification script is not available, run these checks manually:
npm test
npx tsc --noEmit # if TypeScript
npm run lint # if linter configured
npm run build # if build script exists
Report results with a summary table:
Migration Summary: <package> v<from> → v<target>
─────────────────────────────────────────────────
✅ Automated fixes applied: X
⚠️ Manual review required: Y
ℹ️ No action needed: Z
❌ Failed transformations: W
REVIEW rather than auto-fixing.Every migration output should include:
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.