Overview
NPM package manager skills with dependency validation hooks for Claude Code.
Features
- Automatic dependency sync: Ensures
npm installruns whenpackage.jsonorpackage-lock.jsonchanges - Smart caching: Only runs when relevant files have changed
- CI-like behavior: Tries
npm cifirst for reproducible installs, falls back tonpm install
Installation
han plugin install npm
Hooks
install (Stop hook)
Automatically runs when you stop Claude Code to ensure dependencies are in sync:
- Detects directories containing
package-lock.json - Only runs if
package.jsonorpackage-lock.jsonhave changed since last successful run - Attempts
npm cifirst for faster, reproducible installs - Falls back to
npm installif lockfile needs updating
Configuration
You can customize the hook behavior in your project's han-config.yml:
npm:
hooks:
install:
enabled: true
# Override the command if needed
# command: "npm install"
To disable the hook for a specific project:
npm:
hooks:
install:
enabled: false
Note
If your project uses yarn instead of npm, consider using yarn instead.