pnpm-plugin-skills
v0.3.0
Published
A pnpm plugin that automatically installs agent skills during `pnpm install`.
Readme
pnpm-plugin-skills
A pnpm plugin that automatically installs agent skills during pnpm install.
How It Works
This plugin hooks into pnpm's preResolution lifecycle to run skill installation before dependency resolution. On every pnpm install, it:
- Reads
skills.jsonfrom the workspace root - Resolves and syncs
skills-lock.yaml - Materializes skills into the configured
installDir - Creates symlinks for configured
linkTargets - Skips if the lockfile hasn't changed (fast path)
Setup
Install as a config dependency:
pnpm add pnpm-plugin-skills --configThen create a skills.json in your project root:
{
"installDir": ".agents/skills",
"linkTargets": [".claude/skills"],
"skills": {
"my-skill": "https://github.com/owner/repo.git#path:/skills/my-skill"
}
}Now pnpm install will automatically install your skills.
Architecture
The plugin is built as a single CJS bundle (via Rslib with autoExternal: false) that inlines all dependencies including skills-package-manager. This ensures it works as a standalone pnpmfile.cjs plugin without any external runtime dependencies.
pnpm-plugin-skills/
├── pnpmfile.cjs # Plugin entry — exports { hooks: { preResolution } }
├── src/
│ └── index.ts # Imports installCommand from skills-pm
└── dist/
└── index.js # Bundled CJS output (~350 kB, all deps inlined)Build
pnpm build # Builds with Rslib (CJS bundle mode)