npm-security

Audit npm, pnpm, or bun dependency security and recommend fix commands.

1|Updated Jan 13, 2023
One-click install
npx skills add https://github.com/theodrosyimer/.dotfiles --skill npm-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: npm-security
Source: https://github.com/theodrosyimer/.dotfiles/tree/main/claude/skills/infra__npm-security
Command: npx skills add https://github.com/theodrosyimer/.dotfiles --skill npm-security

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many JavaScript projects are vulnerable to supply chain attacks, unsafe install scripts, lockfile tampering, and insecure publishing practices. This Skill helps developers and maintainers discover those risks in their repository configuration and provides actionable remediation steps to reduce attack surface and secure CI/publishing pipelines.

Core Features & Use Cases

  • Dual-mode operation: run a project audit that inspects package.json, lockfiles, CI configs and environment files, or use the reference mode to get best-practice guidance on a specific security topic.
  • Comprehensive checks: detects package manager, verifies postinstall script policies, enforces release cooldowns, validates lockfile integrity, ensures deterministic installs, flags blind upgrade scripts, recommends security tooling (npq, sfw), scans for plaintext secrets, and reviews publishing controls like provenance and OIDC.
  • Actionable fixes: for every failed check the Skill supplies the exact config snippet or command to fix the issue and suggests CI integration steps for automated enforcement.
  • Use cases: auditing a monorepo before onboarding contributors, vetting a new dependency before installation, hardening CI publish workflows, or adding lockfile validation to pipeline checks.

Quick Start

Audit this project's npm security posture and return a pass/fail checklist with specific fix commands for each failing item.

Frequently Asked Questions about npm-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit my Node dependency security posture against supply chain attacks?

To audit Node dependency security, run a project audit that inspects package.json, lockfiles, CI configs, and environment files to detect unsafe install scripts, lockfile tampering, and plaintext secrets while returning exact fix commands for each failing item.

How do I harden npm publishing workflows with provenance and OIDC?

Hardening npm publishing workflows involves reviewing publishing controls like provenance and OIDC, validating lockfile integrity, and suggesting CI integration steps for automated enforcement to secure your release pipelines against supply chain attacks.

How do I check for unsafe postinstall scripts in my pnpm or bun project?

Checking for unsafe postinstall scripts in pnpm or bun projects involves performing package manager detection and verifying postinstall script policies to flag blind upgrade scripts and reduce your repository's attack surface.

Does this dependency security audit work with monorepos and multiple package managers?

Yes, the dependency security audit works with monorepos and multiple package managers by detecting whether the project uses npm, pnpm, or bun, and then validating lockfile integrity and deterministic installs across the repository structure.

What is the best way to vet a new npm dependency before installation?

The best way to vet a new npm dependency before installation is to use a dual-mode reference mode that provides best-practice guidance on specific security topics, scans for plaintext secrets, and recommends security tooling like npq to ensure safe additions.

Why do I need lockfile validation in my CI pipeline?

Lockfile validation in your CI pipeline is needed to ensure deterministic installs and prevent lockfile tampering, reducing the risk of supply chain attacks by verifying lockfile integrity during automated dependency checks.