When this skill fires
The skill description reads: “Use when adding new dependencies, deciding whether to update packages, running security audits on dependencies, evaluating library alternatives, or encountering outdated or vulnerable packages.” Specific triggers:- Adding a new package or library to a project
- Security audit warnings (
npm audit,pip-audit,cargo audit, etc.) - Batch dependency update time
- Major version upgrade decisions
- Choosing between alternative libraries
- Lockfile merge conflicts
- Questioning whether a package is still maintained
- Internal module or code organization (that’s refactoring)
- Learning a single package’s API (that’s research)
What it does
The skill applies structured decision trees to four types of dependency work: adding a new package, updating an existing one, responding to security alerts, and removing a package. Each path has specific criteria and workflows.Adding a new package
Evaluate every new dependency against all seven criteria:
Rule: If a package fails two or more criteria, find an alternative or write it yourself.
Updating existing packages
Workflow for batch updates:
1
Update patch versions
Update all patch versions at once. Run the full test suite. If passing, commit.
2
Update minor versions one by one
Update one minor version, run tests after each. Do not batch minor updates.
3
Tackle major versions individually
Each major version gets its own feature branch. Perform breaking change analysis and write a migration plan before updating.
Security urgency matrix
When a security audit reports vulnerabilities:
- Run the audit tool for your ecosystem
- Classify each finding using the matrix above
- Address critical and exploitable issues before any other work
- Document accepted risks for findings you cannot immediately resolve
Lockfile and pinning rules
- Always commit lockfiles (
package-lock.json,yarn.lock,poetry.lock,Cargo.lock) - Pin exact versions for production application dependencies
- Use ranges only for libraries (not applications)
- Never manually edit lockfiles — use package manager commands
- After resolving lockfile merge conflicts, always run install to regenerate
Removing a dependency
Before removing any package:- Search the codebase for all imports and usages
- Check whether other dependencies rely on it transitively
- Remove the import statements and package reference, then run the full test suite
- Verify the lockfile is cleanly regenerated after removal
Common mistakes
Example scenario
You receive:npm audit found 2 vulnerabilities (1 critical, 1 moderate).
The dependency-management skill fires. The agent:
- Runs
npm audit --jsonto get full details on both vulnerabilities - Classifies: critical vulnerability in
lodash(prototype pollution, exploit exists) — action: update immediately; moderate indebug(ReDoS, no known exploit) — add to next update cycle - Updates
lodashon its own branch, runs full test suite, confirms passing - Documents the moderate vulnerability as accepted risk with a note for the next update cycle
- Commits the
lodashupdate with: “security: update lodash to 4.17.21 (prototype pollution CVE-2021-23337)“
Related skills
Security review
Covers OWASP A06 (vulnerable and outdated components) as part of the full security checklist.
Systematic debugging
When a dependency update introduces a regression, systematic debugging governs how to isolate it.
Verification before completion
Confirms dependency changes do not break the build before marking the update complete.