Hatch3r dep audit

From hatch3r/hatch3r · View interactive version

Hatch3r dep audit is an AI agent skill from the GitHub repository hatch3r/hatch3r. Audits and updates npm dependencies for security, freshness, and bundle impact. Use when auditing dependencies, responding to CVEs, or upgrading packages.

How to use this skill

Skill file

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.

Dependency Audit Workflow

Quick Start

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

Step 0 — Detect Ambiguity (P8 B1)

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 Discipline (P8 B2)

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, task_structure } in your output.

Required Agent Delegation

Note: When this skill is invoked via an orchestration pipeline (a commands/hatch3r-*.md flow), 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: "general-purpose") at the points below:

The drafter never applies and the fixer/devops never re-assess risk — the split keeps risk assessment separate from risk acceptance.

Step 1: Gather Findings

Step 2: Research CVEs

For critical and high vulnerabilities:

Step 3: Plan Upgrades

Before changing anything:

Step 4: Implement Upgrades

Step 5: Verify

${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.

Step 6: Open PR

Use the project's PR template. Include:

Error Handling

Tracking Issues for Deferred Items

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.

Definition of Done

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.