Dependency management

Manage third-party libraries, runtimes, and SaaS dependencies.

Dependency management — Creative Direction skill highlight diagram. Navy header card reads 'Impactful Creative Direction' with the subtitle… (from the rampstackco/claude-skills README)

From the rampstackco/claude-skills README — shows the whole collection, not only this skill. · view on GitHub

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/dependency-management, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit rampstackco/claude-skills/skills/dependency-management#main ~/.claude/skills/dependency-management

For one project only, change the path to .claude/skills/dependency-management. This skill also uses package.json — copying SKILL.md alone won't be enough. See the folder on GitHub.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Dependency management

Show the full text327 lines
namedescriptioncategorycatalog_summarydisplay_order
dependency-managementManage third-party libraries, runtimes, and SaaS dependencies. Use this skill when setting an update cadence, responding to security advisories, dealing with deprecated dependencies, evaluating new dependencies, auditing what's installed, or unblocking a dependency upgrade. Triggers on dependency, package update, security patch, lockfile, deprecated, breaking change, supply chain, dependency audit, npm audit, dependabot, renovate. Also triggers when a build breaks after an update or when an advisory is published for a used package.cross-cuttingPackage updates, security patches, lockfile hygiene4

Dependency Management

Decide what to depend on, keep dependencies current, respond to advisories, and reduce supply chain risk. Stack-agnostic principles; specifics vary by package manager.


When to use

  • Setting up dependency hygiene for a new or existing project
  • Responding to a security advisory
  • Major version upgrade of a key dependency
  • Adding a new dependency (evaluation, decision)
  • Removing a dependency (cleanup)
  • Audit of what's installed and what's actually used
  • Setting an update cadence and policy
  • Diagnosing a broken build after an update

When NOT to use

  • General code review (use code-review-web)
  • Vulnerability scanning of infrastructure (use security-baseline)
  • Pinning vendor or service contracts (use vendor-evaluation)
  • Performance impact of dependencies (use performance-optimization)

Required inputs

  • Package manager and lockfile in use (npm, yarn, pnpm, pip, gem, composer, etc.)
  • Current dependency list (production and dev)
  • Current advisories (run audit; check service like Snyk, Dependabot)
  • Update history (when were major dependencies last updated)
  • Risk profile (production criticality, change tolerance)

The framework: 4 categories of dependency

Every dependency falls into one of these. The category drives the policy.

Category 1: Critical runtime

Code that runs in production and would break the system if it failed.

Examples: framework, database driver, payment SDK, authentication library.

Policy:

  • Update cadence: monthly minor, quarterly major (with planning)
  • Security: patch within 24-72 hours of advisory, 24h for critical
  • Pinning: exact version pins or narrow ranges
  • Vetting: thoroughly evaluated before adoption
Category 2: Supporting runtime

Code that runs in production but is replaceable or non-critical.

Examples: utility libraries, formatting, non-core integrations.

Policy:

  • Update cadence: monthly together with critical
  • Security: patch within a week of advisory
  • Pinning: narrow ranges acceptable (e.g., ^1.2.3)
  • Vetting: moderate evaluation; alternatives considered
Category 3: Dev/build

Code that runs only during development or build, not in production.

Examples: bundlers, linters, test frameworks, type checkers.

Policy:

  • Update cadence: quarterly
  • Security: patch within a week (still matters; supply chain attacks target build tools)
  • Pinning: ranges acceptable
  • Vetting: lighter; broken dev tools surface fast
Category 4: Optional/dev-only-personal

Tools individual developers use that aren't part of shared dev environment.

Not really managed at the project level. Mentioned for completeness.


The framework: 5 risk dimensions

When evaluating a dependency, consider:

Dimension 1: Maintenance health
  • Last commit date (months ago is concerning)
  • Open issue count and age
  • Number of maintainers
  • Sponsorship or commercial backing
  • Roadmap visibility

A dependency abandoned a year ago is a liability waiting to surface.

Dimension 2: Surface area
  • Size of the package
  • Number of transitive dependencies
  • Footprint in the bundle (for client-side)
  • Privileges required (file system, network, etc.)

A small dependency that pulls in 50 transitive packages has the surface area of all 50.

Dimension 3: Replaceability
  • How hard would it be to remove?
  • Are there alternatives?
  • Could the functionality be implemented in-house?
  • Is the API standard or idiomatic?

