Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Triage and fix dependency vulnerabilities in an npm project. Use when the user asks to fix, address, or patch dependency/dependabot/npm audit vulnerabilities.
.claude/skills/itsbencodes-fix-vulnerabilities/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | -14% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -37% | 0% |
| case-14 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-16 | ✗→✓ | ▲ Improved | -10% | 0% |
bashgit checkout main && git pull
bashgit checkout -b fix/vulnerabilities-$(date +%Y-%m-%d)
Use the repo's actual owner/name (don't leave :owner/:repo). The patched version lives under vulnerabilities[].first_patched_version.identifier.
bashgh api repos/<owner>/<repo>/dependabot/alerts --paginate \ -q '.[] | select(.state=="open") | {pkg: .dependency.package.name, severity: .security_advisory.severity, summary: .security_advisory.summary, vulnerable: .security_vulnerability.vulnerable_version_range, patched: .security_advisory.vulnerabilities[0].first_patched_version.identifier, manifest: .dependency.manifest_path}'
Also check code scanning (often catches CI/workflow issues that audit misses):
bashgh api repos/<owner>/<repo>/code-scanning/alerts --paginate -q '.[] | select(.state=="open")'
bashnpm audit --json
npm audit walks workspaces by default. Treat deprecation notices (e.g. inflight, whatwg-encoding, "Old versions of glob are not supported") as informational — they have no patched version and can't be "fixed" without replacing the upstream caller. Note them in the PR body and move on.
For each vulnerability, try in order:
package.json AND every workspace package.json (packages/*/package.json) — the vulnerable transitive may be reachable through a workspace. If a direct dep can be bumped to a version whose transitives no longer carry the vuln, do that:bash npm install <pkg>@<safe-version> # or for a workspace: npm install <pkg>@<safe-version> -w <workspace-name>
Always verify against npm view <pkg> version — if every direct dep is already at latest and the vuln persists, no direct bump can fix it.
overrides entry in the root package.json for transitives with no direct-bump path:"pkg": "version") override every instance — only safe when one version works for all callers."pkg@<major>": "<version>" — so each major line is pinned separately. A single flat pin will silently force older callers onto an incompatible API and break the build.npm help package-json for parent-scoped overrides if a flat or range-keyed key is too broad.Example block from this repo:
json "overrides": { "tar": "^7.5.11", "minimatch@3": "^3.1.4", "minimatch@9": "^9.0.7" }
Then npm install and confirm with npm ls <pkg> that each major resolves to the pinned version.
Re-run npm audit after each change.
Use the validate skill. Overrides can break callers expecting older APIs (especially across major versions). Tests alone aren't enough — build pipelines (rollup, webpack, babel) often hit the bumped transitives at compile time.
If a bump/override breaks the build and the incompatibility can't be reconciled (caller depends on a removed API, peer-dep conflict between two libs, etc.), roll back that specific change — revert the npm install or remove the offending overrides entry, run npm install, and move it to the "Unfixed" section of the PR body with a one-line reason. Do not commit a broken build.
Use the commit skill with title fix: patch dependency vulnerabilities and body:
## Fixed
- <pkg>: <old> → <new> (direct bump / override)
## Unfixed (no patch available)
- <pkg> (<severity>): <summary>| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | fail→pass | 11,358 | 3,434 | -70% | 1 | 1 | 0% | 1,581 | 1,365 | -14% | 0 | 0 | — |
case-01 | fail→fail | 5,393 | 21,194 | +293% | 1 | 1 | 0% | 283 | 1,290 | +356% | 0 | 0 | — |
case-02 | fail→fail | 6,504 | 6,157 | -5% | 1 | 1 | 0% | 237 | 1,395 | +489% | 0 | 0 | — |
case-03 | fail→fail | 15,420 | 9,357 | -39% | 1 | 1 | 0% | 2,850 | 1,390 | -51% | 0 | 0 | — |
case-05 | pass→pass | 8,944 | 3,313 | -63% | 1 | 1 | 0% | 1,471 | 1,213 | -18% | 0 | 0 | — |
case-06 | pass→pass | 11,055 | 4,238 | -62% | 1 | 1 | 0% | 2,140 | 1,717 | -20% | 0 | 0 | — |
case-07 | pass→pass | 12,189 | 4,508 | -63% | 1 | 1 | 0% | 2,087 | 1,824 | -13% | 0 | 0 | — |
case-08 | fail→pass | 14,297 | 3,126 | -78% | 1 | 1 | 0% | 2,478 | 1,550 | -37% | 0 | 0 | — |
case-09 | pass→pass | 16,049 | 5,730 | -64% | 1 | 1 | 0% | 2,258 | 1,851 | -18% | 0 | 0 | — |
case-10 | pass→pass | 17,219 | 4,595 | -73% | 1 | 1 | 0% | 2,599 | 1,674 | -36% | 0 | 0 | — |
case-11 | pass→pass | 15,752 | 5,637 | -64% | 1 | 1 | 0% | 2,364 | 1,908 | -19% | 0 | 0 | — |
case-12 | pass→pass | 15,274 | 3,328 | -78% | 1 | 1 | 0% | 2,292 | 1,566 | -32% | 0 | 0 | — |
case-13 | fail→fail | 9,598 | 3,806 | -60% | 1 | 1 | 0% | 1,309 | 1,681 | +28% | 0 | 0 | — |
case-14 | fail→pass | 9,233 | 4,126 | -55% | 1 | 1 | 0% | 1,280 | 1,211 | -5% | 0 | 0 | — |
case-15 | fail→pass | 14,283 | 4,260 | -70% | 1 | 1 | 0% | 2,483 | 1,770 | -29% | 0 | 0 | — |
case-16 | fail→pass | 12,861 | 3,065 | -76% | 1 | 1 | 0% | 1,717 | 1,539 | -10% | 0 | 0 | — |
case-17 | fail→pass | 8,141 | 3,530 | -57% | 1 | 1 | 0% | 1,626 | 1,690 | +4% | 0 | 0 | — |
case-18 | fail→pass | 6,949 | 1,760 | -75% | 1 | 1 | 0% | 1,281 | 1,340 | +5% | 0 | 0 | — |
case-19 | pass→pass | 11,031 | 2,177 | -80% | 1 | 1 | 0% | 1,493 | 1,385 | -7% | 0 | 0 | — |
case-20 | pass→pass | 7,068 | 3,066 | -57% | 1 | 1 | 0% | 1,013 | 1,238 | +22% | 0 | 0 | — |
case-21 | pass→fail | 11,753 | 6,694 | -43% | 1 | 1 | 0% | 2,094 | 1,237 | -41% | 0 | 0 | — |
case-22 | pass→pass | 5,957 | 7,703 | +29% | 1 | 1 | 0% | 1,103 | 1,917 | +74% | 0 | 0 | — |
case-23 | pass→pass | 20,766 | 22,985 | +11% | 1 | 1 | 0% | 3,285 | 4,301 | +31% | 0 | 0 | — |
case-24 | pass→pass | 11,062 | 7,493 | -32% | 1 | 1 | 0% | 2,085 | 2,351 | +13% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted, and 20 counted toward the lift figure. The other 4 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +25 percentage points is the difference between those two pass rates over the 20 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.