deps-minor
Safe minor dependency updates with validation (lint/test/build) and automatic rollback on failure.
When & Why to Use This Skill
This Claude skill automates the maintenance of Node.js projects by performing safe minor dependency updates. It enhances project stability by integrating a mandatory validation pipeline—comprising linting, testing, and building—and features an intelligent rollback mechanism that reverts changes if any quality gate fails, ensuring a reliable and evergreen codebase.
Use Cases
- Automated Dependency Maintenance: Streamline the routine task of keeping npm packages up-to-date with the latest minor versions to benefit from security patches and performance improvements.
- Regression Prevention: Protect the codebase from breaking changes by automatically validating every update batch against existing test suites and build requirements before finalization.
- Selective Package Management: Safely manage updates in complex environments by excluding specific sensitive packages (like UI frameworks or internationalization libraries) from the automated update process.
- Batch Update Optimization: Improve developer productivity by processing dependency updates in controlled batches, reducing the overhead of manual version checking and individual package testing.
| name | deps-minor |
|---|---|
| description | Safe minor dependency updates with validation (lint/test/build) and automatic rollback on failure. |
Purpose
Perform safe minor npm dependency updates for the current project.
Run validation (lint → test → build) after each update, and revert if any step fails.
No major updates are performed.
Scope
- Operates on both
dependenciesanddevDependencies. - Updates only minor versions (
x.X.x). - No git operations.
- Excludes i18next* and storybook* packages.
Process
- Discovery
- Run:
ncu --target minor --jsonAll - Filter out:
- Any package containing
i18next,18next, orstorybook
- Any package containing
- Run:
- Batch Update
- Update in batches of ≤8 packages:
ncu -u <pkg-list> --target minor npm install --no-audit --no-fund
- Update in batches of ≤8 packages:
- Validation
- Run (if present):
npm run lint npm run test npm run build - If any step fails:
- Revert last batch changes using backup copy.
- Log failure and skip problematic packages.
- Run (if present):
- Reporting
- Output summary with:
- Updated packages
- Skipped packages
- Validation results
- Remind user: “No git operations were performed.”
- Output summary with:
Tool Permissions
- Bash: run shell commands
- Read: inspect
package.json, test scripts - Write: modify
package.json,package-lock.json
Safety
- Always back up
package.jsonandpackage-lock.jsonbefore updates. - Never touch excluded packages.
- Stop on first failed batch.