| name | dependency-upgrade |
| description | Upgrade all dependency versions across the monorepo. Use when the user wants to bump dependency versions (major, minor, or patch) and verify the repository still works after the changes. |
Dependency Upgrade
This skill automates the process of upgrading dependencies across a monorepo, following a safe, group-based iterative approach with automated verification.
Process
1. Validate Input & Environment
- Ensure a version bump type (
patch, minor, major) is specified.
- Confirm the git working directory is clean (recommended).
- Display: "Starting [version-type] dependency upgrades..."
2. Analyze & Group Dependencies
- Refer to dependency-groups.md for logical groupings.
- Scan
package.json files in the root, /apps/*, /packages/*, and the catalog in pnpm-workspace.yaml.
- For each group, list:
- Package names.
- Current versions.
- Total package count.
3. Iterative Processing
For each dependency group:
3.1 Fetch Latest Versions
- Query the npm registry for the latest version matching the requested bump type, filtering by semver rules.
- Use:
npm view {package-name} versions --json
- Display the planned upgrade:
{package-name}: {current} → {latest}, or note if the package is already at the latest version.
3.2 Update Files
- Apply updates to:
pnpm-workspace.yaml (catalog section)
- Root and workspace
package.json files.
- Handle direct versions and
"catalog:" references correctly.
3.3 Install & Verify
- Run
pnpm install.
- Execute the verification suite sequentially:
pnpm run lint
pnpm run check-types
pnpm run test
pnpm run build
- If any check fails:
- Display error output.
- Offer options: Rollback group and continue, Stop and investigate, or Skip verification (risky).
3.4 Summary
- Display: "✓ Group {group-name} upgraded successfully."
4. Final Summary Report
Best Practices
- Iterate: Never upgrade all groups at once. Verify each group before proceeding.
- Rollback: If a group fails verification, revert the changes for that group's packages before moving to the next.
- Manual Fixes: Be prepared for manual code changes, especially with
major upgrades.
- Review Changes: This skill modifies files but does not create git commits. Review all changes with
git diff before committing them.