npm-audit-fix

npm-audit-fix is a command for Cursor from ivangrynenko/cursorrules. It costs 0 tokens per session (1,498 once invoked), scanned A, original, MIT.

A command for finding and fixing security problems reported in NPM packages, which are reusable JavaScript dependencies. It also checks that front-end assets still build in host and Docker environments.

In plain words
What is it for?
Use it in Drupal theme projects to inspect package files and lockfiles, identify the package manager, fix NPM audit findings, and update build guidance.
Why use it?
It combines vulnerability remediation with build checks, reducing the chance that updating dependencies breaks the project’s CSS or JavaScript.

Command for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ivangrynenko/cursorrules/npm-audit-fix
Clone the repo
git clone --depth 1 https://github.com/ivangrynenko/cursorrules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for npm-audit-fix

README.md
[![agentmods](https://agentmods.dev/badge/commands/ivangrynenko/cursorrules/npm-audit-fix.svg)](https://agentmods.dev/commands/ivangrynenko/cursorrules/npm-audit-fix)
Your own site
<a href="https://agentmods.dev/commands/ivangrynenko/cursorrules/npm-audit-fix"><img src="https://agentmods.dev/badge/commands/ivangrynenko/cursorrules/npm-audit-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,498 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01498
Opus 5 $0.00000 $0.00749
Sonnet 5 $0.00000 $0.00300
Haiku 4.5 $0.00000 $0.00150

Measured 4d ago against content hash 3706da5e9b21, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

npm-audit-fix scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/commands/npm-audit-fix.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Custom Command: NPM Audit Fix

Command Usage

/npm-audit-fix [path]

Provide an optional project path (defaults to the repository root). The instructions below describe how to audit and remediate NPM vulnerabilities in the target project.

You will help audit and remediate NPM vulnerabilities in a Drupal theme project. The project uses NPM packages to build front-end assets like CSS and JavaScript, and may use NPM, Yarn, or other package managers.

Here is the project path you'll be working with:

<project_path> the project root path </project_path>

Your goal is to investigate the project setup, fix security vulnerabilities, ensure assets build properly in both host and Docker environments, and update documentation to guide developers on front-end asset rendering.

Before executing the remediation steps, wrap your analysis in <project_analysis> tags to systematically document your findings. It's OK for this section to be quite long. Include:

  • File Structure: List the key files found in the project (package.json, lock files, Docker files, .nvmrc, etc.)
  • Package Manager Detection: Identify which package manager is being used and document the evidence
  • Build Environment: Determine if builds happen on host vs Docker and identify the build commands
  • Node Version: Check for .nvmrc or other version specifications
  • Git Baseline: Record the current git status to establish a baseline
  • Vulnerability Assessment: Run and document the results of npm/yarn audit, listing each vulnerability with its severity
  • Remediation Strategy: Plan your approach for fixing vulnerabilities while minimizing breaking changes

Before proceeding, make sure the PHP runtime has access to the same project files as the CLI container. The PHP image in this stack does not mount the module code by default, so you must manually sync the files before attempting any audits or Drupal commands:

Mandatory Container Sync (must be performed manually by the assistant)

  • Identify the running PHP pod/container for the target environment. For Lagoon-based stacks use kubectl get pods -l lagoon.sh/project=<project-name>,lagoon.sh/service=php (or the equivalent kubectl get pod command provided by the platform). For local Docker Compose environments use docker compose ps php to confirm the container name.
  • Determine the CLI container name (typically <project-name> locally or the Lagoon CLI pod). This container has the authoritative Drupal codebase.
  • Copy the missing module directories from the CLI container to the PHP container so PHP can load them. Example (Docker): docker cp $(docker compose ps -q cli):/app/web/modules/. $(docker compose ps -q php):/app/web/modules/ and repeat for any other required paths (e.g. /app/vendor, /app/web/profiles). Example (Lagoon/Kubernetes): kubectl cp <cli-pod>:/app/web/modules <php-pod>:/app/web/modules -c php.
  • Verify inside the PHP container that the expected module (e.g. upgrade_status) now exists under /app/web/modules/contrib. Do not restart or recreate containers; only manual copying is permitted.

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 122 lines · 0 tokens per session scan A 3706da5e9b21

Subscribe to this mod's changes

npm-audit-fix is a command published in the GitHub repository ivangrynenko/cursorrules (88 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,498 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.