PM Guard — Development skill for Claude Code
Never accidentally npm install in a pnpm project again — guards npm, yarn, pnpm, bun, and deno.
How to install PM Guard
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open udonc/pm-guard and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What PM Guard does
Never accidentally npm install in a pnpm project again — guards npm, yarn, pnpm, bun, and deno.
Alternatives in Development
- npm 71.9k ★
- Again — PUA Again — 用于再试试、换个方法、别放弃、为什么还不行、同一路径失败多次;要求停止微调同一思路,改用本质不同方案 19.5k ★
- 01 Install Bun And Deps — Prompt 01: Install Bun Runtime & Dependencies 2.3k ★
README
pm-guard — Never accidentally `npm install` in a pnpm project again
A [Claude Code](https://docs.anthropic.com/en/docs/claude-code) plugin that prevents Claude from using the wrong package manager.
What It Does
- Guards npm, yarn, pnpm, bun, and deno (including
npx,pnpx,bunx) - Auto-detects the project's package manager from env var,
package.json, or lockfiles - Blocks disallowed commands before execution via
PreToolUsehook - Zero dependencies — pure bash, no jq or node required
Quick Start
Add the marketplace:
/plugin marketplace add udonc/pm-guardInstall the plugin:
/plugin install pm-guard@pm-guardThat's it. pm-guard auto-detects your package manager from lockfiles or `package.json` — no configuration needed.
If Claude tries to use the wrong package manager, the command is blocked:
This project uses pnpm. Use pnpm commands instead of npm.
Configuration
The allowed package manager is detected with the following priority:
1. `PM_GUARD_ALLOWED` environment variable (highest priority)
PM_GUARD_ALLOWED=pnpm claude
2. `packageManager` field in `package.json`
{
"packageManager": "pnpm@9.15.4"
}
The version suffix is ignored — only the package manager name is used.
3. Lockfile detection (lowest priority)
| Lockfile | Detected PM |
|---|---|
pnpm-lock.yaml |
pnpm |
yarn.lock |
yarn |
package-lock.json |
npm |
bun.lock / bun.lockb |
bun |
deno.lock |
deno |
How It Works
pm-guard registers a `PreToolUse` hook on the `Bash` tool. When Claude attempts to run a shell command, the hook:
- Extracts the command from the tool input JSON
- Determines the allowed package manager (see Configuration)
- Strips content inside quotes (both single and double) so that strings like
grep "npm" package.jsondon't trigger
Related Skills
Setup PM
Configure your preferred package manager (npm/pnpm/yarn/bun)
Update Dependencies
What package manager are you using? Please specify (npm, pip, yarn, pnpm, bun).
Plugin Claude npm Bun Guard
Garde-fou d'installation npm/bun pour Claude Code : refuse les paquets malveillants connus, arbre transitif in
Claude End Conversation Guard
A Claude Code hook that prevents the EndConversation tool from loading in your sessions, so it can never be ca
Claude Pings
Never miss a Claude Code response again. Windows toast notifications with 150 witty messages, feature tips, an
Agentrouter
Unofficial SDK for AgentRouter (agentrouter.org) — Claude, DeepSeek, and GLM via OpenAI-compatible proxy. Zero
Related Agents
View Dependency Tree
npm ls yarn list pnpm list npm outdated yarn outdated npm audit yarn audit npx depcheck npx webpack-bundle-ana
Code Writer TypeScript
TypeScript code implementation sub-agent. Invoked by any manager whose plan calls for TS code — Node services,
Ecosystem Maintenance
Periodic health sweep across all Zanix repos for outdated/deprecated third-party dependencies (Deno std, npm p