Help us improve
Share bugs, ideas, or general feedback.
From godmode
Guides npm/yarn/pnpm/bun package management: assesses context, selects managers, enforces lockfile rules, configures workspaces, publishing checklists, security audits, version resolution.
npx claudepluginhub arbazkhan971/godmodeHow this skill is triggered — by the user, by Claude, or both
Slash command
/godmode:npmThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- `/godmode:npm`, "npm install", "package manager"
Manages NPM packages, configures Node.js projects, handles dependencies, and troubleshoots issues using npm, yarn, or pnpm.
Audits and updates Node.js dependencies using native package-manager commands (npm, pnpm, yarn, bun). Applies patches silently, asks before minor, confirms each major, and cross-checks changelogs and security advisories.
Manages Bun dependencies with install, add, remove, update commands; handles workspaces, lockfiles, lifecycle scripts, overrides, and npm/yarn/pnpm migrations.
Share bugs, ideas, or general feedback.
/godmode:npm, "npm install", "package manager"# Detect package manager
ls package-lock.json yarn.lock pnpm-lock.yaml \
bun.lockb 2>/dev/null
# Count dependencies
cat package.json | grep -c '":'
Type: application|library|monorepo|CLI
Manager: npm|yarn|yarn berry|pnpm|bun
Lock file: committed|missing
Deps: <N> prod, <N> dev, <N> total transitive
| Feature | npm | yarn | pnpm | bun |
| Speed | Moderate | Fast | Fastest | Fastest |
| Disk | High | High | Low | Low |
| Strictness | Loose | Loose | Strict | Loose |
| Monorepo | Basic | Good | Best | Basic |
IF new project: prefer pnpm (strict, fast, disk-efficient). IF existing project: keep current unless pain points. IF monorepo: pnpm workspaces + Turborepo.
1. ALWAYS commit lock files to version control
2. NEVER manually edit lock files
3. Use `ci` commands in CI (npm ci, pnpm --frozen)
4. One package manager per project
5. Review lock file changes in PRs
6. Regenerate if corrupted: delete lock + node_modules
IF multiple lock files found: delete all but one, standardize on single manager.
| Tool | Task | Cache | Affected |
| npm workspaces | Basic | No | No |
| pnpm workspaces | Basic | No | --filter |
| Turborepo | Advanced | Local+Remote | Yes |
| Nx | Advanced | Local+Remote | Yes |
IF < 5 packages: pnpm workspaces sufficient. IF > 5 packages: add Turborepo for caching.
Checklist:
[ ] package.json: name, version, main, types, exports
[ ] TypeScript declarations (.d.ts)
[ ] Dual ESM/CJS exports configured
[ ] README with usage examples
[ ] CHANGELOG updated
[ ] Tests passing
[ ] .npmignore or "files" field (only needed files)
[ ] Version bumped (semver)
npm publish --dry-run # Always dry-run first
npm pack # Inspect what ships
npm audit # or pnpm audit / yarn audit
npm audit --json # Detailed report
npm audit fix # Auto-fix compatible
npm outdated # Check for updates
IF critical/high vulns in direct deps: update immediately. IF critical/high in transitive: add override or update parent. IF no fix available: assess exploitability, document risk.
| Problem | Solution |
| Conflicting peers | --legacy-peer-deps or update |
| Duplicates | npm dedupe / pnpm dedupe |
| Phantom deps | Switch to pnpm (strict mode) |
| Build fails | Delete node_modules + lock, reinstall |
Append .godmode/npm-results.tsv:
timestamp action packages_affected vulns_fixed status
KEEP if: audit clean AND build green AND tests pass.
DISCARD if: new vuln introduced OR build fails.
Never keep override without documented removal date.
STOP when FIRST of:
- Zero critical/high vulns + lock committed
- No unused deps + no duplicates
- CI uses frozen install
On failure: git reset --hard HEAD~1. Never pause.
| Failure | Action |
|---|---|
| Critical vuln | npm install pkg@latest or override |
| Lock merge conflict | git checkout --theirs, npm install |
| Phantom dep | Switch to pnpm or add explicitly |