From the skill’s files
Taken from the skill’s own files (its description, section headings and stated usage). Not an AutoGineer summary, and not written by the author as one.
Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces via pnpm-workspace.yaml, or managing dependencies with catalogs, patches, overrides, config dependencies, or the global virtual store. pnpm is a fast, disk space efficient package manager. It uses a content-addressable store to deduplicate packages across all projects on a machine, and enforces strict dependency resolution by default, preventing phantom dependencies.
What it does
- Core
- Features
- Best Practices
When to use it
- Use when running pnpm specific commands, configuring workspaces via pnpm-workspace.yaml, or managing dependencies with catalogs, patches, overrides, config dependencies, or the global virtual store.
Advantages
The skill’s files do not state this.
Usage examples
The skill’s files do not state this.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/antfu/pnpm/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip pnpm.zip -d .agents/skills
Documentation by Anthony Fu
pnpm is a fast, disk space efficient package manager. It uses a content-addressable store to deduplicate packages across all projects on a machine, and enforces strict dependency resolution by default, preventing phantom dependencies.
pnpm v12 is a Rust rewrite of v11: stable, and keeps v11's commands, flags, settings, and lockfile format — so most guidance here applies to both. A handful of v12 behaviors differ (git deps resolve via HTTPS, project-aware global bins, other package managers, packageImportMethod: auto hardlinks first on Linux) — see best-practices-migration.
Configuration model (important): pnpm settings live in pnpm-workspace.yaml (and the global config.yaml) using camelCase keys. .npmrc is used only for authentication/registry credentials, and the pnpm field of package.json is no longer read. When working in a pnpm project, check pnpm-workspace.yaml for settings/workspace structure and .npmrc only for auth. Always use --frozen-lockfile (or pnpm ci) in CI.
The skill is based on pnpm 12.18, generated at 2026-11-05. It covers v11+v12 behavior (config split, config includes, isolated global packages,
allowBuilds,pmOnFail, global virtual store, native release management, workspace task orchestration, and experimental Python/Cargo support) where current docs describe them.
Core
| Topic | Description | Reference |
|---|---|---|
| CLI Commands | install/add/remove/update, run, dlx/pnx, workspace, runtime, publishing (version, view, sbom, stage) | core-cli |
| Configuration | pnpm-workspace.yaml settings (camelCase), global config.yaml, config includes, packageConfigs, auth (.npmrc, auth.ini) | core-config |
| Workspaces | Monorepo support: filtering, workspace protocol, shared lockfile, packageConfigs | core-workspaces |
| Store | Content-addressable store, virtual store, node linker modes (incl. loaded/store loader), frozen/read-only store | core-store |
Features
| Topic | Description | Reference |
|---|---|---|
| Catalogs | Centralized dependency versions; catalogMode, catalog: in overrides | features-catalogs |
| Overrides | Force versions (incl. transitive & peer deps); packageExtensions | features-overrides |
| Patches | Modify third-party packages; patchedDependencies in pnpm-workspace.yaml | features-patches |
| Aliases | Install under custom names (npm:) and registry aliases (namedRegistries) | features-aliases |
| Hooks | .pnpmfile.mjs hooks (readPackage, updateConfig, beforePacking), finders, resolvers/fetchers | features-hooks |
| Peer Dependencies | Auto-install, strict mode, rules, dedupePeers, peers check | features-peer-deps |
| Config Dependencies | Share hooks/settings/catalogs/patches across repos via configDependencies | features-config-dependencies |
| Global Virtual Store & Shims | Shared node_modules, git-worktree multi-agent setups, isolated global packages, project-aware bins, other package managers | features-global-virtual-store |
| Supply-Chain Security | Build approval (allowBuilds), permissions and agent skills, minimumReleaseAge, trustPolicy, lockfile integrity | features-supply-chain-security |
| Task Orchestration | Cross-project task graphs (tasks/dependsOn), concurrency groups, priority, pnpm pipeline | features-task-orchestration |
| Release Management | Native versioning: pnpm change/version -r/lane, lanes, epics, fixed groups | features-versioning |
| Multi-Ecosystem | Python (pypi:) and Cargo (crate:) dependencies alongside npm (experimental) | features-multi-ecosystem |
Best Practices
| Topic | Description | Reference |
|---|---|---|
| CI/CD Setup | GitHub Actions, GitLab, Docker, pnpm ci, store caching, frozen lockfiles | best-practices-ci |
| Migration | npm/Yarn → pnpm, phantom deps, and pnpm v10 → v11 → v12 upgrade notes | best-practices-migration |
| Performance | Install optimizations, allowBuilds, global virtual store, workspace parallelization | best-practices-performance |
Files
- ATTRIBUTION.mdAdded by AutoGineer889 B
- GENERATION.md134 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md5.1 KiB
- references/best-practices-ci.md9.7 KiB
- references/best-practices-migration.md9.9 KiB
- references/best-practices-performance.md6.0 KiB
- references/core-cli.md11.3 KiB
- references/core-config.md12.8 KiB
- references/core-store.md10.7 KiB
- references/core-workspaces.md6.6 KiB
- references/features-aliases.md4.4 KiB
- references/features-catalogs.md5.0 KiB
- references/features-config-dependencies.md4.2 KiB
- references/features-global-virtual-store.md10.0 KiB
- references/features-hooks.md8.9 KiB
- references/features-multi-ecosystem.md6.2 KiB
- references/features-overrides.md5.5 KiB
- references/features-patches.md5.0 KiB
- references/features-peer-deps.md5.9 KiB
- references/features-supply-chain-security.md7.7 KiB
- references/features-task-orchestration.md6.8 KiB
- references/features-versioning.md5.5 KiB
references/best-practices-migration.md
name: migration-to-pnpm description: Migrating from npm or Yarn to pnpm with minimal friction
Migration to pnpm
Guide for migrating existing projects from npm or Yarn to pnpm, plus upgrading pnpm v10 → v11 and v11 → v12.
Upgrading pnpm v11 → v12
pnpm 12 (native executable, no Node.js needed to run) reads the same pnpm-lock.yaml, pnpm-workspace.yaml, and store as v11 - upgrading is not a migration and there is no codemod. If still on v10, do v10 → v11 first (its codemod applies).
pnpm self-update 12 # also updates the packageManager/devEngines.packageManager pinIf you install pnpm another way, update the pin too, otherwise pnpm 12 runs the pinned pnpm 11. Then run pnpm install, fix reported settings, commit package.json and the lockfile. Behavior changes to check:
Unrecognized
pnpm-workspace.yamlsettings fail (ERR_PNPM_UNRECOGNIZED_WORKSPACE_SETTINGS) when the project pins a pnpm version the running one satisfies (else still a warning).confirmModulesPurgeis rejected.pnpm confignever fails on it.Boolean flag + separate value is rejected: use
--frozen-lockfile=false/--no-frozen-lockfile, not--frozen-lockfile false.Git dependency resolution: GitHub/GitLab/Bitbucket specifiers resolve via the host's HTTPS URL and pnpm never records an SSH URL (no network probing). Old
git@...lockfile entries change only on re-resolve (pnpm update <pkg>). Private SSH:git config --global url."[email protected]:".insteadOf https://github.com/.pnpmfile hooks:
importPackageis not run (usepackageImportMethod);filterLogis ignored with a warning (useloglevel).engineStrictfails when an incompatible package is reached via regulardependencieseven under an optional subtree; with--no-runtime/runtime: falseit checks the rootengines.nodeagainst the active Node.js.Naming a package manager/runtime installs the tool, not the npm package:
pnpm add -g yarn,pnx node@22.yarn@npm:[email protected]still installs the package.Global
node/deno/bunfollow the project's pin (devEngines.runtime,engines.runtime,.node-version,.nvmrc). Opt out withglobalShims: false(global config) orPNPM_SHIM_BYPASS=1.Global commands under
sudofail (ERR_PNPM_SUDO_NOT_SUPPORTED):setup,self-update,add --global.TLS: uses the OS certificate store (fallback: bundled Mozilla CAs);
ca/cafilestill override.maxsocketsno longer defaults to 50; onlynetworkConcurrencybounds direct connections (proxied: 50 per origin).shellEmulatoruses pnpm's built-in shell (some${NAME:=word}forms are literal; unparsable scripts failERR_PNPM_EXECUTOR_SHELL_EMULATOR_PARSE).scriptsPrependNodePathis ignored.packageImportMethod: autohardlinks first on Linux (was clone-first). Setcloneon btrfs/xfs to keep copy-on-write.Cyclic dependency graphs give deterministic lockfiles; the first re-resolving install may rewrite cyclic peer variants once. Frozen installs are unaffected.
pnpm dlx/pnxdo not use the global virtual store.pnpm pack-appembeds Node.js 25.5.0 unless--runtime/pnpm.app.runtimeis set.--frozen-storehas no Node.js version requirement.
Upgrading pnpm v10 → v11
v11 changes how configuration is read. Most of it is mechanical — run the codemod:
cd /path/to/project
pnx codemod run pnpm-v10-to-v11 # pnpx on pnpm v10The codemod automatically:
Moves
package.json#pnpmsettings intopnpm-workspace.yaml(thepnpmfield is no longer read).Splits
.npmrc: only auth/registry settings stay in.npmrc; every other key moves topnpm-workspace.yamlas camelCase (e.g.node-linker→nodeLinker). Per-subproject.npmrcfiles becomepackageConfigs["<name>"].Consolidates build settings (
onlyBuiltDependencies,neverBuiltDependencies,ignoredBuiltDependencies,onlyBuiltDependenciesFile) into oneallowBuilds: { name: true|false }map.Replaces
managePackageManagerVersions/packageManagerStrict/packageManagerStrictVersionwithpmOnFail: download|ignore|warn|error.Renames
allowNonAppliedPatches→allowUnusedPatches,auditConfig.ignoreCves→auditConfig.ignoreGhsas.Converts
useNodeVersion→devEngines.runtime, and bumpspackageManager.
Manual follow-ups (not automatable):
Convert
CVE-…IDs toGHSA-…inauditConfig.ignoreGhsas.ignorePatchFailuresremoved — failed patches now always throw.npm_config_*env vars →pnpm_config_*(CI, shell profiles, Docker).pnpm link <name>→ use a path (pnpm link ./foo);pnpm link --global→pnpm add -g ..pnpm install -g(no args) andpnpm serverremoved.A
package.jsonscript named like a built-in (e.g.clean,deploy) now shadows the built-inpnpm <name>; see the built-in/script name conflicts list in the scripts docs.Docker images must copy
pnpm-workspace.yaml(if present) beforepnpm install.
Migrating from npm / Yarn
Quick Migration
From npm
# Remove npm lockfile and node_modules
rm -rf node_modules package-lock.json
# Install with pnpm
pnpm installFrom Yarn
# Remove yarn lockfile and node_modules
rm -rf node_modules yarn.lock
# Install with pnpm
pnpm installImport Existing Lockfile
pnpm can import existing lockfiles:
# Import from npm or yarn lockfile
pnpm import
# This creates pnpm-lock.yaml from:
# - package-lock.json (npm)
# - yarn.lock (yarn)
# - npm-shrinkwrap.json (npm)Handling Common Issues
Phantom Dependencies
pnpm is strict about dependencies. If code imports a package not in package.json, it will fail.
Problem:
// Works with npm (hoisted), fails with pnpm
import lodash from 'lodash' // Not in dependencies, installed by another packageSolution: Add missing dependencies explicitly:
pnpm add lodashMissing Peer Dependencies
pnpm reports peer dependency issues by default.
Option 1: Let pnpm auto-install (default in v8+):
autoInstallPeers: trueOption 2: Install manually:
pnpm add react react-domOption 3: Suppress warnings if acceptable:
peerDependencyRules:
ignoreMissing:
- reactSymlink Issues
Some tools don't work with symlinks. Use hoisted mode:
nodeLinker: hoistedOr hoist specific packages:
publicHoistPattern:
- '*eslint*'
- '*babel*'Native Module Rebuilds
If native modules fail, try:
# Rebuild all native modules
pnpm rebuild
# Or reinstall
rm -rf node_modules
pnpm installMonorepo Migration
From npm Workspaces
Create
pnpm-workspace.yaml:packages: - 'packages/*'Update internal dependencies to use workspace protocol:
{ "dependencies": { "@myorg/utils": "workspace:^" } }Install:
rm -rf node_modules packages/*/node_modules package-lock.json pnpm install
From Yarn Workspaces
Remove Yarn-specific files:
rm yarn.lock .yarnrc.yml rm -rf .yarnCreate
pnpm-workspace.yamlmatchingworkspacesin package.json:packages: - 'packages/*'Update
package.json- remove Yarn workspace config if not needed:{ // Remove "workspaces" field (optional, pnpm uses pnpm-workspace.yaml) }Convert workspace references:
// From Yarn "@myorg/utils": "*" // To pnpm "@myorg/utils": "workspace:*"
From Lerna
pnpm can replace Lerna for most use cases:
# Lerna: run script in all packages
lerna run build
# pnpm equivalent
pnpm -r run build
# Lerna: run in specific package
lerna run build --scope=@myorg/app
# pnpm equivalent
pnpm --filter @myorg/app run build
# Lerna: publish
lerna publish
# pnpm: use changesets instead
pnpm add -Dw @changesets/cli
pnpm changeset
pnpm changeset version
pnpm publish -rConfiguration Migration
Keep only auth/registry in .npmrc; put everything else in pnpm-workspace.yaml (camelCase).
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
//npm.myorg.com/:_authToken=${MYORG_TOKEN}registries:
default: https://registry.npmjs.org/
'@myorg': https://npm.myorg.com/
autoInstallPeers: true
strictPeerDependencies: falseScripts Migration
Most scripts work unchanged. Update pnpm-specific patterns:
{
"scripts": {
// npm: recursive scripts
"build:all": "npm run build --workspaces",
// pnpm: use -r flag
"build:all": "pnpm -r run build",
// npm: run in specific workspace
"dev:app": "npm run dev -w packages/app",
// pnpm: use --filter
"dev:app": "pnpm --filter @myorg/app run dev"
}
}CI/CD Migration
Update CI configuration:
# Before (npm)
- run: npm ci
# After (pnpm)
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile # or: pnpm ciAdd to package.json for Corepack:
{
"packageManager": "[email protected]"
}Gradual Migration
For large projects, migrate gradually:
Start with CI: Use pnpm in CI, keep npm/yarn locally
Add pnpm-lock.yaml: Run
pnpm importto create lockfileTest thoroughly: Ensure builds work with pnpm
Update documentation: Update README, CONTRIBUTING
Remove old files: Delete old lockfiles after team adoption
Rollback Plan
If migration causes issues:
# Remove pnpm files
rm -rf node_modules pnpm-lock.yaml pnpm-workspace.yaml
# Restore npm
npm install
# Or restore Yarn
yarn installKeep old lockfile in git history for easy rollback.
<!-- Source references: - https://pnpm.io/migration - https://pnpm.io/migration-v11 - https://pnpm.io/cli/import - https://pnpm.io/configuring -->
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Node.js
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Anthony Fu
- Publisher
- Anthony Fu (Community)
- Source
- antfu/skills · skills/pnpm · commit f63e9ec
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.md)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Anthony Fu or Anthony Fu.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pnpm.zip