Agent skill

Auditing npm Dependencies

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Audit a Node.js project's installed npm dependency tree for known CVEs by wrapping the npm audit JSON output and emitting findings in the canonical penetration-tester schema.

MITAuto-check: notesSecurity

Install Auditing npm Dependencies

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill auditing-npm-dependencies -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace auditing-npm-dependencies --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/auditing-npm-dependencies .claude/skills/auditing-npm-dependencies && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
auditing-npm-dependencies
GitHub stars
2.8k
Token cost
~2.5k tokens
SKILL.md length
997 words
Files
4 (incl. scripts, references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Audit a Node.js project's installed npm dependency tree for known CVEs by wrapping the npm audit JSON output and emitting findings in the canonical penetration-tester schema.

  • Works in 4 steps: Identify the scan target → Run the audit → Interpret findings → …
  • : pre-merge gate on a Node project
  • SKILL.md covers Overview, When the skill produces findings, Prerequisites and Instructions, plus 4 more sections
  • Runs Python scripts from its folder; calls npm, python3 and jq

What it does

Auditing npm Dependencies is an agent skill from jeremylongshore/tons-of-skills-marketplace. Audit a Node.js project's installed npm dependency tree for known CVEs by wrapping the npm audit JSON output and emitting findings in the canonical penetration-tester schema. Detects direct AND transitive vulnerabilities, normalizes npm's severity scale (info/low/moderate/ high/critical) to the shared Severity enum, and parses both v1 and v2 audit output formats so the skill works against npm 6 and npm 7+ lockfiles. Use when: pre-merge gate on a Node project, post-incident sweep after a transitive package…

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts and reference files (for example `references/PLAYBOOK.md`, `references/THEORY.md` and `scripts/audit_npm.py`). Compatibility notes: Designed for Claude Code

It sits in Security, covering Dependency management, Vulnerability scanning and Digital forensics. It works with npm and Node.js. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • : pre-merge gate on a Node project
  • Post-incident sweep after a transitive package compromise (e.g
  • With: audit npm deps
  • Npm vulnerability scan

Example prompts

  • “audit npm deps”
  • “npm vulnerability scan”
  • “check node packages for CVEs”
  • “/auditing-npm-dependencies”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Bash(npm:*), Bash(python3:*), Glob

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Identify the scan target
  2. Run the audit
  3. Interpret findings
  4. Remediation

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash(npm:*)
    • Bash(python3:*)
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • npm
    • python3
    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Auditing npm Dependencies loads about 2.5k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 227 tokens; SKILL.md has 997 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~227
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:28
    - Write(.env)
  • NoteMentions a .env fileSKILL.md:29
    - Edit(.env)

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 997 words, ~2,473 tokens.

Download SKILL.mdSave it as .claude/skills/auditing-npm-dependencies/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
auditing-npm-dependencies
description
Audit a Node.js project's installed npm dependency tree for known CVEs by wrapping the npm audit JSON output and emitting findings in the canonical penetration-tester schema. Detects direct AND transitive vulnerabilities, normalizes npm's severity scale (info/low/moderate/ high/critical) to the shared Severity enum, and parses both v1 and v2 audit output formats so the skill works against npm 6 and npm 7+ lockfiles. Use when: pre-merge gate on a Node project, post-incident sweep after a transitive package compromise (e.g. event-stream, ua-parser, node-ipc, color.js), SOC2 vendor-management evidence collection, or auditing an inherited or acquired Node codebase. Threshold: any HIGH or CRITICAL CVE in the resolved dependency tree. MODERATE / LOW reported informationally. Trigger with: "audit npm deps", "npm vulnerability scan", "check node packages for CVEs", "npm audit".
allowed-tools
Read, Bash(npm:*), Bash(python3:*), Glob
compatibility
Designed for Claude Code
disallowed-tools
Bash(rm:*), Bash(curl:*), Bash(wget:*), Write(.env), Edit(.env), Bash(npm publish:*), Bash(npm install:*)
version
3.30.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
security, dependency-audit, npm, cve, pentest

Auditing npm Dependencies

Overview

Modern Node.js applications pull in hundreds of transitive packages through a single npm install. The ratio of direct-to-transitive dependencies on a typical app is around 1:50 — install 30 packages, end up with 1,500. Every one of those packages can ship a CVE, get maintainer-takeover-attacked, or contain a typosquatted near-name package that someone slipped into your lockfile.

The published-CVE feed for npm is among the busiest in the ecosystem because the registry is shared, public, and trivially installable. npm audit queries the same advisory database GitHub's Dependabot uses, returning per-package vulnerability records with CVE ID, severity, affected version range, and fix-available version. Running it is free and fast; the friction is interpreting the output and deciding which findings actually block your release.

This skill standardizes that interpretation. It wraps npm audit --json, parses both the v1 (npm 6) and v2 (npm 7+) output shapes, maps npm's severity vocabulary to the shared Severity enum, and emits Findings in the canonical penetration-tester JSON shape so downstream tooling (CI gates, security dashboards, SOC2 evidence collection) gets uniform records regardless of which package manager surfaced them.

When the skill produces findings

FindingSeverityThresholdAffected control
Critical CVE in direct depCRITICALnpm severity: critical AND package in dependencies of root package.jsonCWE-1104
Critical CVE in transitive depCRITICALnpm severity: critical AND package NOT in root dependenciesCWE-1104
High CVE in direct depHIGHnpm severity: high AND directCWE-1104
High CVE in transitive depHIGHnpm severity: high AND transitiveCWE-1104
Moderate CVEMEDIUMnpm severity: moderateCWE-1104
Low CVELOWnpm severity: lowCWE-1104
Info advisoryINFOnpm severity: infoCWE-1104
Vulnerable package with no patchHIGHfinding has no fix.available and severity ≥ moderateCWE-1395
Audit registry unreachableINFOnpm exits non-zero with network error(operational)
Audit returns malformed outputINFOJSON parse fails on npm audit --json stdout(operational)

Direct vs transitive matters: a CVE in lodash you require directly is fixable by upgrading your package.json. A CVE in lodash pulled in transitively through aws-sdk requires either upgrading aws-sdk to a version with a newer lodash floor, or pinning via overrides in your root package.json.

Prerequisites

  • Node.js + npm installed on the host running the scan (npm 6+ supported; npm 7+ recommended for richer output)
  • Target project directory containing package.json and at minimum one of package-lock.json, npm-shrinkwrap.json
  • Network access to the npm registry (registry.npmjs.org by default)

Instructions

Step 1 — Identify the scan target

Locate the project directory. The scanner expects package.json at the directory root. Monorepos with multiple package.json files should be scanned per package; the scanner does not auto-traverse workspaces (use npm audit --workspaces separately for that case).

Step 2 — Run the audit
bash
python3 ./scripts/audit_npm.py /path/to/node-project

Options:

Usage: audit_npm.py PATH [OPTIONS]

Options:
  --output FILE      Write findings to FILE (default: stdout)
  --format FMT       json | jsonl | markdown (default: markdown)
  --min-severity SEV (default: info)
  --include-dev      Audit `devDependencies` too (default: prod only)
  --no-cache         Pass --no-audit-cache to npm (slower; fresh data)
  --json-only        Print raw `npm audit --json` and exit (debug)

The scanner shells out to npm audit --json in the target directory, parses the output, deduplicates per-CVE across direct and transitive paths, and emits one Finding per CVE.

Step 3 — Interpret findings

CRITICAL / HIGH = block the release. Either bump the vulnerable package to the fix version (most common), or apply an npm overrides entry if the transitive dep can't be reached through a parent bump.

MEDIUM / LOW = file a remediation ticket but don't block. These often require waiting for the upstream maintainer to ship a fix.

INFO = log only. Informational advisories sometimes flag deprecated packages without an active vulnerability.

Show full SKILL.md (455 more words)Show less
Step 4 — Remediation

For a CVE in a DIRECT dep:

  1. Run npm audit fix — npm attempts a non-breaking upgrade.
  2. If npm audit fix says "requires manual review" (semver-major bump), evaluate the breaking changes and decide whether to upgrade or accept the risk. Document the decision.
  3. Pin the resolved version in package-lock.json; commit the diff.

For a CVE in a TRANSITIVE dep:

  1. Identify the path: npm ls <vulnerable-package> shows which parent(s) pull it in.

  2. Check whether bumping the parent picks up the fix: npm view <parent> dependencies lists the parent's declared range.

  3. If parent has a newer version that floors the vulnerable dep above the fix-version, upgrade the parent.

  4. Otherwise add an overrides block in your root package.json:

    json
    "overrides": {
      "<vulnerable-package>": "<fix-version>"
    }

    This requires npm 8.3+ and forces the resolution. Document why you're overriding — overrides are easy to forget about.

For a CVE with NO fix available:

  1. Subscribe to the GitHub Security Advisory for that CVE.
  2. If exploitable in your usage context, replace the package or vendor it with a private patch.
  3. Document the exception with a date for re-evaluation.

Examples

Example 1 — Pre-merge gate
bash
python3 ./scripts/audit_npm.py . --min-severity high --format json --output npm-audit.json
jq -e '. == []' npm-audit.json || { echo "High/critical npm CVE — fix before merge"; exit 1; }
Example 2 — CI scan on every push
yaml
- name: npm dependency audit
  run: |
    python3 plugins/security/penetration-tester/skills/auditing-npm-dependencies/scripts/audit_npm.py \
        . --min-severity high --format markdown --output npm-audit.md
- name: Upload audit
  uses: actions/upload-artifact@v4
  with:
    name: npm-audit
    path: npm-audit.md
Example 3 — SOC2 evidence collection
bash
python3 ./scripts/audit_npm.py . --include-dev --no-cache --format json \
    --output evidence/CC7-npm-audit-$(date +%Y%m%d).json

--include-dev is important for SOC2 evidence: auditors want the full picture, not just production deps. --no-cache ensures the evidence reflects current advisory data, not yesterday's cache.

Output

JSON / JSONL / Markdown per lib/report.py. Exit codes: 0 clean, 1 high/critical, 2 error.

Each Finding includes:

  • id — synthesized as npm-audit::<cve-id> (or npm-audit::<advisory-id> when no CVE assigned)
  • severity — CRITICAL / HIGH / MEDIUM / LOW / INFO
  • category — dependency-vulnerability
  • summary — short CVE title
  • evidence — affected package, affected version range, fix version (if any), dependency path
  • references — GHSA URL, CVE URL, npm advisory URL

Error Handling

  • npm not installed → exits 2 with operational error advising the operator to install Node.js.
  • No package.json → exits 2 with "target is not a Node project" error.
  • npm registry unreachable → emits an INFO Finding documenting the outage and exits 0 (no actionable security finding).
  • npm audit returns non-JSON garbage → emits an INFO Finding and exits 2. Sometimes happens with corrupt npm cache; advise the operator to run npm cache clean --force and retry.
  • Lockfile out of sync with package.json → npm warns and may produce partial results; the scanner emits an INFO Finding flagging the desync and proceeds with whatever data npm returns.

Resources

  • references/THEORY.md — Why npm's dependency graph is the largest CVE surface in modern software, history of npm supply-chain attacks (event-stream, ua-parser-js, color.js, node-ipc), direct-vs-transitive remediation theory, when overrides are safe, npm audit v1 vs v2 output schema diff
  • references/PLAYBOOK.md — Per-runtime remediation patterns (frontend webpack/vite, Node server, Electron desktop, Lambda), parent-bump decision matrix, override-block templates, GitHub Dependabot integration, SOC2 evidence retention policy

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in skills/.curated/auditing-npm-dependencies of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/PLAYBOOK.md
  • references/THEORY.md
  • scripts/audit_npm.py

Open the folder on GitHubat commit cfae287

Compare with similar skills

Auditing npm Dependencies next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Auditing npm Dependencies compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Auditing npm Dependencies this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.5kAutomated safety check: NotesMIT
npm Supply Chain Checkmajiayu000/spellbook287—~1.5kAutomated safety check: PassMIT
Dep Securitytinyfish-io/tinyfish-cookbook2.2k—~2.4kAutomated safety check: PassMIT
Cve Scansoftspark/ai-toolkit180—~1.3kAutomated safety check: NotesApache-2.0
Sca AuditOWASP/secure-agent-playbook188—~494Automated safety check: PassCC-BY-4.0
Dependency Scanjwynia/agent-skills170—~1.7kAutomated safety check: PassMIT

Similar skills

  • npm Supply Chain Check

    majiayu000/spellbook

    Scans a repository, its lockfiles and node_modules for known malicious npm package versions and install-time indicators, using a read-only Python scanner.

    287 GitHub stars~1.5k tokensUpdated 2 days ago
    SecurityAuto-check passed
  • Dep Security

    tinyfish-io/tinyfish-cookbook

    Check every dependency in a package.json against live CVE databases and security advisories in real time — specifically targeting vulnerabilities disclosed in the last 48 hours, the window that…

    2.2k GitHub stars~2.4k tokensUpdated 2 days ago
    SecurityAuto-check passed
  • Cve Scan

    softspark/ai-toolkit

    Scans deps for known CVEs via native audit (npm, pip, composer, cargo, go, bundler, dart).

    180 GitHub stars~1.3k tokensUpdated yesterday
    SecurityAuto-check: notes
  • Sca Audit

    OWASP/secure-agent-playbook

    Scan project dependencies for known vulnerabilities (CVEs). An agent skill from OWASP/secure-agent-playbook.

    188 GitHub stars~494 tokensUpdated 15 days ago
    SecurityAuto-check passed
  • Dependency Scan

    jwynia/agent-skills

    Detect CVEs and security issues in project dependencies. An agent skill from jwynia/agent-skills.

    170 GitHub stars~1.7k tokensUpdated 7 mo ago
    SecurityAuto-check passed
  • Container Cve Fix Validator

    infometa/workbuddyskills

    容器安全CVE漏洞修复验证引擎。从容器漏扫报告(Excel)自动提取漏洞,生成修复计划, SSH到测试环境验证OS包(apt/yum/apk)、Python(pip)、Node.js(npm)、Java(JAR)四种包类型的 修复方案,产出修复验证报告。不涉及主机层漏洞修复、不处理容器编排层安全配置。

    348 GitHub stars~779 tokensUpdated yesterday
    SecurityAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Auditing npm Dependencies

What does Auditing npm Dependencies do?

Audit a Node.js project's installed npm dependency tree for known CVEs by wrapping the npm audit JSON output and emitting findings in the canonical penetration-tester schema. Auditing npm Dependencies is an agent skill from jeremylongshore/tons-of-skills-marketplace.js project's installed npm dependency tree for known CVEs by wrapping the npm audit JSON output and emitting findings in the canonical penetration-tester schema.

When should I use Auditing npm Dependencies?

Auditing npm Dependencies fits situations like: : pre-merge gate on a Node project; post-incident sweep after a transitive package compromise (e.g; with: audit npm deps; npm vulnerability scan.

How do I install Auditing npm Dependencies in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill auditing-npm-dependencies -a claude-code`. Or copy the skill folder (skills/.curated/auditing-npm-dependencies in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/auditing-npm-dependencies in your project. Claude Code loads it when a task matches its description.

How do I install Auditing npm Dependencies in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill auditing-npm-dependencies -a codex`. Or copy the skill folder (skills/.curated/auditing-npm-dependencies in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/auditing-npm-dependencies in your project. Codex loads it when a task matches its description.

Can I use Auditing npm Dependencies in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill auditing-npm-dependencies -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/auditing-npm-dependencies, .gemini/skills/auditing-npm-dependencies, .github/skills/auditing-npm-dependencies and .opencode/skills/auditing-npm-dependencies in your project.

What does Auditing npm Dependencies need to run?

Going by SKILL.md and its folder, Auditing npm Dependencies needs Python for the scripts in its folder and the command-line tools its instructions call (npm, python3 and jq). Our summary lists: Python 3; Node.js. Its frontmatter pre-approves these tools: Read, Bash(npm:*), Bash(python3:*), Glob. Compatibility (from SKILL.md): Designed for Claude Code.

Does Auditing npm Dependencies access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Auditing npm Dependencies safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Auditing npm Dependencies use?

Auditing npm Dependencies is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Auditing npm Dependencies use?

About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.7k tokens, read only when the agent opens those files.

What are the alternatives to Auditing npm Dependencies?

Skills that share tags, products or a category with Auditing npm Dependencies: npm Supply Chain Check (majiayu000/spellbook, 287 stars), Dep Security (tinyfish-io/tinyfish-cookbook, 2.2k stars), Cve Scan (softspark/ai-toolkit, 180 stars) and Sca Audit (OWASP/secure-agent-playbook, 188 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Auditing npm Dependencies?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.