VCP Dependency Check
Verify project dependencies against the VCP dependency management standard.
Step 1: Resolve Config
- Read
.vcp/config.json from the project root. Extract the pluginRoot field.
- If
.vcp/config.json does not exist or pluginRoot is missing: Stop and tell the user: "No VCP configuration found. Run /vcp-init to configure VCP for this project."
- Validate
pluginRoot: The path must be absolute, contain /.claude/ (or \.claude\ on Windows) as a path segment, and contain only safe path characters (letters, digits, /, \, -, _, ., :, and spaces). Reject any path with shell metacharacters (;, &, |, $, `, (, ), {, }, <, >, !, ~, #, *, ?, [, ], ', "). If validation fails, stop and tell the user: "Invalid pluginRoot — must be within ~/.claude/ and contain no shell metacharacters. Run /vcp-init to fix." Also verify the file <pluginRoot>/lib/vcp-context-core.ts exists using Glob. If it does not exist, stop and tell the user: "pluginRoot points to an invalid VCP installation. Run /vcp-init to fix."
- Run the config resolution script via Bash:
bun "<pluginRoot>/lib/resolve-config.ts" "<project-root>"
- Parse the JSON output. It contains:
applicableStandards, ignoredRules, severity, exclude.
- Also read
.vcp/config.json frameworks field to determine which package ecosystem(s) to check. If no frameworks are listed, auto-detect by looking for manifest files (package.json, requirements.txt, pyproject.toml, pom.xml, build.gradle, Gemfile, go.mod, Cargo.toml).
Step 2: Fetch Applicable Standard
From the applicableStandards array in the resolved config, select only the entry with id equal to core-dependency-management.
If the standard is not in the list (it was ignored via config), tell the user: "core-dependency-management is excluded by ignore config. No checks to run."
Use WebFetch to fetch its content from:
{entry.url}
Extract the Rules section.
Step 4: Check Dependencies
4a: Find Lockfiles and Manifests
Look for these files in the project root:
| Ecosystem |
Manifest |
Lockfile |
| npm |
package.json |
package-lock.json |
| yarn |
package.json |
yarn.lock |
| pnpm |
package.json |
pnpm-lock.yaml |
| pip |
requirements.txt |
(no standard lockfile) |
| pipenv |
Pipfile |
Pipfile.lock |
| poetry |
pyproject.toml |
poetry.lock |
| bundler |
Gemfile |
Gemfile.lock |
| go |
go.mod |
go.sum |
| cargo |
Cargo.toml |
Cargo.lock |
4b: Check Lockfile Committed
Use git ls-files to verify the lockfile is tracked in version control. Flag if missing.
4c: Check Version Ranges
Read the manifest file and flag wide version ranges:
"*" — accepts any version
">=" without upper bound — no ceiling
"" (empty) — unconstrained
- For npm: prefer
^ (minor updates) over >= or *
4d: Verify Packages Exist on Registry
For each dependency, verify it exists on the official registry:
- npm:
npm view {package} version (via Bash)
- pip:
pip index versions {package} (via Bash)
- other ecosystems: use the equivalent registry check command
Flag any package that:
- Does not exist on the registry (possible slopsquatting / hallucinated name)
- Has under 1,000 weekly downloads
- Was published within the last 30 days with no prior version history
- Has a name within edit distance 2 of a top-1000 package in the same registry (typosquatting)
4e: Check for Behavioral Analysis Indicators
Per the dependency management standard rule 13, note if the project uses:
- Socket.dev
- OpenSSF Scorecard
- npm provenance verification
If none are configured, recommend adding at least one.
4f: Check for Install Scripts (npm/yarn/pnpm only)
Install scripts (preinstall, install, postinstall) in dependencies execute arbitrary code during npm install. Legitimate packages use them for native binary compilation (e.g., esbuild, sharp), but malicious packages use them for supply chain attacks. This check flags install scripts so the user can verify they are expected.
Procedure:
- If
node_modules/ does not exist in the project root, skip this step and note: "node_modules not found — run npm install first to check install scripts."
- Read
package.json from the project root. Extract all dependency names from dependencies and devDependencies keys.
- For each dependency name, use the Read tool to read
node_modules/{name}/package.json.
- Check if the
scripts object contains any of: preinstall, install, postinstall.
- If found, flag as WARN:
"{name}" has a {script-name} script: "{first 80 characters of script content}". Verify this is expected.
Verdict: WARN (not block) — some legitimate packages use install scripts for native binaries. The warning tells the user to verify the script is expected.
Scope: Only checks direct dependencies listed in package.json (not transitive dependencies in the full node_modules tree) to keep output manageable.
Step 5: Report Findings
Before outputting findings, remove any that match an entry in the ignoredRules array from the resolved config. If "standard-id/rule-N" is in the list, suppress that specific rule's findings. (Standard-level ignores are already applied by the config resolution script.) After filtering, if any findings were suppressed, append a line: **Suppressed:** X finding(s) by ignore config.
Use this format:
### VCP Dependency Check
**Ecosystem:** npm (package.json)
**Standard:** core-dependency-management (13 rules)
#### Lockfile Status
- package-lock.json: committed
#### Wide Version Ranges
- `lodash: "*"` — should be pinned to `^4.17.21`
- `express: ">=4"` — should use `^4.18.0`
#### Unverified Packages
- `my-cool-lib` — not found on npm registry (possible hallucinated package name)
#### Suspicious Packages
- `colros` — very similar to popular package `colors` (possible typosquatting)
#### Install Scripts
- `sharp` has a `install` script: `node install/check`. Verify this is expected.
- `esbuild` has a `postinstall` script: `node install.js`. Verify this is expected.
#### Supply Chain Tools
- No behavioral analysis tools detected. Consider adding Socket.dev or OpenSSF Scorecard.
**Summary:** X issues found.
If no issues: "All dependencies verified. Lockfile committed, no wide ranges, all packages exist on registry."
1---2name: vcp-dependency-check3description: Verify project dependencies against VCP dependency management standards. Checks lockfile hygiene, version ranges, package existence, and suspicious packages.4---5
6# VCP Dependency Check
7
8Verify project dependencies against the VCP dependency management standard.
9
10## Step 1: Resolve Config
11
121. Read `.vcp/config.json` from the project root. Extract the `pluginRoot` field.
132. **If `.vcp/config.json` does not exist or `pluginRoot` is missing:** Stop and tell the user: "No VCP configuration found. Run `/vcp-init` to configure VCP for this project."
143. **Validate `pluginRoot`:** The path must be absolute, contain `/.claude/` (or `\.claude\` on Windows) as a path segment, and contain only safe path characters (letters, digits, `/`, `\`, `-`, `_`, `.`, `:`, and spaces). Reject any path with shell metacharacters (`;`, `&`, `|`, `$`, `` ` ``, `(`, `)`, `{`, `}`, `<`, `>`, `!`, `~`, `#`, `*`, `?`, `[`, `]`, `'`, `"`). If validation fails, stop and tell the user: "Invalid pluginRoot — must be within ~/.claude/ and contain no shell metacharacters. Run `/vcp-init` to fix." Also verify the file `<pluginRoot>/lib/vcp-context-core.ts` exists using Glob. If it does not exist, stop and tell the user: "pluginRoot points to an invalid VCP installation. Run `/vcp-init` to fix."
154. Run the config resolution script via Bash:
16 ```bash
17 bun "<pluginRoot>/lib/resolve-config.ts" "<project-root>"
18 ```
195. Parse the JSON output. It contains: `applicableStandards`, `ignoredRules`, `severity`, `exclude`.
206. Also read `.vcp/config.json` `frameworks` field to determine which package ecosystem(s) to check. If no `frameworks` are listed, auto-detect by looking for manifest files (package.json, requirements.txt, pyproject.toml, pom.xml, build.gradle, Gemfile, go.mod, Cargo.toml).
21
22## Step 2: Fetch Applicable Standard
23
24From the `applicableStandards` array in the resolved config, select only the entry with `id` equal to `core-dependency-management`.
25
26If the standard is not in the list (it was ignored via config), tell the user: "core-dependency-management is excluded by ignore config. No checks to run."
27
28Use WebFetch to fetch its content from:
29```
30{entry.url}
31```
32
33Extract the **Rules** section.
34
35## Step 4: Check Dependencies
36
37### 4a: Find Lockfiles and Manifests
38
39Look for these files in the project root:
40
41| Ecosystem | Manifest | Lockfile |
42|-----------|----------|----------|
43| npm | `package.json` | `package-lock.json` |
44| yarn | `package.json` | `yarn.lock` |
45| pnpm | `package.json` | `pnpm-lock.yaml` |
46| pip | `requirements.txt` | (no standard lockfile) |
47| pipenv | `Pipfile` | `Pipfile.lock` |
48| poetry | `pyproject.toml` | `poetry.lock` |
49| bundler | `Gemfile` | `Gemfile.lock` |
50| go | `go.mod` | `go.sum` |
51| cargo | `Cargo.toml` | `Cargo.lock` |
52
53### 4b: Check Lockfile Committed
54
55Use `git ls-files` to verify the lockfile is tracked in version control. Flag if missing.
56
57### 4c: Check Version Ranges
58
59Read the manifest file and flag wide version ranges:
60- `"*"` — accepts any version
61- `">="` without upper bound — no ceiling
62- `""` (empty) — unconstrained
63- For npm: prefer `^` (minor updates) over `>=` or `*`
64
65### 4d: Verify Packages Exist on Registry
66
67For each dependency, verify it exists on the official registry:
68- **npm:** `npm view {package} version` (via Bash)
69- **pip:** `pip index versions {package}` (via Bash)
70- **other ecosystems:** use the equivalent registry check command
71
72Flag any package that:
73- Does not exist on the registry (possible slopsquatting / hallucinated name)
74- Has under 1,000 weekly downloads
75- Was published within the last 30 days with no prior version history
76- Has a name within edit distance 2 of a top-1000 package in the same registry (typosquatting)
77
78### 4e: Check for Behavioral Analysis Indicators
79
80Per the dependency management standard rule 13, note if the project uses:
81- Socket.dev
82- OpenSSF Scorecard
83- npm provenance verification
84
85If none are configured, recommend adding at least one.
86
87### 4f: Check for Install Scripts (npm/yarn/pnpm only)
88
89Install scripts (`preinstall`, `install`, `postinstall`) in dependencies execute arbitrary code during `npm install`. Legitimate packages use them for native binary compilation (e.g., `esbuild`, `sharp`), but malicious packages use them for supply chain attacks. This check flags install scripts so the user can verify they are expected.
90
91**Procedure:**
92
931. If `node_modules/` does not exist in the project root, skip this step and note: `"node_modules not found — run npm install first to check install scripts."`
942. Read `package.json` from the project root. Extract all dependency names from `dependencies` and `devDependencies` keys.
953. For each dependency name, use the Read tool to read `node_modules/{name}/package.json`.
964. Check if the `scripts` object contains any of: `preinstall`, `install`, `postinstall`.
975. If found, flag as **WARN**: `"{name}" has a {script-name} script: "{first 80 characters of script content}". Verify this is expected.`
98
99**Verdict:** WARN (not block) — some legitimate packages use install scripts for native binaries. The warning tells the user to verify the script is expected.
100
101**Scope:** Only checks direct dependencies listed in `package.json` (not transitive dependencies in the full `node_modules` tree) to keep output manageable.
102
103## Step 5: Report Findings
104
105Before outputting findings, remove any that match an entry in the `ignoredRules` array from the resolved config. If `"standard-id/rule-N"` is in the list, suppress that specific rule's findings. (Standard-level ignores are already applied by the config resolution script.) After filtering, if any findings were suppressed, append a line: `**Suppressed:** X finding(s) by ignore config.`
106
107Use this format:
108
109```
110### VCP Dependency Check
111
112**Ecosystem:** npm (package.json)
113**Standard:** core-dependency-management (13 rules)
114
115#### Lockfile Status
116- package-lock.json: committed
117
118#### Wide Version Ranges
119- `lodash: "*"` — should be pinned to `^4.17.21`
120- `express: ">=4"` — should use `^4.18.0`
121
122#### Unverified Packages
123- `my-cool-lib` — not found on npm registry (possible hallucinated package name)
124
125#### Suspicious Packages
126- `colros` — very similar to popular package `colors` (possible typosquatting)
127
128#### Install Scripts
129- `sharp` has a `install` script: `node install/check`. Verify this is expected.
130- `esbuild` has a `postinstall` script: `node install.js`. Verify this is expected.
131
132#### Supply Chain Tools
133- No behavioral analysis tools detected. Consider adding Socket.dev or OpenSSF Scorecard.
134
135**Summary:** X issues found.
136```
137
138If no issues: **"All dependencies verified. Lockfile committed, no wide ranges, all packages exist on registry."**