A dependency you can't replace is leverage you've granted to its maintainer.

Dimension 4: Trust
  • Reputation of the maintainer or organization
  • Code quality (skim the source)
  • License (GPL, MIT, BSD, proprietary, none)
  • History of security issues
  • Supply chain practices (signed releases, 2FA on publishes)
Dimension 5: Cost
  • Time to evaluate, integrate, maintain
  • Risk of breaking changes
  • Lockfile entropy
  • Potential security exposure
  • Bundle size impact (for client-side)

Every dependency has a cost. Free packages aren't free.


Workflow

Step 1: Inventory

Run a dependency listing:

# npm/yarn/pnpm
npm ls --all --json

# pip
pip list

# gem  
bundle list

For each top-level dependency, categorize (critical / supporting / dev). For transitives, you generally don't manage individually unless one becomes a problem.

Step 2: Audit

Run the security audit:

npm audit
yarn npm audit  # Yarn 2+; "yarn audit" on Yarn 1 Classic
pip-audit
bundle audit

For each finding:

  • Severity (critical, high, medium, low)
  • Package and version
  • Fix available?
  • Used directly or transitively?
Step 3: Categorize and prioritize
Severity Direct dep Indirect dep
Critical Patch today Patch this week (if a fix exists; track if not)
High Patch this week Patch this month
Medium Patch this month Track; patch with next round
Low Track Track

Critical and high in production code are emergencies. Low and medium are scheduled work.

Step 4: Test before merging fixes

Even patch-level updates can break things. For critical dependencies:

  • Run the full test suite
  • Smoke-test in staging
  • Watch the monitoring after rollout

For supporting and dev:

  • Run the test suite
  • A failed test is OK to investigate; don't merge a known-broken update
Step 5: Plan major version upgrades

Major versions break things. Plan rather than rush.

