dependency-advisory
Skill9 starsChanged 7 days agoMITView on GitHub
Respond to a dependency security advisory that has turned CI's npm audit step red. Read the advisory, pick the fix route (an in-range bump or a root override), apply it, prove it took with npm ls and a clean high-level audit, run the full verify, then hand off to ship. Use when asked to fix an npm audit failure, patch a vulnerable dependency, or respond to a security advisory. Never pushes or deploys.
- Installs packages
In this repository33 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-auditSkill
- animation-jump-checkSkill
- api-consistencySkill
- chat-qualitySkill
- checkpointSkill
- component-consistency-auditSkill
- component-doc-pageSkill
- content-auditSkill
- design-qaSkill
- dogfoodSkill
- drift-auditSkill
- first-deploySkill
- landSkill
- link-rotSkill
- new-componentSkill
- new-pageSkill
- new-presetSkill
- new-templateSkill
- new-tokenSkill
- new-validatorSkill
- parkSkill
- pre-deploySkill
- release-postSkill
- releaseSkill
- responsive-sweepSkill
- security-auditSkill
- seo-auditSkill
- shipSkill
- super-shipSkill
- token-auditSkill
- token-renameSkill
- visual-reviewSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Fix the advisory, nothing else: No opportunistic upgrades of unrelated packages.
≈ “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-advisory
CI's library job runs npm audit --audit-level=high --omit=dev, which judges the shipped dependency tree against the registry's advisory feed rather than the code (dev-only tooling is outside the gate; the comment beside that step in .github/workflows/ci.yml records why). A new advisory can therefore turn main red with no change in the repo, and the response is the same small ritual every time. This skill is that ritual. It ends with a verified local fix; making it live is ship's job.
When invoked
Run when CI's audit step fails, when npm audit locally reports a high or critical advisory, or when asked to patch a named vulnerable package. An advisory in dev-only tooling no longer fails CI, so a plain npm audit is the only place it shows: it is still worth fixing by the same routes when a fix exists, and worth leaving alone, with a note of why, when none does.
Scope guardrails (read first)
- Fix the advisory, nothing else. No opportunistic upgrades of unrelated packages; a dependency refresh is its own change. A fix that rides along with other work hides the one line a reviewer needs to see.
- Never
npm audit fix --force. It takes semver-major bumps without asking. A fix that needs a major is a decision for the owner, not a flag. - Never push, merge, or deploy. Hand off to
shipat the end.
Instructions
1. Read the advisory
npm audit
npm audit --json # when the human-readable output hides which path pulls the package inFor each high or critical finding, note: the vulnerable package, the patched range, whether it is a direct dependency of the root or a workspace or only transitive, and which parent pins it. Then read the advisory itself (the GHSA link npm audit prints) and check whether the vulnerable code path is one this repo actually reaches; that judgement goes in the commit message, so a reader knows how urgent the fix was. Example (fictional): an advisory against glob-walker below 4.2.1, pulled in only through a lint plugin's ^4.1.0 range, so the patched version is already inside the range a parent declares.
2. Pick the fix route
In order of preference:
- In-range, lockfile only. The patched version satisfies every range that declares the package, so only
package-lock.jsonchanges.npm audit fix(no--force) handles most of these; for a single named package,npm update <pkg>in the workspace that declares it does the same. This is the usual case: every advisory fix so far ingit log --oneline -- package-lock.jsontook this route. - Bump a direct dependency's range. The patched version sits outside the declared range of a package this repo depends on directly. Edit that range in the
package.jsonthat declares it, then install. - Root
overrides. A transitive parent pins the vulnerable version exactly and has not released a fix. Add the override to the rootpackage.json: npm honoursoverridesonly in the workspace root, so a copy inwebsite/package.jsonis silently ignored. Record why in the$comment-overridesnote beside it, including the condition under which the pin can retire, and read that note first, since an existing pin may already be the thing to adjust.
3. Apply and refresh the lockfile
Routes 1 and 2 run a real install (npm audit fix, npm update, or npm install after the range edit), which rewrites package-lock.json and node_modules together. Reach for npm install --package-lock-only only when the lockfile alone needs reconciling, for instance after hand-editing an override, and follow it with a plain npm install so the tree you test is the tree the lockfile describes. The release skill's step 3 has the reverse lesson: a lockfile left out of step with package.json dirties every later checkout.
4. Prove it took
npm ls <pkg> # every copy in the tree is now the patched version
npm audit --audit-level=high --omit=dev # exits clean: the exact gate CI runsnpm ls listing an old copy means some parent still resolves it; go back to step 2. The installed version is the test, not the invalid label: a parent that pins the package to one exact version makes npm ls print invalid beside a copy the override has correctly raised past that pin, and exit non-zero for it. That is the override working. What matters is that every copy shows the patched version and the audit below exits clean.
5. Verify
npm run verifyA patched transitive dependency can still change behaviour, and the site build exercises the paths the audit was worried about.
6. Commit and hand off
Commit only the manifest and lockfile changes as chore(deps): <what was bumped> for the <package> advisory, naming the advisory id, its severity, why it reached this repo, and whether the change was lockfile only. Then hand off: saying ship makes it live. Report the advisory, the route taken, the npm ls and audit results, and the verify result.
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.

