skills/dependency-management/SKILL.md
Managing third-party dependencies — version pinning, security auditing, license compliance, update workflows, lockfile management, supply chain security. Activate on "npm audit", "dependabot", "renovate", "pin versions", "dependency update", "supply chain", "license compliance", "lockfile", "security advisory", "typosquatting", "SBOM". NOT for internal monorepo package management (use monorepo-management) or publishing your own packages to npm/PyPI.
npx skillsauth add curiositech/windags-skills dependency-managementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Package evaluation flow:
├─ Code volume > 200 lines? → Proceed to evaluation
├─ Code volume 20-200 lines?
│ ├─ Pure logic (no edge cases, locale, timezone)? → Write yourself
│ └─ Complex domain (crypto, date handling, parsing)? → Proceed to evaluation
└─ Code volume < 20 lines? → Write yourself
Dependency evaluation checklist:
├─ Downloads/week?
│ ├─ < 10k → HIGH RISK (consider alternatives)
│ ├─ 10k-100k → MEDIUM (check maintenance)
│ └─ > 100k → Proceed
├─ Last commit within 2 years? → If no, find maintained fork
├─ License compatible with your project? → If GPL in proprietary, REJECT
├─ npm audit / Socket.dev clean? → If CVEs unfixed, REJECT
└─ Transitive deps < 50? → If > 50, reconsider blast radius
By environment:
├─ Production app dependencies → Exact pins (1.2.3) + lockfile
├─ Library you publish → Tilde ranges (~1.2.3) for flexibility
├─ Dev tooling only → Caret (^1.2.3) acceptable for churn
└─ Never use star (*) → Catastrophic randomness
By risk tolerance:
├─ Zero-downtime services → Exact pins, staged rollouts
├─ Internal tools → Ranges OK with good test coverage
└─ Experimental projects → Ranges to catch breaking changes early
Automation decision:
├─ Team size > 3 developers? → Use Renovate or Dependabot
├─ High-churn project (>20 deps)? → Use automation with grouping
└─ Small/stable project? → Manual monthly audit acceptable
Tool selection:
├─ GitHub-only, simple needs → Dependabot
├─ Multi-platform or advanced grouping → Renovate
└─ Air-gapped environment → Manual with local scanning
Grouping strategy:
├─ Dev dependencies → Group all patch updates
├─ Production dependencies → One PR per major, group minors
└─ Security updates → Always individual PRs for visibility
Severity triage:
├─ Critical (CVSS 9.0+) → Drop everything, fix within 24h
├─ High (7.0-8.9) → Fix within 1 week
├─ Medium (4.0-6.9) → Fix in next sprint
└─ Low (<4.0) → Fix opportunistically
Path analysis:
├─ Direct dependency → Update to patched version
├─ Transitive dependency?
│ ├─ Direct dep has update → Update direct dep
│ ├─ No update available → Use npm overrides/resolutions
│ └─ Dev dependency only → Assess if tooling reaches production
└─ No patch available → Find alternative or vendor/patch yourself
Use overrides when:
├─ Transitive dep has vulnerability, no upstream fix available
├─ Version conflict between multiple dependents
└─ Need to force newer version for compatibility
DON'T use overrides for:
├─ Working around peer dependency warnings (fix the root cause)
├─ Downgrading to avoid testing breaking changes
└─ Long-term fixes (pressure upstream to update)
Symptoms: Project has 200+ dependencies for simple functionality, bundle size ballooning, frequent update conflicts.
Diagnosis: Team adding packages for trivial utilities (is-odd, left-pad), not evaluating code-to-dependency ratio.
Fix: Audit with npx cost-of-modules, remove packages <10KB unless they handle complex domains (crypto, i18n, protocols). Write trivial utilities in-house.
Symptoms: Peer dependency warnings flooding logs, runtime errors about missing APIs, npm install taking minutes.
Diagnosis: Using caret ranges on production dependencies, multiple versions of React/Angular/Vue in tree.
Fix: Pin direct dependencies exactly, use npm ls <package> to trace conflicts, resolve with explicit overrides or upgrade all consumers to compatible range.
Symptoms: npm audit showing same vulnerabilities for weeks, security scanners red in CI, audit fatigue setting in.
Diagnosis: Treating security advisories as "background noise" instead of prioritized work items.
Fix: Implement SLA by severity (Critical=24h, High=1week), assign ownership, track resolution in sprint planning. Use npm audit --audit-level=high to focus on actionable items.
Symptoms: Auto-merging all dependency PRs without review, surprise production failures after "safe" patch updates. Diagnosis: Trusting semver absolutely, not understanding that patch versions can introduce breaking changes. Fix: Auto-merge only dev dependencies + patches with full test coverage. Always human-review production dependencies, major versions, and packages with <100k downloads/week.
Symptoms: "Works on my machine" dependency issues, CI installing different versions than local development.
Diagnosis: Developers running npm install instead of npm ci, lockfile not committed or gitignored.
Fix: CI must use npm ci exclusively, commit lockfiles, add pre-commit hook to validate lockfile freshness with npm ci --dry-run.
Scenario: Need date manipulation. Considering moment.js vs date-fns vs writing custom.
Decision process:
Code volume: Date timezone/locale handling >200 lines → proceed to evaluation
Check candidates:
Evaluate date-fns:
npm audit date-fns → CleanDecision: Add date-fns with exact pin. Avoid moment.js (legacy), avoid custom (too many edge cases).
{
"dependencies": {
"date-fns": "2.30.0"
}
}
Scenario: npm audit shows critical vulnerability in [email protected], but jest dependency chain requires exactly that version.
Investigation:
npm ls semver
# Shows: [email protected] → [email protected] → [email protected]
npm audit --json | jq '.vulnerabilities.semver'
# CVE-2022-25883: ReDoS in semver parsing
Fix strategy:
{
"overrides": {
"semver": ">=7.5.2"
}
}
Validation:
npm audit # Should be clean
npm test # Verify jest still works with newer semver
What novice misses: Just ignoring the warning or trying npm audit fix --force which might break jest entirely.
What expert catches: Scoping the override specifically, testing that the version bump doesn't break the consumer, documenting why override was needed.
Scenario: Upgrading React 16 → 18 in production app. Dependency bot created PR.
Analysis checklist:
Migration plan:
# 1. Audit current React ecosystem
npm ls | grep react
# 2. Check each package's React 18 compatibility
npm info react-router peerDependencies
npm info @material-ui/core peerDependencies # Might be incompatible
# 3. Plan migration path
# - Upgrade react first
# - Upgrade react-router next week
# - Block on @material-ui (might need to migrate to @mui/material)
What novice does: Auto-merge the React upgrade PR without checking ecosystem compatibility. What expert does: Maps the full dependency graph impact, plans staged rollout, identifies blocking incompatibilities before starting.
npm ls --depth=0 | wc -l)npm ci 2>&1 | grep -i "peer" returns empty)npx @cyclonedx/cyclonedx-npm)This skill does NOT cover:
monorepo-managementpackage-publishingdevops-automatorcontainer-securityDelegate when:
java-ecosystemgolang-developmentrust-developmentsecurity-auditortools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.