For each major upgrade:

  • Read the changelog and migration guide
  • Estimate the migration effort
  • Schedule the work (don't do it under deadline pressure)
  • Branch and test thoroughly
  • Plan a staged rollout if it's a critical dependency

Don't sit on major versions indefinitely. The longer you wait, the more painful the upgrade.

Step 6: Set the policy

Document:

  • Update cadence (e.g., monthly review, quarterly upgrades)
  • Security response SLA (e.g., critical within 24h)
  • Approval for new dependencies (who signs off)
  • Removal criteria (when do we drop a dependency)
  • Pinning strategy (exact, narrow range, broad range)

The policy is what survives team turnover. Without it, dependency management becomes chaotic ad hoc work.

Step 7: Automate
  • Renovate or Dependabot for automatic update PRs
  • CI runs audit on every PR
  • Block merges on critical advisories (with override path for false positives)
  • Notify on advisories for installed packages
  • Lockfile diff in PR review

Automation reduces toil. Manual checking doesn't scale.

Step 8: Audit usage periodically

Quarterly:

  • Dependencies installed but not imported anywhere (run a tool like depcheck)
  • Major versions behind (more than 1-2 majors behind = upgrade plan needed)
  • Unmaintained packages (last commit over a year ago = consider replacing)
  • License audit (anything that's changed terms?)

Remove what's not used. Replace what's unmaintained.


New dependency evaluation

Before adding a new dependency, answer:

  • What problem does this solve?
  • Could we solve it without a dependency? (Often yes for small problems.)
  • What alternatives exist?
  • Is the package actively maintained?
  • What's the install size and bundle impact?
  • What are the transitive dependencies? (Worth a quick scan.)
  • What's the license?
  • What's the security history?
  • How replaceable is it?

Default: don't add. Add only when the value clearly exceeds the cost. The cost includes ongoing maintenance, not just installation.


Dependency removal

When removing a dependency:

  • Identify all usages (search the codebase)
  • Replace each usage (with native code, another dependency, or a no-op)
  • Remove from package.json or equivalent
  • Update lockfile (run install)
  • Verify tests pass
  • Verify build size went down (or stayed the same)
  • Document the removal in the changelog

Removed dependencies sometimes leave config files, CI hooks, or imports behind. Search broadly.


Failure patterns

No update cadence. Dependencies drift. When you finally upgrade, it's painful. Set a cadence.

Audit disabled in CI. "Too noisy." Tune the audit, don't disable it. Whitelist known false positives explicitly.

Pinning everything to exact versions. Stops automatic patches. Misses security fixes. Use narrow ranges with a lockfile.

Unpinned floating versions. latest in production. Builds aren't reproducible. Lockfile required.

Adding dependencies without review. "I just needed a quick utility." Now there are 50 unused dependencies. Require review for new dependencies.

Ignoring transitive dependencies. A direct dependency pulls in 50 indirect ones. Each is supply chain surface. Audit the tree, not just the top level.

Patching with major version bumps. "Updating to fix a bug" but the update is a major version. Now you have unrelated breaking changes too. Be deliberate about the version of the fix.

Vendor-bundled libraries. Some dependencies vendor copies of other dependencies. They're not visible to the audit. Periodically check.

Build-time dependencies treated as zero-risk. Build tools have access to your code and credentials. Supply chain attacks target them. Treat with appropriate care.

Fork without rebase plan. Forking a dependency to fix something. Then you own it. Plan how to rebase or merge upstream changes, or commit to maintaining the fork.

No license audit. Project ships with a GPL dependency in a commercial product. Compliance issue. Audit licenses on add and quarterly.

Update PRs piling up. Dependabot PRs go unmerged for months. Either tune to fewer PRs or commit time to merging them.


Output format

A dependency policy document includes:

  • Inventory: current dependencies by category
  • Audit status: open advisories, severity, plan
  • Policies: cadence, SLA, pinning, approval
  • Tooling: what's automated (Renovate, Dependabot, audit in CI)
  • License audit: any concerns
  • Quarterly review schedule: when this gets revisited

Reference files

  • references/upgrade-checklist.md: Step-by-step checklist for performing a major version upgrade of a critical dependency, from changelog reading to staged rollout.
1---
2name: dependency-management
3description: "Manage third-party libraries, runtimes, and SaaS dependencies. Use this skill when setting an update cadence, responding to security advisories, dealing with deprecated dependencies, evaluating new dependencies, auditing what's installed, or unblocking a dependency upgrade. Triggers on dependency, package update, security patch, lockfile, deprecated, breaking change, supply chain, dependency audit, npm audit, dependabot, renovate. Also triggers when a build breaks after an update or when an advisory is published for a used package."
4category: cross-cutting
5catalog_summary: "Package updates, security patches, lockfile hygiene"
6display_order: 4
7---
8 
9# Dependency Management
10 
11Decide what to depend on, keep dependencies current, respond to advisories, and reduce supply chain risk. Stack-agnostic principles; specifics vary by package manager.
12 
13---
14 
15## When to use
16 
17- Setting up dependency hygiene for a new or existing project
18- Responding to a security advisory
19- Major version upgrade of a key dependency
20- Adding a new dependency (evaluation, decision)
21- Removing a dependency (cleanup)
22- Audit of what's installed and what's actually used
23- Setting an update cadence and policy
24- Diagnosing a broken build after an update
25 
26## When NOT to use
27 
28- General code review (use `code-review-web`)
29- Vulnerability scanning of infrastructure (use `security-baseline`)
30- Pinning vendor or service contracts (use `vendor-evaluation`)
31- Performance impact of dependencies (use `performance-optimization`)
32 
33---
34 
35## Required inputs
36 
37- Package manager and lockfile in use (npm, yarn, pnpm, pip, gem, composer, etc.)
38- Current dependency list (production and dev)
39- Current advisories (run audit; check service like Snyk, Dependabot)
40- Update history (when were major dependencies last updated)
41- Risk profile (production criticality, change tolerance)
42 
43---
44 
45## The framework: 4 categories of dependency
46 
47Every dependency falls into one of these. The category drives the policy.
48 
49### Category 1: Critical runtime
50 
51Code that runs in production and would break the system if it failed.
52 
53Examples: framework, database driver, payment SDK, authentication library.
54 
55Policy:
56- **Update cadence:** monthly minor, quarterly major (with planning)
57- **Security:** patch within 24-72 hours of advisory, 24h for critical
58- **Pinning:** exact version pins or narrow ranges
59- **Vetting:** thoroughly evaluated before adoption
60 
61### Category 2: Supporting runtime
62 
63Code that runs in production but is replaceable or non-critical.
64 
65Examples: utility libraries, formatting, non-core integrations.
66 
67Policy:
68- **Update cadence:** monthly together with critical
69- **Security:** patch within a week of advisory
70- **Pinning:** narrow ranges acceptable (e.g., `^1.2.3`)
71- **Vetting:** moderate evaluation; alternatives considered
72 
73### Category 3: Dev/build
74 
75Code that runs only during development or build, not in production.
76 
77Examples: bundlers, linters, test frameworks, type checkers.
78 
79Policy:
80- **Update cadence:** quarterly
81- **Security:** patch within a week (still matters; supply chain attacks target build tools)
82- **Pinning:** ranges acceptable
83- **Vetting:** lighter; broken dev tools surface fast
84 
85### Category 4: Optional/dev-only-personal
86 
87Tools individual developers use that aren't part of shared dev environment.
88 
89Not really managed at the project level. Mentioned for completeness.
90 
91---
92 
93## The framework: 5 risk dimensions
94 
95When evaluating a dependency, consider:
96 
97### Dimension 1: Maintenance health
98 
99- Last commit date (months ago is concerning)
100- Open issue count and age
101- Number of maintainers
102- Sponsorship or commercial backing
103- Roadmap visibility
104 
105A dependency abandoned a year ago is a liability waiting to surface.
106 
107### Dimension 2: Surface area
108 
109- Size of the package
110- Number of transitive dependencies
111- Footprint in the bundle (for client-side)
112- Privileges required (file system, network, etc.)
113 
114A small dependency that pulls in 50 transitive packages has the surface area of all 50.
115 
116### Dimension 3: Replaceability
117 
118- How hard would it be to remove?
119- Are there alternatives?
120- Could the functionality be implemented in-house?
121- Is the API standard or idiomatic?
122 
123A dependency you can't replace is leverage you've granted to its maintainer.
124 
125### Dimension 4: Trust
126 
127- Reputation of the maintainer or organization
128- Code quality (skim the source)
129- License (GPL, MIT, BSD, proprietary, none)
130- History of security issues
131- Supply chain practices (signed releases, 2FA on publishes)
132 
133### Dimension 5: Cost
134 
135- Time to evaluate, integrate, maintain
136- Risk of breaking changes
137- Lockfile entropy
138- Potential security exposure
139- Bundle size impact (for client-side)
140 
141Every dependency has a cost. Free packages aren't free.
142 
143---
144 
145## Workflow
146 
147### Step 1: Inventory
148 
149Run a dependency listing:
150 
151```bash
152# npm/yarn/pnpm
153npm ls --all --json
154 
155# pip
156pip list
157 
158# gem
159bundle list
160```
161 
162For each top-level dependency, categorize (critical / supporting / dev). For transitives, you generally don't manage individually unless one becomes a problem.
163 
164### Step 2: Audit
165 
166Run the security audit:
167 
168```bash
169npm audit
170yarn npm audit # Yarn 2+; "yarn audit" on Yarn 1 Classic
171pip-audit
172bundle audit
173```
174 
175For each finding:
176- Severity (critical, high, medium, low)
177- Package and version
178- Fix available?
179- Used directly or transitively?
180 
181### Step 3: Categorize and prioritize
182 
183| Severity | Direct dep | Indirect dep |
184|---|---|---|
185| Critical | Patch today | Patch this week (if a fix exists; track if not) |
186| High | Patch this week | Patch this month |
187| Medium | Patch this month | Track; patch with next round |
188| Low | Track | Track |
189 
190Critical and high in production code are emergencies. Low and medium are scheduled work.
191 
192### Step 4: Test before merging fixes
193 
194Even patch-level updates can break things. For critical dependencies:
195- Run the full test suite
196- Smoke-test in staging
197- Watch the monitoring after rollout
198 
199For supporting and dev:
200- Run the test suite
201- A failed test is OK to investigate; don't merge a known-broken update
202 
203### Step 5: Plan major version upgrades
204 
205Major versions break things. Plan rather than rush.
206 
207For each major upgrade:
208- Read the changelog and migration guide
209- Estimate the migration effort
210- Schedule the work (don't do it under deadline pressure)
211- Branch and test thoroughly
212- Plan a staged rollout if it's a critical dependency
213 
214Don't sit on major versions indefinitely. The longer you wait, the more painful the upgrade.
215 
216### Step 6: Set the policy
217 
218Document:
219- Update cadence (e.g., monthly review, quarterly upgrades)
220- Security response SLA (e.g., critical within 24h)
221- Approval for new dependencies (who signs off)
222- Removal criteria (when do we drop a dependency)
223- Pinning strategy (exact, narrow range, broad range)
224 
225The policy is what survives team turnover. Without it, dependency management becomes chaotic ad hoc work.
226 
227### Step 7: Automate
228 
229- **Renovate** or **Dependabot** for automatic update PRs
230- CI runs audit on every PR
231- Block merges on critical advisories (with override path for false positives)
232- Notify on advisories for installed packages
233- Lockfile diff in PR review
234 
235Automation reduces toil. Manual checking doesn't scale.
236 
237### Step 8: Audit usage periodically
238 
239Quarterly:
240- Dependencies installed but not imported anywhere (run a tool like `depcheck`)
241- Major versions behind (more than 1-2 majors behind = upgrade plan needed)
242- Unmaintained packages (last commit over a year ago = consider replacing)
243- License audit (anything that's changed terms?)
244 
245Remove what's not used. Replace what's unmaintained.
246 
247---
248 
249## New dependency evaluation
250 
251Before adding a new dependency, answer:
252 
253- [ ] What problem does this solve?
254- [ ] Could we solve it without a dependency? (Often yes for small problems.)
255- [ ] What alternatives exist?
256- [ ] Is the package actively maintained?
257- [ ] What's the install size and bundle impact?
258- [ ] What are the transitive dependencies? (Worth a quick scan.)
259- [ ] What's the license?
260- [ ] What's the security history?
261- [ ] How replaceable is it?
262 
263Default: don't add. Add only when the value clearly exceeds the cost. The cost includes ongoing maintenance, not just installation.
264 
265---
266 
267## Dependency removal
268 
269When removing a dependency:
270 
271- [ ] Identify all usages (search the codebase)
272- [ ] Replace each usage (with native code, another dependency, or a no-op)
273- [ ] Remove from package.json or equivalent
274- [ ] Update lockfile (run install)
275- [ ] Verify tests pass
276- [ ] Verify build size went down (or stayed the same)
277- [ ] Document the removal in the changelog
278 
279Removed dependencies sometimes leave config files, CI hooks, or imports behind. Search broadly.
280 
281---
282 
283## Failure patterns
284 
285**No update cadence.** Dependencies drift. When you finally upgrade, it's painful. Set a cadence.
286 
287**Audit disabled in CI.** "Too noisy." Tune the audit, don't disable it. Whitelist known false positives explicitly.
288 
289**Pinning everything to exact versions.** Stops automatic patches. Misses security fixes. Use narrow ranges with a lockfile.
290 
291**Unpinned floating versions.** `latest` in production. Builds aren't reproducible. Lockfile required.
292 
293**Adding dependencies without review.** "I just needed a quick utility." Now there are 50 unused dependencies. Require review for new dependencies.
294 
295**Ignoring transitive dependencies.** A direct dependency pulls in 50 indirect ones. Each is supply chain surface. Audit the tree, not just the top level.
296 
297**Patching with major version bumps.** "Updating to fix a bug" but the update is a major version. Now you have unrelated breaking changes too. Be deliberate about the version of the fix.
298 
299**Vendor-bundled libraries.** Some dependencies vendor copies of other dependencies. They're not visible to the audit. Periodically check.
300 
301**Build-time dependencies treated as zero-risk.** Build tools have access to your code and credentials. Supply chain attacks target them. Treat with appropriate care.
302 
303**Fork without rebase plan.** Forking a dependency to fix something. Then you own it. Plan how to rebase or merge upstream changes, or commit to maintaining the fork.
304 
305**No license audit.** Project ships with a GPL dependency in a commercial product. Compliance issue. Audit licenses on add and quarterly.
306 
307**Update PRs piling up.** Dependabot PRs go unmerged for months. Either tune to fewer PRs or commit time to merging them.
308 
309---
310 
311## Output format
312 
313A dependency policy document includes:
314 
315- **Inventory:** current dependencies by category
316- **Audit status:** open advisories, severity, plan
317- **Policies:** cadence, SLA, pinning, approval
318- **Tooling:** what's automated (Renovate, Dependabot, audit in CI)
319- **License audit:** any concerns
320- **Quarterly review schedule:** when this gets revisited
321 
322---
323 
324## Reference files
325 
326- [`references/upgrade-checklist.md`](references/upgrade-checklist.md): Step-by-step checklist for performing a major version upgrade of a critical dependency, from changelog reading to staged rollout.
327 

Discussion

Alternatives

Also in SecuritySee all 533 in Development →