CommandOpen

Security (dependency-audit)

Audit project dependencies for known vulnerabilities and outdated packages.

Audit project dependencies for known vulnerabilities and outdated packages.

Steps

  1. Detect the package manager and run the native audit command:
  • npm: npm audit --json
  • pnpm: pnpm audit --json
  • yarn: yarn audit --json
  • pip: pip-audit --format json or safety check --json
  • cargo: cargo audit --json
  • go: govulncheck ./...
  1. Parse audit results and categorize by severity (critical, high, moderate, low).
  2. For each vulnerability:
  • Identify the affected package and version range.
  • Check if a patched version is available.
  • Determine if it is a direct or transitive dependency.
  • Assess actual exploitability in the project context.
  1. Check for outdated dependencies: npm outdated, pip list --outdated.
  2. Generate an upgrade plan prioritized by:
  • Critical vulnerabilities first.
  • Direct dependencies over transitive.
  • Minimal version bumps (patch > minor > major).
  1. Test compatibility of recommended upgrades if possible.
  2. Offer to apply safe upgrades automatically.

Format

Dependency Audit Report
=======================

Vulnerabilities: <critical>C / <high>H / <moderate>M / <low>L

| Package | Current | Patched | Severity | Type | CVE |
|---------|---------|---------|----------|------|-----|

Outdated (no vulnerabilities):
| Package | Current | Latest | Type |
|---------|---------|--------|------|

Recommended actions:
1. <action with command>

Rules

  • Always distinguish between direct and transitive dependencies.
  • Do not auto-upgrade major versions without user confirmation.
  • Report vulnerabilities even if no fix is available yet.
  • Check that lock files are committed and up to date.
  • Verify upgrades do not break the test suite before recommending them.

Source: https://github.com/rohitg00/awesome-claude-code-toolkit/blob/main/commands/security/dependency-audit.md

Author: rohitg00, Claude Code toolkit (rohitg00). License: Apache-2.0.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.