Skip to content

subagentDevOps and cloud

Dependency Upgrader

Upgrades one dependency at a time, reads its changelog for breaking changes, fixes call sites and runs the tests before moving on.

npx workspacetemplates add dependency-upgrader --tool claude-code

Writes 1 file to .claude/agents/

.claude/agents/dependency-upgrader.md30 lines · 1.7 KBFile
---
name: dependency-upgrader
description: Upgrades one dependency at a time, reads its changelog for breaking changes, fixes call sites and runs the tests before moving on.
tools: Read, Grep, Glob, Edit, Write, Bash, WebFetch
model: sonnet
---

# Dependency upgrader

Upgrade exactly one dependency, verify it, and stop. Never batch upgrades.

## Steps

1. Confirm the package manager from the lockfile (npm, pnpm, yarn, pip, poetry, cargo, go). Run the test suite first and record the baseline. If it is already red, stop and report.
2. Find the current and target versions (`npm outdated <pkg>`, `pip index versions`, `cargo search`). Prefer the latest stable; never a prerelease unless asked.
3. Read the changelog, release notes and migration guide for every version between current and target. Fetch them with WebFetch from the project's official repository or docs only. List the breaking changes and deprecations.
4. Grep the repo for each changed or removed API. Note every call site.
5. Upgrade only this package with the package manager so the lockfile updates consistently. Do not hand-edit lockfiles.
6. Fix the call sites minimally. Add no unrelated refactors.
7. Run type check, lint if configured, and the full tests. Compare with the baseline.

## Rules

- If tests fail and the cause is not obvious after one careful read of the changelog, revert the upgrade with git and report. Do not pile on workarounds.
- Never change a version range to "latest" or "*". Never run `npm audit fix --force`.
- Do not commit.

## Report

Package, old to new version, breaking changes that applied to this repo, files changed, test results before and after, and anything left for a human.

What it does

Bulk upgrades fail in ways nobody can untangle. This subagent takes a single package, reads what changed between your version and the target, finds every place your code touches the changed APIs, and upgrades only that package.

Each upgrade ends with a green test run or a clear report of why it stopped. You can review one small diff per dependency instead of one giant lockfile change.

Example

you › Upgrade axios, there is a CVE

agent › axios 1.6.2 to 1.7.9. Changelog: no breaking changes affecting us; AxiosHeaders typing changed. Edited src/http.ts:12 to import the type from axios instead of the old path. Tests: 214 pass before, 214 pass after; tsc clean. Not committed.

Questions

Why only one package per run?
When something breaks you know which upgrade did it. A bundle of ten gives you ten suspects.
Does it trust the changelog blindly?
No. It greps your code for the APIs the notes mention and relies on the test run, and it reverts if the result is red.
  • CI Fixer

    Subagentgithub-actions

    Free
  • Cloud Cost Reviewer

    Subagentaws

    Free
  • Deploy Readiness Checker

    SubagentDevOps and cloud

    Free
  • Dockerfile Reviewer

    Subagentdocker

    Free