Agent skill

npm Supply Chain Security

by bodadotsh in bodadotsh/npm-security-best-practices

Applies safer package manager defaults and dependency vetting to JavaScript and TypeScript projects to reduce supply-chain attack risk.

MITAuto-check: warningsSecurity

Install npm Supply Chain Security

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add bodadotsh/npm-security-best-practices --skill npm-security -a claude-code

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

GitHub CLI
$ gh skill install bodadotsh/npm-security-best-practices npm-security --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/bodadotsh/npm-security-best-practices.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/npm-security .claude/skills/npm-security && 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
npm-security
GitHub stars
858
Token cost
~1k tokens
SKILL.md length
465 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Applies safer package manager defaults and dependency vetting to JavaScript and TypeScript projects to reduce supply-chain attack risk.

  • Planning which third-party packages a project should depend on
  • SKILL.md covers Best Practices, Planning stage / package scorers, Install stage / package scanners and References
  • Calls npm and npx; reaches mcp.socket.dev
  • Installing or updating dependencies in an npm, pnpm, yarn, bun or deno project

What it does

This skill sets safer defaults for JavaScript and TypeScript projects so installing dependencies is less exposed to supply-chain attacks. It uses npm for its examples but tells the agent to check which package manager is present (npm, pnpm, yarn, bun or deno), confirm its version and verify settings against the official documentation. It never overrides a configuration the user has set on purpose.

Three defaults apply unless the user has chosen otherwise: lifecycle scripts such as preinstall and postinstall are switched off (ignore-scripts=true in .npmrc), new releases must age through a cooldown of 3 days (min-release-age=3), and exact versions are saved instead of ranges (save-exact=true). They go into the project's .npmrc only for keys not already set. When choosing third-party packages, it suggests scoring candidates first with the Socket MCP server, deps.dev or OpenSSF Scorecard, and rejecting those below a health threshold the user sets, or a sensible default of around 80.

When your agent uses it

  • Planning which third-party packages a project should depend on
  • Installing or updating dependencies in an npm, pnpm, yarn, bun or deno project
  • Configuring .npmrc with ignore-scripts, exact versions and a release-age cooldown
  • Scoring package candidates before adding them

Example prompts

  • “Harden this project's npm setup against supply-chain attacks without overriding settings I already chose.”
  • “Before adding a date library, score the candidates with the Socket MCP server and OpenSSF Scorecard.”
  • “Update the dependencies in this pnpm workspace while respecting a cooldown on brand-new releases.”

Requirements

  • A JavaScript or TypeScript project using npm, pnpm, yarn, bun or deno

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • npx

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • mcp.socket.dev

    Also links to:

    • github.com
    • deps.dev
    • boda.sh
    • docs.npmjs.com
    • pnpm.io
    • yarnpkg.com
    • bun.sh
    • docs.deno.com

    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.

Context cost

npm Supply Chain Security loads about 1k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 465 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~1k

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: warnings

The automated check found patterns that need a careful read before installing.

  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:17
    In `.npmrc`, this can be set as `ignore-scripts=true`, or through install command: `npm install --ignore-scripts <packag
  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:23
    In `.npmrc`, this can be set as `min-release-age=3`, or through install command `npm install --min-release-age=3 <packag
  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:29
    In `.npmrc`, this can be set as `save-exact=true`, or through install command `npm install --save-exact <package>`
  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:31
    Persist these defaults in the project `.npmrc` (or the package manager’s equivalent), merging only keys that are unset;

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from bodadotsh/npm-security-best-practices at commit 24fb07d, republished under its MIT licence (© bodadotsh). 465 words, ~1,027 tokens.

