/oss-skills:dependency-hygienefrom oss-skills
Manages project dependencies to keep them small, current, and safe. Covers adding, auditing, updating, and removing dependencies, plus Dependabot/Renovate config and version conflict resolution.
Ships in oss-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Every dependency is code you did not write, cannot review continuously, and are nonetheless responsible for. For a library, each one is also imposed on every user downstream — a cost you spend on their behalf without asking.
Run this before every npm install:
license-and-legal), not a
dependency.postinstall, setup.py, build.rs.npm view <pkg> dependencies maintainers time.modified
npx howfat <pkg> # true install size incl. transitives
npm ls --all <pkg> # who pulls this in
cargo tree -i <crate> # reverse dependency tree
pipdeptree -r -p <pkg>
Library authors: the bar is much higher than for applications. A dependency in a library is a dependency in every consumer's tree, a potential version conflict, and a row in their security scanner's report. Many successful libraries advertise zero runtime dependencies, and that is a feature users select on.
The rule that resolves most confusion:
| Applications | Libraries | |
|---|---|---|
| Manifest | Ranges are fine | Wide ranges, e.g. ^1.2.0 |
| Lockfile | Commit it | Commit it (for CI reproducibility) |
| Install in CI | npm ci / --locked | npm ci, plus a job testing latest deps |
Libraries must not pin exact versions in the manifest — it creates unresolvable diamond conflicts for consumers. Libraries should still commit a lockfile: it makes your own CI reproducible. Add a separate scheduled job that installs the newest matching versions so you learn about upstream breakage before your users do.
peerDependencies (npm) exist for the case where the consumer must control the version
— plugins, framework integrations. Use them there and nowhere else.
The default Dependabot setup generates a PR per dependency per update, and the predictable outcome is a maintainer who stops reading them — which means security alerts get ignored too. Group aggressively.
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule: { interval: weekly, day: monday }
open-pull-requests-limit: 5
groups:
dev-dependencies:
dependency-type: development
update-types: [minor, patch]
production-patch:
dependency-type: production
update-types: [patch]
ignore:
- dependency-name: "typescript"
update-types: ["version-update:semver-major"] # major upgrades are manual
- package-ecosystem: github-actions
directory: /
schedule: { interval: weekly }
Renovate offers more control and is worth it past a certain size: automerge patch
and dev-dependency updates when CI is green, batch minors into one weekly PR,
require manual review for majors, and use a dependency dashboard issue instead of open
PRs. Also enable minimumReleaseAge (a few days) so you do not automerge a package
version published ten minutes ago by a compromised account.
Always update github-actions as an ecosystem — that is what keeps pinned action SHAs
from going stale (see supply-chain-security).
npm audit --omit=dev # noise drops sharply without dev deps
npm ls --all | wc -l # total tree size
npx depcheck # declared but unused, used but undeclared
cargo audit && cargo udeps
pip-audit && deptry .
go mod tidy && govulncheck ./...
govulncheck is the model the rest of the ecosystem is moving toward: it reports only
vulnerabilities in code paths you actually call, rather than every CVE anywhere in
the tree. Prefer reachability-aware tools where they exist — they turn an unreadable
100-item report into a 3-item one you will act on.
Triaging an advisory:
Overrides for a transitive vulnerability with no upstream fix:
{ "overrides": { "vulnerable-pkg": "1.2.4" } } // npm
[patch.crates-io] # Cargo
vulnerable = { git = "https://github.com/you/fork", branch = "fix" }
Track every override in an issue with a removal condition. Overrides are technical debt that silently becomes permanent.
The most durable win available. Look for:
tomllib; most languages have shipped a formatter.fetch handles.npx depcheck # start here: unused declared deps
npm ls --all --parseable | awk -F/ '{print $NF}' | sort | uniq -c | sort -rn | head
Measure the result — install size, cold-start time, number of packages — and put it in the changelog. Users notice.
When a dependency goes quiet: check for a community fork with real adoption; check whether a stdlib or a modern alternative now covers it; consider vendoring it if it is small and stable (a 200-line stable utility is a fine thing to own); or offer to maintain it upstream. Only migrate to an alternative when you have to — migration is the most expensive option and often the first one proposed.
Never quietly depend on an abandoned package with a known unfixed vulnerability because migration is inconvenient. Say something in your README if you are stuck.
npm install in CI instead of npm ci. Silently ignores the lockfile.npm audit fix --force without reading what it does — it will happily install a
breaking major to silence a warning.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/api-designDesign public interfaces for libraries and tools that other people depend on. Use when designing or reviewing a public API surface, deciding what to export, naming functions and CLI flags, adding configuration options, planning deprecations, or when the user asks "is this a good API" or "how do I change this without breaking users". Covers minimal surface area, error design, async and extension patterns, CLI ergonomics, config precedence, and stability guarantees. Also use before a 1.0 release to freeze the interface./ci-pipelinesDesign continuous integration for an open-source repository. Use when setting up GitHub Actions from scratch, when CI is slow or flaky, when adding a build matrix across OS and language versions, when configuring caching, or when handling PRs from forks that need secrets. Covers workflow structure, concurrency and cancellation, caching strategy, required checks and branch protection, self-hosted runner risks, and keeping CI cheap. Also use for "our CI takes 40 minutes" or "why is CI failing on forks"./code-reviewReview a pull request the way a good open-source maintainer does. Use when reviewing an incoming PR, when the user asks "review this PR" or "is this ready to merge", when triaging a stale PR queue, or when writing review feedback to an external contributor. Covers what to check and in what order, severity levels, phrasing feedback so people come back, handling large or unwanted PRs, first-time contributors, AI-generated submissions, and closing PRs kindly. Complements the built-in /code-review command by adding the maintainer and community dimension./contributor-experienceTurn users into contributors and make their first PR succeed. Use when a project gets stars but no contributions, when first-time PRs stall or get abandoned, when writing or improving CONTRIBUTING.md, when setting up a dev environment that works on the first try, or when the user asks "how do I get contributors" or "why does nobody contribute". Covers the contribution funnel, good first issues, local setup, mentorship, recognition, and onboarding a contributor into a maintainer./docs-architectureStructure and write project documentation beyond the README. Use when docs have sprawled into an unnavigable pile, when users keep asking questions the docs already answer, when choosing a docs site generator (Docusaurus, MkDocs, VitePress, mdBook, Sphinx), or when planning a docs information architecture. Covers the Diataxis framework (tutorial/how-to/reference/explanation), versioning docs across releases, API reference generation, doc testing, and migration guides. Also use for "write docs for this project" or "our docs are bad"./governance-and-sustainabilityKeep a project and its maintainers alive over years. Use when deciding how decisions get made, writing GOVERNANCE.md or a code of conduct enforcement process, adding or removing maintainers, handling burnout or stepping away, setting up funding (GitHub Sponsors, Open Collective, a foundation), handling a fork or a hostile takeover attempt, or archiving a project responsibly. Also use for scope disputes, entitled users, and saying no well.npx claudepluginhub the-open-agent/oss-skills --plugin oss-skills