Loading...
Loading...
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. Use when the user invokes /check-npm or asks to audit package manager security, lifecycle scripts, git dependencies, ignore-scripts, min-release-age, allow-git, approvedGitRepositories, strictDepBuilds, or blockExoticSubdeps in a Grafana plugin or JS/TS project.
npx skill4agent add grafana/skills check-npmtest -f package.json || { echo "STOP: no package.json at workspace root"; exit 1; }
jq -r '.packageManager // "unset"' package.json
ls -1 yarn.lock package-lock.json pnpm-lock.yaml 2>/dev/null || truepackage.jsonpackageManagernpm --version # required ≥ 11.15.0
yarn --version # required ≥ 4.14.0
pnpm --version # required ≥ 11.0.0packageManager| Manager | Minimum |
|---|---|
| npm | 11.15.0 |
| yarn | 4.14.0 |
| pnpm | 11.0.0 |
grep -E '^ignore-scripts=' .npmrc 2>/dev/null
grep -E 'enableScripts:' .yarnrc.yml 2>/dev/null
grep -E 'strictDepBuilds:|dangerouslyAllowAllBuilds:|allowBuilds:' pnpm-workspace.yaml 2>/dev/null| Manager | PASS | FAIL |
|---|---|---|
| npm | | missing or |
| yarn | | |
| pnpm ≥ 11 | | |
| pnpm 10 | | neither |
.npmrcpackage.json#pnpmgrep -E '^allow-git=' .npmrc 2>/dev/null
grep -E 'approvedGitRepositories:' .yarnrc.yml 2>/dev/null
grep -E 'blockExoticSubdeps:' pnpm-workspace.yaml 2>/dev/nullpackage.jsondependenciesdevDependenciesoptionalDependenciespeerDependenciesfind . -name package.json -not -path '*/node_modules/*'workspace:patch:npm:user/repofile:link:exec:path → name → value (protocol)| Manager | PASS | FAIL |
|---|---|---|
| npm | | missing or |
| yarn | | unsafe entries or broad allow-list |
| pnpm ≥ 11 | | |
| pnpm 10.x | | unset (default |
grep -E '^min(imum)?-release-age=' .npmrc 2>/dev/null
grep -E 'npmMinimalAgeGate:' .yarnrc.yml 2>/dev/null
grep -E 'minimumReleaseAge:|minimumReleaseAgeStrict:' pnpm-workspace.yaml 2>/dev/null| Manager | PASS | FAIL |
|---|---|---|
| npm | | missing |
| yarn | | missing or below |
| pnpm ≥ 11 | | unset (default |
| pnpm 10 | | missing |
minimumReleaseAgeStrict: false| # | Check | Status | Detail |
|---|---|---|---|
| 0 | Package manager | (npm / yarn / pnpm) | version: x.y.z (pinned: y.y.y if set) |
| 1 | Tool version ≥ threshold | PASS / FAIL | |
| 2 | Scripts disabled | PASS / FAIL | config line or "missing" |
| 3 | Unsafe dep protocols | PASS / FAIL | registry state + flagged entries |
| 4 | Min release age ≥ 3 days | PASS / FAIL | config + value |
PASSFAIL# npm — .npmrc
ignore-scripts=true
allow-git=none
min-release-age=3# pnpm 11 — pnpm-workspace.yaml
strictDepBuilds: true
dangerouslyAllowAllBuilds: false
allowBuilds: []
minimumReleaseAge: 4320
blockExoticSubdeps: true# yarn — .yarnrc.yml
npmMinimalAgeGate: 4320