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://mp-staging.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/features-patches.md
name: pnpm-patches description: Patch third-party packages directly with customized fixes
pnpm Patches
pnpm's patching feature lets you modify third-party packages directly. Useful for applying fixes before upstream releases or customizing package behavior.
Creating a Patch
Step 1: Initialize Patch
pnpm patch <pkg>@<version>
# Example
pnpm patch [email protected]This creates a temporary directory with the package source and outputs the path:
You can now edit the following folder: /tmp/abc123...Step 2: Edit Files
Navigate to the temporary directory and make your changes:
cd /tmp/abc123...
# Edit files as neededStep 3: Commit Patch
pnpm patch-commit <path-from-step-1>
# Example
pnpm patch-commit /tmp/abc123...pnpm patch extracts to node_modules/.pnpm_patches/<pkg> (or --edit-dir/-d <dir>; fails if non-empty: ERR_PNPM_PATCH_EDIT_DIR_EXISTS/ERR_PNPM_EDIT_DIR_NOT_EMPTY). Run pnpm install first (ERR_PNPM_PATCH_NO_LOCKFILE otherwise). If several versions are installed, pnpm asks which to patch and whether to apply to all (then the key is the bare package name). patch-commit accepts a path, or a package name/specifier (ERR_PNPM_AMBIGUOUS_PATCH_TARGET if several edit dirs match), and runs an install afterwards to apply the patch. To change a package's dependencies, use overrides or a hook, not a patched package.json.
This creates a .patch file in patches/ and records it in pnpm-workspace.yaml:
patches/
└── [email protected]patchedDependencies:
[email protected]: patches/[email protected]
patchedDependencies(like all pnpm settings) now lives inpnpm-workspace.yaml, not thepackage.json#pnpmfield.
Patch File Format
Patches use standard unified diff format:
diff --git a/lib/router/index.js b/lib/router/index.js
index abc123..def456 100644
--- a/lib/router/index.js
+++ b/lib/router/index.js
@@ -100,6 +100,7 @@ function createRouter() {
// Original code
- const timeout = 30000;
+ const timeout = 60000; // Extended timeout
return router;
}Managing Patches
List Patched Packages
pnpm list --depth=0
# Shows (patched) marker for patched packagesUpdate a Patch
# Edit existing patch
pnpm patch [email protected]
# After editing
pnpm patch-commit <path>Remove a Patch
pnpm patch-remove <pkg>@<version>
# Example
pnpm patch-remove [email protected]patch-remove with no args lists recorded patches and prompts. It deletes the patch files, removes the keys, and deletes an empty patches dir. Errors: ERR_PNPM_NO_PATCHES_TO_REMOVE, ERR_PNPM_PATCH_NOT_FOUND.
Or manually:
Delete the patch file from
patches/Remove the entry from
patchedDependenciesinpnpm-workspace.yamlRun
pnpm install
Patch Configuration
Multiple Packages / Workspaces
Patches are shared across the whole workspace from the root pnpm-workspace.yaml:
patchedDependencies:
[email protected]: patches/[email protected]
[email protected]: patches/[email protected]
'@types/[email protected]': patches/@[email protected]A version-less key (express:) patches every installed version. All workspace packages using a matching version get the patch.
Patches from a config dependency
Patch files can live inside a shared config dependency and be referenced by path:
configDependencies:
my-patches: '1.0.0'
patchedDependencies:
react: node_modules/.pnpm-config/my-patches/react.patchallowUnusedPatches
allowUnusedPatches: true # don't fail when a listed patch wasn't applied
ignorePatchFailureswas removed in v11. A patch that fails to apply now always throws. When several patches are grouped, all errors are reported together at the end.
Best Practices
Version specificity: Patches are tied to exact versions. Update patches when upgrading dependencies.
Document patches: Add comments explaining why the patch exists:
# In patches/README.md ## [email protected] Fixes timeout issue. PR pending: https://github.com/expressjs/express/pull/1234Minimize patches: Keep patches small and focused. Large patches are hard to maintain.
Track upstream: Note upstream issues/PRs so you can remove patches when fixed.
Test patches: Ensure patched code works correctly in your use case.
Troubleshooting
Patch fails to apply
ERR_PNPM_PATCH_FAILED Cannot apply patchThe package version changed. Recreate the patch:
pnpm patch-remove [email protected]
pnpm patch [email protected]
# Reapply changes
pnpm patch-commit <path>Patch not applied
Ensure:
Version in
patchedDependenciesmatches installed version exactlyRun
pnpm installafter adding patch configuration
<!-- Source references: - https://pnpm.io/cli/patch - https://pnpm.io/cli/patch-commit - https://pnpm.io/config-dependencies -->
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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pnpm.zip