From hatch3r
Audits npm dependencies for security vulnerabilities, outdated packages, and bundle impact. Guides upgrade planning with CVE research and per-dependency proposals.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hatch3r:hatch3r-dep-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool when your project uses a different package manager.
Note: Commands below use
npmas an example. Substitute with your project's package manager (yarn,pnpm,bun) or build tool when your project uses a different package manager.
Task Progress:
- [ ] Step 0: Detect ambiguity (P8 B1)
- [ ] Step 1: Run npm audit + npm outdated, categorize findings
- [ ] Step 2: Research CVEs via web search for critical/high
- [ ] Step 3: Plan upgrades (breaking vs non-breaking, bundle impact)
- [ ] Step 4: Implement upgrades one-by-one, run tests after each
- [ ] Step 5: Verify quality gates and bundle size
- [ ] Step 6: Open PR with upgrade rationale
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per agents/shared/user-question-protocol.md. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: scope (critical/high only vs all), major-version-bump authority, bundle-size budget, deferral policy when no fix is available, and whether to also remove unused deps in the same pass.
Fan-out scales with task size; token cost never justifies serializing independent work (rules/hatch3r-fan-out-discipline.md P8 B2; agents/shared/efficiency-patterns.md). Emit sub_agents_spawned: { count, rationale } in your output.
Note: When this skill is invoked via an orchestration pipeline (a
commands/hatch3r-*.mdflow), skip this section — the orchestrator handles agent delegation.
This skill realizes the two-agent dependency pattern (governance PRD Decision 13, F13.1-F04): the agent that assesses upgrade risk is distinct from the agent that applies it. Spawn these agents via the Task tool (subagent_type: "generalPurpose") at the points below:
hatch3r-dependency-drafter (analysis phase, Steps 1–3) — MUST spawn to inventory the dependency surface, classify each candidate by SemVer band, cross-check advisories, and draft the per-dependency proposal (current pin → proposed pin, band, driver, risk, consumer call sites, verification gate). The drafter is read-only (its tools.deny forbids manifest edits and installs), so its proposal is a reviewable decision artifact, not a mutation. Skip only for a trivial single-package patch already scoped by the invocation.hatch3r-fixer (apply phase, Step 4) — MUST spawn under reviewer authority to perform the manifest edit + npm install + per-upgrade verification the drafter's proposal names. The fixer flips each proposal from drafted to applied after its row's verification gate passes.hatch3r-devops (apply phase, Step 4 — CI-wiring variant) — spawn instead of hatch3r-fixer when the upgrade requires CI manifest wiring (lockfile-cache keys, build-matrix version pins, Renovate/Dependabot config) rather than only a source-tree dependency bump.The drafter never applies and the fixer/devops never re-assess risk — the split keeps risk assessment separate from risk acceptance.
npm audit and capture output. Categorize by severity: critical, high, moderate, low.npm outdated to identify packages with newer versions.For critical and high vulnerabilities:
platform in .hatch3r/hatch.json):
gh api /repos/{owner}/{repo}/security-advisories)Before changing anything:
npm run build and measure before/after for each upgrade.npm install, then npm run lint && npm run typecheck && npm run test.package-lock.json — never use npm install --no-save.${HATCH3R:VERIFY_GATE_ALL}
npm run build
The gate line is resolved to the project's language-aware command set at sync time (fallback when detection is unknown: npm run lint && npm run typecheck && npm run test); the build line is illustrative — substitute the project's build command.
npm audit — no critical or high vulnerabilities remaining.package-lock.json is committed by checking git status for untracked or modified lockfile.Use the project's PR template. Include:
npm audit reports vulnerabilities with no fix available: Document the vulnerability, assess exploitability in the project context, and create a tracking issue. If the risk is high, evaluate alternative packages.rm package-lock.json && npm install), verify all tests pass, and commit the clean lockfile.For CVEs or outdated packages not addressed in this session, create a tracking issue on the project's platform (GitHub Issues, ADO Work Item, or GitLab Issue per platform in .hatch3r/hatch.json). Use severity-based priority labels: Critical/High → priority:p0/priority:p1; Medium/Low → priority:p2; Major outdated → priority:p2; Minor/patch → priority:p3. Include package name, current version, target version, severity, CVE ID (if applicable), and migration notes. Never close out a critical/high CVE without either a fix or a tracking issue.
package-lock.json committednpm audit severity buckets (critical/high/moderate/low) and npm outdated semantics used in Step 1.gh api /repos/{owner}/{repo}/security-advisories CVE-research path in Step 2.npx claudepluginhub hatch3r/hatch3r --plugin hatch3rAudits npm dependencies for vulnerabilities and outdated packages, reporting CVEs with fix commands and severity levels.
Audits project dependencies for CVEs using detected package manager, reports vulnerabilities with installed/fixed versions and exact upgrade commands. Includes auto-fix and banned-packages check.
Scans projects for outdated npm/pip/Cargo/Go/Ruby packages. Runs CVE audit, fetches changelogs, summarizes breaking changes with Gemini, and opens one PR per risk group (patch/minor/major).