skills/dependency-management/SKILL.md
Dependency evaluation, supply chain security, and maintenance for Python and JavaScript projects. Use when: evaluating whether to add a new dependency, comparing alternatives, pruning unused dependencies, auditing for vulnerabilities, configuring Renovate or Dependabot, managing lockfiles, checking license compliance, resolving version conflicts, remediating CVEs, or auditing an existing project for dependency hygiene. Covers the full lifecycle: evaluate → add → lock → audit → update → prune.
npx skillsauth add michaelsvanbeek/personal-agent-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.
Dependencies are attack surface, maintenance burden, and build-time cost. The safest, fastest, most maintainable dependency is the one you don't add. Treat every dependency as a decision that requires justification — not a default.
Foundation: Dependency evaluation is a domain-specific application of the alternatives-analysis framework. The generic skill defines decision framing, criteria weighting, summary tables, and recommendation structure. This section adds dependency-specific criteria (supply chain security, maintenance health, bundle size, license compliance).
Before adding any dependency, complete this evaluation. The default answer is "don't add it."
Ask these questions first:
pathlib, json, urllib, dataclasses, asyncio — and Node's crypto, fs, url, util — cover more than most developers realize.Rule: If the answer to any of questions 1–3 is yes, don't add the dependency.
When a dependency is justified, evaluate at least three alternatives (including "write it ourselves") and produce a decision report.
| Criterion | What to Check | Red Flags | |-----------|---------------|-----------| | Maintenance | Last commit, release cadence, open issues/PRs | No commits in 12+ months, hundreds of stale issues | | Popularity | Downloads/week, GitHub stars, dependents count | <1,000 weekly downloads for a general-purpose lib | | Size | Install size, transitive dependency count | >5MB install size, >20 transitive deps for simple functionality | | Security | Known CVEs, Snyk/Socket.dev score, maintainer count | Unpatched CVEs, single maintainer, no 2FA on publish | | License | SPDX identifier | GPL/AGPL in proprietary project, no license at all | | API quality | TypeScript types, documentation, breaking change history | No types, poor docs, frequent major version bumps | | Alternatives | Standard library coverage, smaller alternatives | stdlib can do 80% of what this package does |
# Python — check package metadata
uv pip show <package>
pip-audit -r requirements.txt # or pip-audit on installed env
# Python — check install size and transitive deps
uv pip install --dry-run <package>
# Node.js — check package size and dependencies
npm view <package> dist.unpackedSize
npm view <package> dependencies
# Node.js — bundle size impact
npx bundlephobia-cli <package>
# Both — check maintenance health
# Visit: https://snyk.io/advisor/python/<package>
# Visit: https://snyk.io/advisor/npm-package/<package>
# Visit: https://socket.dev/npm/package/<package>
For any non-trivial dependency addition, document the decision. This report lives in the PR description or as a comment in code.
## Dependency Decision: <need>
**Need**: <one sentence describing what capability is needed>
### Alternatives Evaluated
| Option | Pros | Cons | Size | Deps | Maintained |
|--------|------|------|------|------|------------|
| Write ourselves | No supply chain risk, exact fit | Dev time, maintenance burden | 0 | 0 | Us |
| <package-a> | <pros> | <cons> | <size> | <count> | <yes/no> |
| <package-b> | <pros> | <cons> | <size> | <count> | <yes/no> |
| stdlib <module> | Zero deps, always available | <limitations> | 0 | 0 | Yes |
### Decision
**Chosen**: <package or "write ourselves">
**Rationale**: <2-3 sentences explaining why>
**Risk**: <what could go wrong, mitigation>
Rule: No runtime dependency is added without this evaluation. Dev dependencies (test frameworks, linters) need only a brief justification.
# Python — find unused imports (which suggest unused deps)
ruff check --select F401 .
# Python — find unused dependencies
pip-extra-reqs --ignore-module=tests src/
# Node.js — find unused dependencies
npx depcheck
# Node.js — find unused exports (tree-shaking misses)
npx ts-unused-exports tsconfig.json
uv.lock, package-lock.json, pnpm-lock.yaml.uv sync --frozen, npm ci (not npm install).uv add httpx # Add dependency (updates pyproject.toml + uv.lock)
uv add --dev pytest # Add dev dependency
uv sync --frozen # Install from lockfile (CI/production)
uv lock --upgrade-package httpx # Update single package
uv lock --upgrade # Update all packages
npm ci # Install from lockfile (CI/production)
npm install zustand # Add dependency
npm install -D vitest # Add dev dependency
npm update zustand # Update single package
npm audit # Audit for vulnerabilities
| File | Pin Strategy | Why |
|------|-------------|-----|
| pyproject.toml | Range (>=1.2,<2) | Allow compatible updates; lockfile pins exact |
| package.json | Range (^1.2.3) | Same; lockfile pins exact |
| Dockerfile base image | Exact tag (python:3.12.8-slim) | Reproducible builds |
| CI tool versions | Exact (ruff==0.8.0) | Reproducible CI |
| uv.lock / package-lock.json | Exact (auto-generated) | Never edit manually |
latest or * as a version specifier.latest or just major version.uv.lock and package-lock.json include integrity hashes by default — never disable this.--require-hashes with pip-audit.# .npmrc — scope internal packages to private registry
@myorg:registry=https://npm.pkg.github.com
@myorg/ scope).reqeusts vs requests.| Ecosystem | Command | Output |
|-----------|---------|--------|
| Python | pip-audit --strict | Known CVEs with fix versions |
| Python | pip-audit --require-hashes --strict | CVEs with hash verification |
| Node.js | npm audit | Known advisories in dependency tree |
| Docker | docker scout cves <image> | CVEs in container image layers |
| Multi | trivy fs . | Filesystem scan across ecosystems |
When a vulnerability is found:
pip-audit --fix or npm audit fix will auto-update if a patched version exists.# safety: comment, link to the CVE, and set a calendar reminder to re-check.# Drone CI — Python
- name: audit-dependencies
image: python:3.12-slim
commands:
- pip install pip-audit
- pip-audit --require-hashes --strict
# Drone CI — Node.js
- name: audit-dependencies
image: node:22-alpine
commands:
- npm ci
- npm audit --audit-level=high
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"labels": ["dependencies"],
"rangeStrategy": "pin",
"lockFileMaintenance": {
"enabled": true,
"schedule": ["before 6am on monday"]
},
"packageRules": [
{
"matchUpdateTypes": ["patch"],
"automerge": true
},
{
"matchUpdateTypes": ["minor"],
"groupName": "minor updates"
},
{
"matchUpdateTypes": ["major"],
"labels": ["dependencies", "breaking"]
}
]
}
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependencies
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependencies
| Priority | Cadence | Action | |----------|---------|--------| | Critical security fix | Immediately | Patch and deploy same day | | High severity CVE | Within 48 hours | Update, test, deploy | | Patch versions | Weekly (automated) | Automerge via Renovate/Dependabot | | Minor versions | Bi-weekly | Review grouped PR, check changelogs | | Major versions | Monthly review | Evaluate breaking changes, plan migration |
MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD.
GPL-2.0, GPL-3.0, AGPL-3.0, SSPL, EUPL — flag before use in proprietary projects.
Unlicensed packages must not be used in production.
# Python
pip-licenses --format=table --with-urls
# Node.js
npx license-checker --summary
npx license-checker --onlyAllow "MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;0BSD"
uv pip tree # Python dependency tree
npm ls # Node.js dependency tree
npm explain <package> # Why is this installed?
resolutions in package.json, tool.uv.override in pyproject.toml).| Anti-Pattern | Problem | Fix |
|-------------|---------|-----|
| Adding deps without evaluation | Bloated supply chain, hidden risk | Complete the evaluation framework |
| No lockfile committed | Non-reproducible builds | Commit lockfile, use --frozen in CI |
| npm install in CI | Ignores lockfile | Use npm ci |
| Ignoring audit warnings | Vulnerabilities accumulate | Enforce in CI, triage immediately |
| Never pruning | Dead deps increase attack surface | Quarterly prune with detection tools |
| Pinning everything in manifest | Can't receive compatible patches | Use ranges in manifest, pins in lockfile |
| latest base images | Builds break unpredictably | Pin to specific tag |
| Single-maintainer runtime deps | High supply chain risk | Prefer org-owned, multi-maintainer packages |
| Copy-pasting npm install <x> from tutorials | Untriaged deps enter the project | Every addition goes through evaluation |
When auditing an existing project for dependency hygiene:
npm ci, uv sync --frozen)pip-audit or npm audit runs in every CI pipelinelatest tags in Dockerfile base imagesdevelopment
TypeScript coding standards and type safety conventions. Use when: creating TypeScript files, defining interfaces and types, writing type-safe code, reviewing TypeScript for type correctness, auditing a codebase for type safety gaps, eliminating any or ts-ignore usage, or improving strict-mode compliance. Covers strict typing, avoiding any and ts-ignore, discriminated unions, Zod runtime validation, immutability patterns, and proper type definitions.
testing
Writing clear, actionable tickets in any issue tracker (Jira, Linear, GitHub Issues, ServiceNow, etc.). Use when: creating epics, stories, tasks, bugs, or spikes; writing acceptance criteria; decomposing work for a sprint; linking dependencies between tickets; auditing backlog items for clarity; or coaching a team on ticket quality. Covers title conventions, description templates, acceptance criteria, decomposition rules, dependency linking, and org-specific pluggable configuration.
development
Testing strategy, patterns, and evaluation for software and LLM/AI systems. Use when: writing tests, choosing test boundaries, designing test data, structuring test suites, evaluating LLM outputs, building evaluation pipelines, setting coverage thresholds, auditing test coverage gaps in existing projects, or improving test quality and structure.
development
Writing effective status updates for different audiences and cadences. Use when: writing a weekly status update, preparing a monthly summary, drafting a quarterly review, sending updates to leadership, sharing progress with stakeholders, or improving the clarity and impact of team communications. Covers weekly, monthly, and quarterly formats tailored for upward, lateral, and downward communication.