Dependency upgrade
Goal
Bring dependencies up to date without leaving the project broken. A good result upgrades in small, tested batches, so any failure can be traced to one change, and reports what moved, what was deferred and why.
When to use
- The user asks to update packages or fix an audit warning.
- The user wants to move to a new major version of a library, framework or runtime tool.
- For a failure that appears after an upgrade and has no obvious cause, use
use_skill with debugging.
Steps
- Survey.
- Identify the package manager from lock files: package-lock.json (npm), pnpm-lock.yaml, yarn.lock, poetry.lock, uv.lock, requirements.txt, Cargo.lock, go.sum, Gemfile.lock, composer.lock.
- List outdated packages with the manager's command via
run_command (npm outdated, pnpm outdated, pip list --outdated, cargo outdated if installed, go list -u -m all).
- List known vulnerabilities (
npm audit, pip-audit, cargo audit) when available.
- Run
git_status to confirm the working tree is clean, and run the tests before starting, so failures can be attributed.
- Plan with
update_plan, lowest risk first:
- Patch and minor updates of non-core packages.
- Security fixes.
- Each major upgrade on its own, especially frameworks, build tools, test runners and type definitions.
- For each major upgrade:
- Read the official changelog or migration guide (
read_url when web access is available) and list the breaking changes that affect this project. Use rg for the APIs involved.
- Upgrade that package, and its companions such as a framework's plugins, only.
- Apply the required code changes with
edit_file, following the migration guide and any official codemod.
- Run install, type check, lint, build and tests with
run_command. Fix failures before moving on.
- If an upgrade gets stuck, revert that package and report why, instead of leaving the project broken.
Gotchas
- Never delete the lock file to "fix" things. Commit lock file changes together with manifest changes.
- Do not upgrade across a major version the user did not ask for without checking with them through
ask_user.
- Respect engine and runtime constraints (Node, Python version) and peer dependencies.
- Upgrading everything at once makes a failing test impossible to pin on one package.
- Starting from a red test suite hides which failures you caused. Get a green baseline first.
Output
A table of package, old version, new version, and notes (breaking changes handled), then what was deferred and why, and the test results.
1---2name: dependency-upgrade3description: Upgrades project dependencies safely. Finds outdated and vulnerable packages, reads changelogs for breaking changes, upgrades in small batches, fixes the code and runs the tests after each batch. Use when the user wants to update packages, fix vulnerable dependencies, or move to a new major version of a library or framework.4metadata:5 source: https://skillmd.com/skills/lucki74/dependency-upgrade6---78# Dependency upgrade910## Goal1112Bring dependencies up to date without leaving the project broken. A good result upgrades in small, tested batches, so any failure can be traced to one change, and reports what moved, what was deferred and why.1314## When to use1516- The user asks to update packages or fix an audit warning.17- The user wants to move to a new major version of a library, framework or runtime tool.18- For a failure that appears after an upgrade and has no obvious cause, use `use_skill` with `debugging`.1920## Steps21221. Survey.23 - Identify the package manager from lock files: package-lock.json (npm), pnpm-lock.yaml, yarn.lock, poetry.lock, uv.lock, requirements.txt, Cargo.lock, go.sum, Gemfile.lock, composer.lock.24 - List outdated packages with the manager's command via `run_command` (`npm outdated`, `pnpm outdated`, `pip list --outdated`, `cargo outdated` if installed, `go list -u -m all`).25 - List known vulnerabilities (`npm audit`, `pip-audit`, `cargo audit`) when available.26 - Run `git_status` to confirm the working tree is clean, and run the tests before starting, so failures can be attributed.272. Plan with `update_plan`, lowest risk first:28 1. Patch and minor updates of non-core packages.29 2. Security fixes.30 3. Each major upgrade on its own, especially frameworks, build tools, test runners and type definitions.313. For each major upgrade:32 - Read the official changelog or migration guide (`read_url` when web access is available) and list the breaking changes that affect this project. Use `rg` for the APIs involved.33 - Upgrade that package, and its companions such as a framework's plugins, only.34 - Apply the required code changes with `edit_file`, following the migration guide and any official codemod.35 - Run install, type check, lint, build and tests with `run_command`. Fix failures before moving on.364. If an upgrade gets stuck, revert that package and report why, instead of leaving the project broken.3738## Gotchas3940- Never delete the lock file to "fix" things. Commit lock file changes together with manifest changes.41- Do not upgrade across a major version the user did not ask for without checking with them through `ask_user`.42- Respect engine and runtime constraints (Node, Python version) and peer dependencies.43- Upgrading everything at once makes a failing test impossible to pin on one package.44- Starting from a red test suite hides which failures you caused. Get a green baseline first.4546## Output4748A table of package, old version, new version, and notes (breaking changes handled), then what was deferred and why, and the test results.