dependency-discipline
Skill4 starsChanged 4 months agoMITView on GitHub
Choosing, pinning, upgrading, and auditing third-party dependencies — and supply-chain safety. Use when adding a library or framework, running npm/pip/cargo installs, responding to a CVE or security advisory, upgrading major versions, or when the user says "which library", "add a package", "dependency", "vulnerability alert", "outdated packages", or "supply chain".
- Installs packages
In this repository23 other files it gives its agents.
- ai-agent-designSkill
- ai-build-qualitySkill
- ai-engineeringSkill
- api-contract-designSkill
- architecture-designSkill
- change-hygieneSkill
- code-qualitySkill
- database-designSkill
- data-privacy-complianceSkill
- deployment-safetySkill
- docs-and-runbooksSkill
- legacy-code-changesSkill
- observability-readinessSkill
- payments-and-moneySkill
- performance-improvementSkill
- product-ux-qualitySkill
- release-readinessSkill
- requirements-to-specSkill
- root-cause-debuggingSkill
- saas-multi-tenancySkill
- system-designSkill
- testing-strategySkill
- threat-model-securitySkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Every dependency is code you now ship, maintained by strangers, on their schedule, with your name on the incident.
- Distinctive: line 14
If importing, spend five deliberate minutes:
- Distinctive: line 33
Read the changelog *before* upgrading, not after the incident.
- Distinctive: line 41
Not reachable → note the reasoning, schedule with the regular batch.
- Distinctive: line 42
No fix released? Mitigate (disable the feature, input-validate ahead of it, vendor-patch as last resort) and track the upstream issue.
- Distinctive: line 53
Keep the *why* of non-obvious dependencies findable (ADR line, lockfile comment, or docs): "we use X over the popular Y because Z".
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dependency Discipline
Every dependency is code you now ship, maintained by strangers, on their schedule, with your name on the incident. npm install is the easiest way to adopt a liability while feeling productive. The discipline: adopt deliberately, pin exactly, upgrade continuously, and keep the exits marked.
Gate 1: Before adding — the adoption review
First question: can 30 lines of your own code do this? For anything smaller than a real domain (left-pad-class utilities, one date format, a simple retry), writing it beats importing it — your 30 lines have no transitive tree, no CVE feed, no maintainer burnout. Import for genuine domains: crypto (NEVER hand-roll — threat-model-security), parsers for messy formats, timezone data, database drivers, frameworks.
If importing, spend five deliberate minutes:
- Aliveness: commits/releases in the last year, issues getting answers, more than one maintainer (bus factor). A dead dependency is a fork you haven't admitted to yet.
- Weight: what does it drag in transitively? (
npm ls, dependency graph). A 3-line convenience with 40 transitive deps is a bad trade; prefer libraries with shallow trees. - Blast radius when it breaks: dev-only tool (low bar) vs runtime-critical path vs touches-money-or-auth (high bar: popularity, audit history, and your own reading of its core code).
- License compatible with your use (GPL in a proprietary SaaS backend is usually fine; in distributed code it's a legal meeting).
- Exit cost: how hard to replace later? High-exit-cost deps (frameworks, ORMs) deserve real evaluation; for the rest, keep them behind your own adapter so the exit stays cheap (architecture-design).
Gate 2: Pinning — builds must not drift
- Lockfiles committed, always, and honored in CI/production installs (
npm ci,pip install -r requirements.txtwith pins,poetry.lock,cargo.lock). An unlocked build means yesterday's green and today's deploy are different software (deployment-safety Gate 1). - Docker base images by specific tag (ideally digest), never
latest. Same for GitHub Actions (@v4minimum; SHA-pin for anything with secrets access). - The rule: a rebuild with no code change produces the same artifact. Any violation of that is a drift channel; close it.
Gate 3: Upgrading — small, often, boring
The counterintuitive truth: teams that upgrade more often have fewer upgrade disasters. Staying two majors behind doesn't avoid the migration; it batches it into a death march with security pressure attached.
- Cadence: patch/minor updates in a regular small batch (monthly, or automated via Renovate/Dependabot with CI gating); major versions individually, deliberately, reading the changelog/migration guide first.
- One dependency (or one coherent batch) per PR, tests green, deployed normally — so when something breaks,
git bisecthas one suspect (root-cause-debugging: "find what changed"). - Read the changelog before upgrading, not after the incident. Breaking changes announce themselves; nobody listens.
- Framework/language runtime upgrades are projects, not chores: branch, upgrade, run the full suite + golden-path verification, then merge — not "bump it and see".
Gate 4: Vulnerability response — triage, don't panic
Scanner alerts (Dependabot/npm audit/pip-audit) are inputs, not verdicts. Triage each:
- Is the vulnerable path reachable in your usage? A ReDoS in a dev-only build tool ≠ an RCE in your request parser. Severity × reachability = your actual priority.
- Reachable + serious → patch now via the smallest jump that fixes it, deploy through the normal (fast) pipeline.
- Not reachable → note the reasoning, schedule with the regular batch. Suppressing alerts silently trains everyone to ignore the channel (observability-readiness's alert-fatigue rule applies).
- No fix released? Mitigate (disable the feature, input-validate ahead of it, vendor-patch as last resort) and track the upstream issue.
Supply-chain paranoia (the part everyone skips until it's news)
- New-package hygiene: check the exact name (typosquats live on one-letter differences), the publish date vs popularity (a "popular" package published last week is a flag), and whether install scripts run (
--ignore-scriptswhere feasible). - CI is the crown jewel: it holds your secrets and builds your artifacts. Third-party CI actions/plugins get the same adoption review as runtime deps, pinned by SHA.
- Your registry account (npm/PyPI) with publish rights gets 2FA — you're someone else's supply chain too.
- Periodic pruning: every dependency audit removes something. Unused deps are pure attack surface;
depcheck/pip-extra-reqs-class tools find them.
The ledger
Keep the why of non-obvious dependencies findable (ADR line, lockfile comment, or docs): "we use X over the popular Y because Z". Six months later, someone (or some AI) will "simplify" by swapping it back, rediscovering Z in production (docs-and-runbooks).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

