Skip to main content
skill CX Codex

updating-npm-package — Claude Code skill: what it does, how to install

Updates npm dependencies safely by checking npmjs.com and adapting to the version jump. It runs tests on minor updates and finds migration guides for major ones.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add spencerpauly/awesome-cursor-skills --skill updating-npm-package -a claude-code
Open on GitHub

What updating-npm-package does

The skill guides the agent through dependency updates in Node.js projects. First, it identifies the installed package version with npm ls and queries npm registry tags using npm view. Update flows differ by SemVer level. For patch and minor bumps, the agent runs npm install and verifies everything with npm run build && npm test.

Major releases get an in-depth migration pass. The agent searches for CHANGELOG.md, finds official upgrade guides, and inspects imports with grep. Code changes are applied file by file. Validation requires the whole suite: linting, type-checking via npx tsc --noEmit, unit tests, and the project build.

When automated codemods like npx @next/codemod exist, the skill prefers them over manual edits. In monorepos, updating a package in only one workspace breaks workspace consistency, so all workspaces must be updated together. The agent also inspects peer dependency warnings and records final changes in package-lock.json.

What it helps with

  • Check available package versions and latest dist-tags on npmjs.com
  • Identify breaking changes and upgrade guides for major version jumps
  • Scan imports across the codebase to locate affected functions
  • Verify the upgrade using linter, typecheck, tests, and build scripts

Example prompts for the agent

  • Update react to the latest version and run the tests
  • Upgrade next to the latest major version and follow the migration guide
  • Bump zod in package.json and fix breaking changes across the codebase

How to install updating-npm-package

1Skills CLI (Vercel)

npx skills add spencerpauly/awesome-cursor-skills --skill updating-npm-package -a claude-code

2Manually: put the files in place

~/.claude/skills/updating-npm-package/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/updating-npm-package/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about updating-npm-package

How do I install updating-npm-package in Claude Code?

Run npx skills add spencerpauly/awesome-cursor-skills --skill updating-npm-package -a claude-code. This command downloads and registers the skill for Claude Code.

What does updating-npm-package do?

It automates npm dependency updates. The skill checks SemVer versions, finds breaking changes and migration guides for major upgrades, and runs project validation.

How does the skill handle minor versus major updates?

For patch and minor updates, it installs the package and runs tests and the build. For major updates, it finds migration guides, scans imports with grep, resolves breaking changes, and generates a migration report.

Source text

SKILL.md · CC0-1.0
---
name: updating-npm-package
description: Safely update an npm package by checking npmjs.com for the latest version, reading release notes, and handling minor vs major upgrades differently. For minor updates, just do it. For major updates, find the upgrade guide, validate breaking changes, and produce a detailed migration report.
---

# Updating an npm Package

Use this skill when the user asks to update, upgrade, or bump a specific npm dependency.

## Steps

1. **Check the current version** — read `package.json` to find the installed version:

   ```bash
   npm ls <package-name>
   ```

2. **Find the latest version on npm** — fetch the package info:

   ```bash
   npm view <package-name> versions --json
   npm view <package-name> dist-tags --json
   ```

   This gives you the `latest` tag and all published versions.

3. **Determine the update type** — compare current version to latest:
   - **Patch** (1.2.3 → 1.2.4): bug fixes only
   - **Minor** (1.2.3 → 1.3.0): new features, backwards compatible
   - **Major** (1.2.3 → 2.0.0): breaking changes

4. **For patch or minor updates** — just do it:

   ```bash
   npm install <package-name>@latest
   ```

   Run the build and tests to make sure nothing broke:

   ```bash
   npm run build && npm test
   ```

   If everything passes, commit and report what changed.

5. **For major updates** — do a thorough investigation first:

   a. **Fetch the changelog and release notes** — check the package's GitHub repo for `CHANGELOG.md`, `MIGRATION.md`, or release notes. Use the web to find the official upgrade guide:

   ```
   Search: "<package-name> v<major> migration guide" OR "<package-name> v<major> upgrade guide"
   ```

   b. **Read the breaking changes** — identify every breaking change between the current and target version. Common things to check:
   - Removed or renamed APIs
   - Changed function signatures or return types
   - Dropped Node.js version support
   - New peer dependency requirements
   - Changed default behavior
   - Config file format changes

   c. **Scan the codebase for impact** — search for every usage of the package:

   ```bash
   # Find all imports
   grep -r "from ['\"]<package-name>" src/
   grep -r "require(['\"]<package-name>" src/
   ```

   For each usage, check if it's affected by a breaking change.

   d. **Apply the update**:

   ```bash
   npm install <package-name>@latest
   ```

   e. **Fix breaking changes** — update each affected usage based on the migration guide. Apply changes file by file.

   f. **Verify** — run the full suite:

   ```bash
   npm run lint && npx tsc --noEmit && npm test && npm run build
   ```

   g. **Produce a migration report** — summarize:

   ```markdown
   ## Package Update: <package-name> v<old> → v<new> (Major)

   ### Breaking Changes Applied
   - `oldFunction()` renamed to `newFunction()` — updated in 3 files
   - Config format changed from `.js` to `.config.ts` — migrated
   - Dropped support for Node 16 — verified we're on Node 20

   ### Files Modified
   - src/lib/client.ts — updated import and function call
   - src/config/settings.ts — migrated config format
   - package.json — bumped version

   ### Validation
   - ✅ Lint passes
   - ✅ TypeScript compiles
   - ✅ All 47 tests pass
   - ✅ Build succeeds
   ```

## Notes

- Always check peer dependency compatibility before updating — `npm install` will warn about mismatches.
- For monorepos, check if the package is used in multiple workspaces and update them all together.
- If the package has a codemod tool (e.g. `npx @next/codemod`), use it instead of manual migration.
- Lock file (`package-lock.json`) changes are expected — commit them with the update.

© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills

Similar skills

Everything for Frontend and UI →

From the same set59

verifying-markdown-formatting Walks a Markdown file through a formatting checklist and fixes what it finds: headings, lists, links, code blocks, spacing. Useful before committing a README or docs. CX Codex +1 404installs exporting-to-png Teaches the agent to render code snippets, Mermaid diagrams, terminal logs, and SVG files into PNG images via CLI utilities or headless browsers. CX Codex +1 401installs parallel-ci-triage Splits failed GitHub Actions jobs across parallel subagents, each fixing its own slice. Useful when CI breaks in several places at once. CX Codex +1 403installs screenshotting-changelog Builds a visual changelog for a pull request: captures pages before and after your UI edits and drops the image pairs into the PR body. CX Codex +1 401installs react-native-patterns This skill guides an agent building React Native and Expo apps, covering navigation, platform-specific code, styling, lists, and native modules. CX Codex +1 399installs adding-docker This skill writes a Dockerfile, docker-compose setup and .dockerignore for your app. Useful when you want a container without hand-writing the configs. CX Codex +1 398installs fixing-broken-links This skill scans project files for dead URLs and broken local paths, verifies responses with curl, and repairs or removes missing links. CX Codex +1 393installs converting-css-modules-to-tailwind Moves one component off CSS Modules and onto Tailwind utility classes, then removes the module file and its import. CX Codex +1 392installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor