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:| Criterion | Question | Red flag |
|---|---|---|
| Necessity | Can stdlib or existing deps do this? | Adding a package for 10 lines of code |
| Maintenance | Last commit? Issue/PR response time? | 12+ months inactive, unanswered issues |
| Community | Weekly downloads, stars, forks? | Very low usage, single maintainer |
| License | Compatible with project license? | GPL in a commercial project (license contamination) |
| Size | Bundle size? Transitive dependency count? | Massive dep tree for a small task |
| Security | Known CVEs? Clean audit? | Active security vulnerabilities |
| Alternatives | Better or lighter alternative available? | Picking the first result without evaluating |
Updating existing packages
| Update type | Strategy | Risk |
|---|---|---|
| Patch (x.x.Z) | Update immediately, run test suite | Low |
| Minor (x.Y.0) | Read changelog, update, test | Medium |
| Major (X.0.0) | Breaking change analysis, migration plan, test on separate branch | High |
Update patch versions
Update all patch versions at once. Run the full test suite. If passing, commit.
Update minor versions one by one
Update one minor version, run tests after each. Do not batch minor updates.
Security urgency matrix
| Severity | Exploit exists? | Action | Timeframe |
|---|---|---|---|
| Critical | Yes | Update immediately or apply workaround | Hours |
| Critical | No | Priority update | 1–2 days |
| High | — | Update within sprint | 1 week |
| Medium/Low | — | Add to next update cycle | Planned |
- 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
| Mistake | Reality |
|---|---|
| ”Popular package is safe” | Popularity does not equal security. event-stream was compromised at 2M weekly downloads. |
| ”Lockfile commit is unnecessary” | Without a lockfile, builds are not reproducible. |
| ”Update everything at once” | Batch updates make it impossible to isolate the source of a breakage. |
| ”Major update is just a version number” | Breaking change = potential refactoring required. |
| ”Dev dependency security doesn’t matter” | Supply chain attacks target build processes. |
| ”Add a package instead of writing 10 lines” | Every package adds attack surface and maintenance burden. |
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.