Dependency Auditor
When to activate
Invoke this skill when you need to:
- Scan project dependencies for known security vulnerabilities (CVEs)
- Identify outdated or stale packages in the dependency tree
- Detect license incompatibilities or problematic licenses
- Reduce dependency bloat and redundant transitive dependencies
- Verify dependency versions are locked and reproducible
- Check for supply-chain risks (unmaintained packages, deprecated modules)
- Analyze the health of critical dependencies (activity, maintainer count, issue backlog)
- Generate quarterly dependency audit reports with upgrade recommendations
When NOT to use
Do not use this skill for:
- General package management or routine updates (use native package managers: npm, pip, cargo)
- Debugging broken imports or runtime errors (use code-review or debugging workflow)
- Performance optimization unrelated to dependency size (use profiler)
- Choosing between similar packages without security or maintenance concerns (use architecture review)
- Daily/weekly checks (run annually or when drift becomes concerning; use CI/pre-commit for continuous scanning)
Instructions
Core Audit Steps
Identify the package manager and lock file
- Detect ecosystem: npm/yarn (JavaScript), pip/poetry (Python), cargo (Rust), bundler (Ruby), composer (PHP)
- Locate lock file:
package-lock.json, yarn.lock, poetry.lock, Cargo.lock, Gemfile.lock, composer.lock
- Verify lock file exists and is reasonably recent (not stale >6 months)
Run security vulnerability scan
- npm:
npm audit --audit-level=moderate for all vulnerabilities; optionally npm audit fix with caution
- Python:
pip-audit (recommended), safety check, or bandit for code-level risks
- Cargo:
cargo audit
- Ruby:
bundle audit
- Report CVEs by severity (critical, high, moderate, low), include CVE ID and remediation path
Check for outdated dependencies
- npm:
npm outdated to show major/minor/patch version gaps
- Python:
pip list --outdated
- Cargo:
cargo outdated
- Categorize by risk: patch-safe (low risk) vs. minor (medium) vs. major (breaking changes)
Analyze transitive dependencies
- Identify which direct dependencies pull in problematic transitive dependencies
- Use
npm ls <package> or equivalents to trace dependency paths
- Flag duplicate versions of the same package (e.g., two versions of lodash in tree)
- Recommend consolidation where possible
License compliance check
- npm:
npm ls --depth=0 with manual review; use npx license-checker for full tree
- Python:
pip-licenses
- Identify restrictive licenses: GPL, AGPL, SSPL that may infect your codebase
- Check for incompatibilities with your project's license
- Flag copyleft licenses or unusual restrictions
Supply-chain risk assessment
- Check package registry metadata: unmaintained status, maintainer count, last publish date
- npm:
npm view <package> to inspect time, dist-tags, repository
- Look for unusual patterns: recent ownership transfer, sudden spike in releases, abandoned projects
- Check GitHub/GitLab repo: last commit date, issue backlog, maintainer activity
- Flag packages with fewer than 2 active maintainers for critical dependencies
Dependency size and bloat analysis
- npm:
npm ls --all (full tree) vs. npm ls --depth=0 (direct only)
- Check bundle impact:
npm run bundle-size or equivalent
- Identify unnecessarily large packages (e.g., moment.js vs. date-fns)
- Find unused dependencies with tools like
depcheck or npm ls --all unused analysis
- Recommend lighter alternatives where applicable
Lock file integrity
- Ensure lock file is committed and up-to-date with package.json
- Warn if lock file is stale (> 30 days behind package.json changes)
- Check for conflicts or manual edits in lock file
Tool Commands by Ecosystem
Node.js / npm:
npm audit --audit-level=moderate
npm audit fix # Apply safe fixes (use with caution)
npm outdated
npm ls --depth=0 # Direct dependencies only
npm ls <package> # Trace specific package path
npm view <package> # Check metadata, maintainers, last publish
npx depcheck # Find unused dependencies
npx license-checker # List all licenses in tree
npm ls --all | grep "deduped" # Find duplication
Python / pip:
pip-audit # Security audit
pip list --outdated
pip show <package> # Check version, dependencies, maintainer
pipdeptree # Visualize full dependency tree
pip-licenses # Check all licenses
Rust / Cargo:
cargo audit
cargo outdated
cargo tree # Visualize dependency tree
cargo metadata --format-version 1 # Full dependency graph
Ruby / Bundler:
bundle audit
bundle outdated
bundle viz # Visualize dependency graph (requires graphviz)
Reporting Structure
Present audit results in this prioritized order:
Critical Issues (must fix immediately)
- CVEs with CVSS >= 7.0 or exploitable vulnerabilities
- Unmaintained packages in critical paths (auth, payments, data handling)
- Breaking version mismatches that prevent installation
Actionable Upgrades (schedule for next sprint)
- Security patches and minor updates that fix known issues
- Deprecated packages with recommended replacements
- License incompatibilities
Transitive Bloat (nice to have, improves tree health)
- Unused dependencies
- Redundant versions that should consolidate
- Oversized packages with lighter alternatives
Supply-Chain Health (informational)
- Packages with few maintainers
- Deprecated modules still in use
- Unusual activity patterns
Recommendations & Next Steps
- Timeline for critical fixes
- Breaking changes to plan for
- Long-term dependency health strategy
Output Format
# Dependency Audit Report — [Project Name] — [Date]
## Summary
- Total dependencies (direct): [X]
- Total dependencies (with transitive): [X]
- Outdated packages: [X] (>1 version behind)
- Security vulnerabilities: [X] (critical: Y, high: Z)
- Deprecated packages: [X]
- License conflicts: [X]
## Critical — MUST FIX NOW
### Security Vulnerabilities
- **[Package] [current-version] → [safe-version]**
- CVE-2024-XXXXX: [Description]
- CVSS Score: [X.X]
- Path: [dependency chain]
- Action: npm update [package] or npm install [package]@[version]
### Unmaintained or Abandoned
- **[Package] [current-version]**
- Last update: [date]
- Recommended alternative: [package]
- Action: Plan migration in next sprint
## High — Schedule for Next Sprint
### Major Version Upgrades
- **[Package] [current] → [next-major]**
- Breaking changes: [summary]
- Migration effort: [estimated hours]
- Benefit: [security/features/performance]
### Deprecated Packages
- **[Package]** is deprecated and no longer maintained
- Recommended replacement: [package]
- Migration notes: [key changes]
## Medium — Optimize for Stability
### Transitive Dependencies
- **Duplicate [Package]**: Versions [v1, v2] in tree
- Consolidate to: [recommended version]
- Effort: [low/medium/high]
### Unused Dependencies
- **[Package]**: Found in node_modules but not imported
- Action: Remove from package.json and run npm prune
### Bloat Reduction
- **[Package]**: [Size] KB, consider lightweight alternative [package]
- Size savings: [estimate]
## License Audit
- **Copyleft licenses detected**:
- [Package]: GPL-3.0 (incompatible with [your-license])
- [Package]: AGPL-3.0 (requires disclosure)
- **Recommended action**: [Replace or relicense]
## Supply-Chain Health
- **Maintainer Status**:
- [Package]: 1 active maintainer (consider [alternative])
- [Package]: 0 commits in 2+ years (consider [alternative])
## Effort Estimate
- Critical security fixes: [X hours] — Schedule for [date]
- Major version upgrades: [X hours] — Schedule for next sprint
- Optional optimizations: [X hours] — Backlog
- **Total recommended effort**: [X hours over next quarter]
## Upgrade Strategy
### Phase 1: Critical (This week)
1. npm audit fix --force (if safe)
2. Manual patching of high-severity CVEs
3. Verify tests pass
### Phase 2: High Priority (Next 2 weeks)
1. Plan breaking changes for [Package]
2. Create feature branch for major upgrades
3. Update tests for new API versions
### Phase 3: Medium Priority (Next quarter)
1. Remove unused dependencies
2. Consolidate duplicate versions
3. Consider lightweight alternatives for bloat
## Next Steps
- [ ] Apply critical security patches (deadline: [date])
- [ ] Schedule major version upgrade work
- [ ] Investigate [Package] alternative before next release
- [ ] Reduce bundle size by removing [Package]
- [ ] Review and approve license compatibility
Example
Scenario: A Node.js fullstack app with 42 npm dependencies. Developer asks to audit for security and outdated packages.
Steps Executed:
- Run
npm audit — Reports 3 critical CVEs in transitive dependency chain
- Run
npm outdated — Shows 8 packages are 2+ major versions behind
- Run
npm ls lodash — Discovers two versions of lodash (3.10.1 and 4.17.21) due to conflicting peer dependencies
- Run
npx license-checker — Flags GPL-licensed package (incompatible with MIT project)
- Run
npx depcheck — Identifies leftpad in node_modules but not in package.json
- Check npm registry for
express — Last update 2 months ago, 8 active maintainers
Report Output (abbreviated):
# Dependency Audit Report — MyApp — 2026-06-13
## Summary
- Total dependencies (direct): 15
- Total dependencies (with transitive): 42
- Outdated packages: 8
- Security vulnerabilities: 3 critical
- Deprecated packages: 1
- License conflicts: 1
## Critical — MUST FIX NOW
### Security Vulnerabilities
- **lodash 3.10.1 → 4.17.21**
- CVE-2021-23337: ReDoS vulnerability in template syntax
- CVSS Score: 7.5
- Path: app-utils → lodash@3.10.1
- Action: npm install lodash@4.17.21
- **express 4.16.4 → 4.18.2**
- CVE-2022-24999: Prototype pollution via query string
- CVSS Score: 8.2
- Path: direct dependency
- Action: npm install express@latest
## High — Schedule for Next Sprint
### Major Version Upgrades
- **mongoose 5.x → 7.x**
- Breaking changes: Changed query helpers API, model.findByIdAndUpdate() signature
- Migration effort: 4-6 hours
- Benefit: Security fixes, MongoDB 5.0+ support
## Medium — Optimize for Stability
### Transitive Dependencies
- **Duplicate lodash**: Versions 3.10.1 and 4.17.21 in tree
- Consolidate to: 4.17.21
- Effort: low (update peer dependencies)
### Unused Dependencies
- **leftpad**: 2.5 KB, not imported anywhere
- Action: Remove from package.json
## License Audit
- **gpl-package 1.0.0**: GPL-3.0 (incompatible with MIT)
- Recommended action: Replace with [mit-licensed-alternative]
## Effort Estimate
- Critical security fixes: 2 hours
- Major version upgrades: 6 hours
- Total recommended: 8 hours over next 2 weeks
## Next Steps
- [x] Apply critical security patches (deadline: 2026-06-17)
- [ ] Plan mongoose 5 → 7 migration
- [ ] Replace GPL package before next release
- [ ] Remove unused leftpad dependency
Follow-up:
- Create GitHub issue to track major version upgrades
- Pin critical security patches in next release
- Schedule GPL license replacement in next sprint
1---2name: dependency-auditor-23description: Dependency Auditor4---5# Dependency Auditor67## When to activate89Invoke this skill when you need to:10- Scan project dependencies for known security vulnerabilities (CVEs)11- Identify outdated or stale packages in the dependency tree12- Detect license incompatibilities or problematic licenses13- Reduce dependency bloat and redundant transitive dependencies14- Verify dependency versions are locked and reproducible15- Check for supply-chain risks (unmaintained packages, deprecated modules)16- Analyze the health of critical dependencies (activity, maintainer count, issue backlog)17- Generate quarterly dependency audit reports with upgrade recommendations1819## When NOT to use2021Do not use this skill for:22- General package management or routine updates (use native package managers: npm, pip, cargo)23- Debugging broken imports or runtime errors (use code-review or debugging workflow)24- Performance optimization unrelated to dependency size (use profiler)25- Choosing between similar packages without security or maintenance concerns (use architecture review)26- Daily/weekly checks (run annually or when drift becomes concerning; use CI/pre-commit for continuous scanning)2728## Instructions2930### Core Audit Steps31321. **Identify the package manager and lock file**33 - Detect ecosystem: npm/yarn (JavaScript), pip/poetry (Python), cargo (Rust), bundler (Ruby), composer (PHP)34 - Locate lock file: `package-lock.json`, `yarn.lock`, `poetry.lock`, `Cargo.lock`, `Gemfile.lock`, `composer.lock`35 - Verify lock file exists and is reasonably recent (not stale >6 months)36372. **Run security vulnerability scan**38 - npm: `npm audit --audit-level=moderate` for all vulnerabilities; optionally `npm audit fix` with caution39 - Python: `pip-audit` (recommended), `safety check`, or `bandit` for code-level risks40 - Cargo: `cargo audit`41 - Ruby: `bundle audit`42 - Report CVEs by severity (critical, high, moderate, low), include CVE ID and remediation path43443. **Check for outdated dependencies**45 - npm: `npm outdated` to show major/minor/patch version gaps46 - Python: `pip list --outdated`47 - Cargo: `cargo outdated`48 - Categorize by risk: patch-safe (low risk) vs. minor (medium) vs. major (breaking changes)49504. **Analyze transitive dependencies**51 - Identify which direct dependencies pull in problematic transitive dependencies52 - Use `npm ls <package>` or equivalents to trace dependency paths53 - Flag duplicate versions of the same package (e.g., two versions of lodash in tree)54 - Recommend consolidation where possible55565. **License compliance check**57 - npm: `npm ls --depth=0` with manual review; use `npx license-checker` for full tree58 - Python: `pip-licenses`59 - Identify restrictive licenses: GPL, AGPL, SSPL that may infect your codebase60 - Check for incompatibilities with your project's license61 - Flag copyleft licenses or unusual restrictions62636. **Supply-chain risk assessment**64 - Check package registry metadata: unmaintained status, maintainer count, last publish date65 - npm: `npm view <package>` to inspect time, dist-tags, repository66 - Look for unusual patterns: recent ownership transfer, sudden spike in releases, abandoned projects67 - Check GitHub/GitLab repo: last commit date, issue backlog, maintainer activity68 - Flag packages with fewer than 2 active maintainers for critical dependencies69707. **Dependency size and bloat analysis**71 - npm: `npm ls --all` (full tree) vs. `npm ls --depth=0` (direct only)72 - Check bundle impact: `npm run bundle-size` or equivalent73 - Identify unnecessarily large packages (e.g., moment.js vs. date-fns)74 - Find unused dependencies with tools like `depcheck` or `npm ls --all` unused analysis75 - Recommend lighter alternatives where applicable76778. **Lock file integrity**78 - Ensure lock file is committed and up-to-date with package.json79 - Warn if lock file is stale (> 30 days behind package.json changes)80 - Check for conflicts or manual edits in lock file8182### Tool Commands by Ecosystem8384**Node.js / npm:**85```bash86npm audit --audit-level=moderate87npm audit fix # Apply safe fixes (use with caution)88npm outdated89npm ls --depth=0 # Direct dependencies only90npm ls <package> # Trace specific package path91npm view <package> # Check metadata, maintainers, last publish92npx depcheck # Find unused dependencies93npx license-checker # List all licenses in tree94npm ls --all | grep "deduped" # Find duplication95```9697**Python / pip:**98```bash99pip-audit # Security audit100pip list --outdated101pip show <package> # Check version, dependencies, maintainer102pipdeptree # Visualize full dependency tree103pip-licenses # Check all licenses104```105106**Rust / Cargo:**107```bash108cargo audit109cargo outdated110cargo tree # Visualize dependency tree111cargo metadata --format-version 1 # Full dependency graph112```113114**Ruby / Bundler:**115```bash116bundle audit117bundle outdated118bundle viz # Visualize dependency graph (requires graphviz)119```120121### Reporting Structure122123Present audit results in this prioritized order:1241251. **Critical Issues** (must fix immediately)126 - CVEs with CVSS >= 7.0 or exploitable vulnerabilities127 - Unmaintained packages in critical paths (auth, payments, data handling)128 - Breaking version mismatches that prevent installation129 1302. **Actionable Upgrades** (schedule for next sprint)131 - Security patches and minor updates that fix known issues132 - Deprecated packages with recommended replacements133 - License incompatibilities134 1353. **Transitive Bloat** (nice to have, improves tree health)136 - Unused dependencies137 - Redundant versions that should consolidate138 - Oversized packages with lighter alternatives139 1404. **Supply-Chain Health** (informational)141 - Packages with few maintainers142 - Deprecated modules still in use143 - Unusual activity patterns144 1455. **Recommendations & Next Steps**146 - Timeline for critical fixes147 - Breaking changes to plan for148 - Long-term dependency health strategy149150### Output Format151152```153# Dependency Audit Report — [Project Name] — [Date]154155## Summary156- Total dependencies (direct): [X]157- Total dependencies (with transitive): [X]158- Outdated packages: [X] (>1 version behind)159- Security vulnerabilities: [X] (critical: Y, high: Z)160- Deprecated packages: [X]161- License conflicts: [X]162163## Critical — MUST FIX NOW164165### Security Vulnerabilities166- **[Package] [current-version] → [safe-version]**167 - CVE-2024-XXXXX: [Description]168 - CVSS Score: [X.X]169 - Path: [dependency chain]170 - Action: npm update [package] or npm install [package]@[version]171172### Unmaintained or Abandoned173- **[Package] [current-version]**174 - Last update: [date]175 - Recommended alternative: [package]176 - Action: Plan migration in next sprint177178## High — Schedule for Next Sprint179180### Major Version Upgrades181- **[Package] [current] → [next-major]**182 - Breaking changes: [summary]183 - Migration effort: [estimated hours]184 - Benefit: [security/features/performance]185186### Deprecated Packages187- **[Package]** is deprecated and no longer maintained188 - Recommended replacement: [package]189 - Migration notes: [key changes]190191## Medium — Optimize for Stability192193### Transitive Dependencies194- **Duplicate [Package]**: Versions [v1, v2] in tree195 - Consolidate to: [recommended version]196 - Effort: [low/medium/high]197198### Unused Dependencies199- **[Package]**: Found in node_modules but not imported200 - Action: Remove from package.json and run npm prune201202### Bloat Reduction203- **[Package]**: [Size] KB, consider lightweight alternative [package]204 - Size savings: [estimate]205206## License Audit207208- **Copyleft licenses detected**:209 - [Package]: GPL-3.0 (incompatible with [your-license])210 - [Package]: AGPL-3.0 (requires disclosure)211- **Recommended action**: [Replace or relicense]212213## Supply-Chain Health214215- **Maintainer Status**:216 - [Package]: 1 active maintainer (consider [alternative])217 - [Package]: 0 commits in 2+ years (consider [alternative])218219## Effort Estimate220221- Critical security fixes: [X hours] — Schedule for [date]222- Major version upgrades: [X hours] — Schedule for next sprint223- Optional optimizations: [X hours] — Backlog224- **Total recommended effort**: [X hours over next quarter]225226## Upgrade Strategy227228### Phase 1: Critical (This week)2291. npm audit fix --force (if safe)2302. Manual patching of high-severity CVEs2313. Verify tests pass232233### Phase 2: High Priority (Next 2 weeks)2341. Plan breaking changes for [Package]2352. Create feature branch for major upgrades2363. Update tests for new API versions237238### Phase 3: Medium Priority (Next quarter)2391. Remove unused dependencies2402. Consolidate duplicate versions2413. Consider lightweight alternatives for bloat242243## Next Steps244- [ ] Apply critical security patches (deadline: [date])245- [ ] Schedule major version upgrade work246- [ ] Investigate [Package] alternative before next release247- [ ] Reduce bundle size by removing [Package]248- [ ] Review and approve license compatibility249```250251## Example252253**Scenario**: A Node.js fullstack app with 42 npm dependencies. Developer asks to audit for security and outdated packages.254255**Steps Executed**:2562571. Run `npm audit` — Reports 3 critical CVEs in transitive dependency chain2582. Run `npm outdated` — Shows 8 packages are 2+ major versions behind2593. Run `npm ls lodash` — Discovers two versions of lodash (3.10.1 and 4.17.21) due to conflicting peer dependencies2604. Run `npx license-checker` — Flags GPL-licensed package (incompatible with MIT project)2615. Run `npx depcheck` — Identifies `leftpad` in node_modules but not in package.json2626. Check npm registry for `express` — Last update 2 months ago, 8 active maintainers263264**Report Output** (abbreviated):265266```267# Dependency Audit Report — MyApp — 2026-06-13268269## Summary270- Total dependencies (direct): 15271- Total dependencies (with transitive): 42272- Outdated packages: 8273- Security vulnerabilities: 3 critical274- Deprecated packages: 1275- License conflicts: 1276277## Critical — MUST FIX NOW278279### Security Vulnerabilities280- **lodash 3.10.1 → 4.17.21**281 - CVE-2021-23337: ReDoS vulnerability in template syntax282 - CVSS Score: 7.5283 - Path: app-utils → lodash@3.10.1284 - Action: npm install lodash@4.17.21285286- **express 4.16.4 → 4.18.2**287 - CVE-2022-24999: Prototype pollution via query string288 - CVSS Score: 8.2289 - Path: direct dependency290 - Action: npm install express@latest291292## High — Schedule for Next Sprint293294### Major Version Upgrades295- **mongoose 5.x → 7.x**296 - Breaking changes: Changed query helpers API, model.findByIdAndUpdate() signature297 - Migration effort: 4-6 hours298 - Benefit: Security fixes, MongoDB 5.0+ support299300## Medium — Optimize for Stability301302### Transitive Dependencies303- **Duplicate lodash**: Versions 3.10.1 and 4.17.21 in tree304 - Consolidate to: 4.17.21305 - Effort: low (update peer dependencies)306307### Unused Dependencies308- **leftpad**: 2.5 KB, not imported anywhere309 - Action: Remove from package.json310311## License Audit312- **gpl-package 1.0.0**: GPL-3.0 (incompatible with MIT)313 - Recommended action: Replace with [mit-licensed-alternative]314315## Effort Estimate316- Critical security fixes: 2 hours317- Major version upgrades: 6 hours318- Total recommended: 8 hours over next 2 weeks319320## Next Steps321- [x] Apply critical security patches (deadline: 2026-06-17)322- [ ] Plan mongoose 5 → 7 migration323- [ ] Replace GPL package before next release324- [ ] Remove unused leftpad dependency325```326327**Follow-up**:328- Create GitHub issue to track major version upgrades329- Pin critical security patches in next release330- Schedule GPL license replacement in next sprint