Download SKILL.mdSave it as .claude/skills/npm-security/SKILL.md (or your agent's skills folder).
name
npm-security
description
Prevent JavaScript/TypeScript projects from supply-chain attacks across package managers like npm, pnpm, yarn, bun, and deno. Use whenever planning, installing, updating dependencies or configuring package managers

Apply the following security best practices. NEVER override an explicit user opt-in config (lifecycle scripts, cooldowns, save prefix, etc) unless they ask. Always check current package manager's verions, and verify against their official documentations.

Best Practices

Best practices are safer and sensible environmental defaults that should be enabled for the agent's runtime, we are using npm as example here but you should check to see which package manager is available and apply the configurations according.

Lifecycle scripts

Unless explicitly defined otherwise, package managers should have lifecycle scripts set as off, for example preinstall and postinstall.

In .npmrc, this can be set as ignore-scripts=true, or through install command: npm install --ignore-scripts <package>.

Dependency cooldowns / minimum release age

Unless explicitly defined otherwise, dependency installations should respect a cooldown period (default to 3 days).

In .npmrc, this can be set as min-release-age=3, or through install command npm install --min-release-age=3 <package>.

Exact versions

Unless explicitly defined otherwise, package installations should install the expact version instead of a semver range.

In .npmrc, this can be set as save-exact=true, or through install command npm install --save-exact <package>

Persist these defaults in the project .npmrc (or the package manager’s equivalent), merging only keys that are unset; never overwrite existing values unless the user asks.

Planning stage / package scorers

When planning third-party dependencies, we should score package candidates first. This reduces risk of greyware (not malware, but can be trollware, abandonware, low quality, license changes, etc).

Few free and trustworthy scorers are:

For example, Socket MCP server can be figured as:

json
{
  "mcpServers": {
    "socket-mcp": {
      "type": "http",
      "url": "https://mcp.socket.dev/"
    }
  }
}

Once installed, use the MCP to ask questions like:

  • "Check the security score for express version 4.18.2"
  • "Analyze the security of my package.json dependencies"
  • "What are the vulnerability scores for react, lodash, and axios?"

The user should set a policy of when to reject dependencies based on their health metrics (quality, supply chain, maintenance, etc), else default to a sensible number (e.g., 80).

Show full SKILL.md (141 more words)Show less

Install stage / package scanners

When it is time to install third-party dependencies, we should wrap the installation command with a package scanner first. This reduces risk of compromises as the scanner will check against a real-time intelligence database.

Few free and trustworthy scanners are:

FOr example, the sfw cli can be downloaded first through npm i -g sfw or through npx: npx sfw npm install <package>

Even as a popular and well-known package passes the planning/scoring stage, the installation/scanning stage can catch it if they get compromised.

References

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

Files

Just SKILL.md in skills/npm-security of bodadotsh/npm-security-best-practices.

Open the folder on GitHubat commit 24fb07d

Compare with similar skills

npm Supply Chain Security 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.

npm Supply Chain Security compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
npm Supply Chain Security this skillbodadotsh/npm-security-best-practices858—~1kAutomated safety check: WarnMIT
Linea Dependency MaintenanceConsensys-Incorporated/linea-attestation-registry1771 repos~3.7kAutomated safety check: WarnMIT
Migrate to Denodenoland/skills100—~2.2kAutomated safety check: WarnMIT
Check npmgrafana/skills281—~1.3kAutomated safety check: WarnApache-2.0
npm Supply Chain Checkmajiayu000/spellbook287—~1.5kAutomated safety check: PassMIT
Stash Supply Chain Securitycipherstash/stack157—~5.2kAutomated safety check: WarnMIT

Similar skills

  • Linea Dependency Maintenance

    Consensys-Incorporated/linea-attestation-registry

    Safely plan and execute dependency maintenance for JavaScript/TypeScript (npm, pnpm) and GitHub Actions, including npm lockfiles, pnpm workspaces, catalogs, overrides, SHA-pinned action versions…

    177 GitHub starsUsed in 1 repo~3.7k tokens
    DevelopmentAuto-check: warnings
  • Migrate to Deno

    denoland/skills

    Official

    Moves a Node.js, npm, Yarn, pnpm or Bun project to Deno in reversible steps, starting with Deno as the package manager and changing no code unless needed.

    100 GitHub stars~2.2k tokensUpdated 2 mo ago
    DevelopmentAuto-check: warnings
  • Check npm

    grafana/skills

    Official

    Audit a JavaScript/TypeScript repo's npm, yarn, or pnpm configuration for supply-chain hardening: tool version, lifecycle scripts, unsafe dependency protocols, and minimum release age ≥3 days.

    281 GitHub stars~1.3k tokensUpdated yesterday
    DevOps & CloudAuto-check: warnings
  • 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 yesterday
    SecurityAuto-check passed
  • Supply-chain security controls for the @cipherstash/stack monorepo.

    157 GitHub stars~5.2k tokensUpdated today
    DevelopmentAuto-check: warnings
  • Interlinked Supply Chain

    QuentinCody/interlinked-cli

    Respond to blocked package installs and manage the Interlinked supply-chain allowlist.

    178 GitHub stars~2.8k tokensUpdated 7 days ago
    SecurityAuto-check passed

Questions about npm Supply Chain Security

What does npm Supply Chain Security do?

Applies safer package manager defaults and dependency vetting to JavaScript and TypeScript projects to reduce supply-chain attack risk. This skill sets safer defaults for JavaScript and TypeScript projects so installing dependencies is less exposed to supply-chain attacks. It uses npm for its examples but tells the agent to check which package manager is present (npm, pnpm, yarn, bun or deno), confirm its version and verify settings against the official documentation.

When should I use npm Supply Chain Security?

npm Supply Chain Security fits situations like: planning which third-party packages a project should depend on; installing or updating dependencies in an npm, pnpm, yarn, bun or deno project; configuring .npmrc with ignore-scripts, exact versions and a release-age cooldown; scoring package candidates before adding them.

How do I install npm Supply Chain Security in Claude Code?

Run `npx skills add bodadotsh/npm-security-best-practices --skill npm-security -a claude-code`. Or copy the skill folder (skills/npm-security in bodadotsh/npm-security-best-practices) into .claude/skills/npm-security in your project. Claude Code loads it when a task matches its description.

How do I install npm Supply Chain Security in Codex?

Run `npx skills add bodadotsh/npm-security-best-practices --skill npm-security -a codex`. Or copy the skill folder (skills/npm-security in bodadotsh/npm-security-best-practices) into .agents/skills/npm-security in your project. Codex loads it when a task matches its description.

Can I use npm Supply Chain Security 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 bodadotsh/npm-security-best-practices --skill npm-security -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/npm-security, .gemini/skills/npm-security, .github/skills/npm-security and .opencode/skills/npm-security in your project.

What does npm Supply Chain Security need to run?

Going by SKILL.md and its folder, npm Supply Chain Security needs the command-line tools its instructions call (npm and npx). Our summary lists: A JavaScript or TypeScript project using npm, pnpm, yarn, bun or deno.

Does npm Supply Chain Security access the network?

SKILL.md names 9 domains. In commands or code: mcp.socket.dev; the agent is likely to contact it when it follows the instructions. As links in the text: github.com, deps.dev, boda.sh, docs.npmjs.com, pnpm.io, yarnpkg.com, bun.sh and docs.deno.com. This is read from the text; nothing was executed.

Is npm Supply Chain Security safe to install?

Our automated static check of SKILL.md flagged 4 warning(s): mentions a credentials file (ssh keys, cloud or package-manager tokens). Read the flagged lines before installing; the check is not a guarantee either way.

What licence does npm Supply Chain Security use?

npm Supply Chain Security is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does npm Supply Chain Security use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to npm Supply Chain Security?

Skills that share tags, products or a category with npm Supply Chain Security: Linea Dependency Maintenance (Consensys-Incorporated/linea-attestation-registry, 177 stars), Migrate to Deno (denoland/skills, 100 stars), Check npm (grafana/skills, 281 stars) and npm Supply Chain Check (majiayu000/spellbook, 287 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains npm Supply Chain Security?

bodadotsh (a GitHub user) maintains it in bodadotsh/npm-security-best-practices, which has 858 GitHub stars. The repository was last updated on September 30, 2026.

Source: bodadotsh/npm-security-best-practices on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.