Cfn dep audit

From masharratt/claude-flow-novice · View interactive version

Cfn dep audit is an AI agent skill from the GitHub repository masharratt/claude-flow-novice. Supply-chain gate for new and existing dependencies. Enforces the ~90-day cooldown on NEW deps and the take-CVE-fixes-immediately carve-out. Runs npm audit / osv-scanner / cargo audit when present, flags newly added deps younger than the cooldown, and emits a manifest for cfn-vote-implement. Degrade

How to use this skill

Skill file

CFN Dependency Audit

Purpose: Enforce the two dependency policies from CLAUDE.md and code-quality.md:

  1. ~90-day cooldown on NEW dependencies. A new dependency is the last rung of the build ladder (YAGNI to reuse to stdlib to native to installed-dep to one line to minimum new code to NEW dep). When a dep is genuinely new, pin it with a ~90-day supply-chain cooldown, then move forward progressively.
  2. CVE carve-out: take CVE fixes immediately. The cooldown is overridden by a security patch. Known-vulnerability fixes ship now, no waiting.

This is the supply-chain counterpart to cfn-security-review. It does not read your code; it reasons about what you depend on. Findings route through cfn-vote-implement. This skill never auto-installs or auto-upgrades.

What It Checks

| Check | Tool | Result |

|-------|------|--------|

| Known vulnerabilities (npm) | npm audit --json | high/critical advisories surface as cve findings (high severity, immediate). |

| Known vulnerabilities (broader) | osv-scanner (optional) | vulnerable packages surface as cve findings. |

| Known vulnerabilities (Rust) | cargo audit (optional) | RUSTSEC advisories surface as cve findings. |

| Cooldown (npm) | npm view <pkg> time | newly added deps younger than the cooldown surface as cooldown warnings. |

| Cooldown (Rust) | crates.io API via curl | newly added crates younger than the cooldown surface as cooldown warnings. |

"Newly added" means added in the staged diff (--cached), or failing that the last commit (HEAD~1), of package.json / Cargo.toml.

For npm, "newly added" is computed structurally: the dependency key set (dependencies, devDependencies, peerDependencies, optionalDependencies) of the current package.json is diffed against the base ref (lib/npm-new-deps.sh). A scripts entry, formatting change, or any non-dependency key can never be flagged as a new package. Dependency gates diff structured dependency keys — never raw file lines.

Graceful Degradation

Every check is best-effort. If a tool is missing or the network is unavailable, that check is skipped and listed under "checks skipped", not failed. The script always reports which checks actually ran so you know your coverage. With no package.json and no Cargo.toml, it exits clean with "nothing to audit".

Severity Model

Inputs

Outputs

Usage

$HOME/.claude/skills/cfn-dep-audit/execute.sh
CFN_DEP_COOLDOWN_DAYS=120 ./.claude/skills/cfn-dep-audit/execute.sh

# route any findings through voting
/cfn-vote-implement latest

Manifest Schema (shared with cfn-vote-implement)

{
  "review_id": "dep-audit-<ns>",
  "source": "cfn-dep-audit",
  "generated_at": "ISO-8601",
  "cooldown_days": 90,
  "suggestions": [
    {
      "id": "S001",
      "category": "cve | cooldown",
      "tag": "block | cooldown | info",
      "one_liner": "lodash: npm audit: high severity advisory",
      "title": "cve: lodash",
      "description": "npm audit: high severity advisory",
      "files": ["package.json or Cargo.toml"],
      "impact": "high | medium | low",
      "effort": "low",
      "suggested_approach": "Apply the fix now. CVE fixes are exempt from the cooldown.",
      "related_suggestions": []
    }
  ]
}

Rules

Related

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.