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/features-overrides.md
name: pnpm-overrides description: Force specific versions of dependencies including transitive dependencies
pnpm Overrides
Overrides let you force specific versions of packages, including transitive dependencies. Useful for fixing security vulnerabilities or compatibility issues.
Basic Syntax
Define overrides in pnpm-workspace.yaml. They can only be set at the root of the project.
The
pnpm.overridesfield inpackage.jsonis no longer read (pnpm no longer reads any settings frompackage.json#pnpm). Move overrides topnpm-workspace.yaml.
packages:
- 'packages/*'
overrides:
# Override all versions of a package
lodash: ^4.17.21
# Override specific version range
"foo@^1.0.0": ^1.2.3
# Override nested dependency (only zoo inside qar@1)
"qar@1>zoo": "2"
# Override to different package
"underscore": "npm:lodash@^4.17.21"
# Reference a catalog so the version stays in sync
"react": "catalog:"Override Patterns
Override all instances
overrides:
lodash: ^4.17.21Forces all lodash installations to use ^4.17.21.
Override specific parent version
overrides:
"foo@^1.0.0": ^1.2.3Only override foo when the requested version matches ^1.0.0.
Override nested dependency
overrides:
"express>cookie": ^0.6.0
"[email protected]>bar@^2.0.0>qux": ^1.0.0Override cookie only when it's a dependency of express.
Replace with different package
overrides:
# Replace underscore with lodash
"underscore": "npm:lodash@^4.17.21"
# Use local file
"some-pkg": "file:./local-pkg"
# Use git
"some-pkg": "github:user/repo#commit"Remove a dependency
overrides:
"unwanted-pkg": "-"
"[email protected]>bar": "-" # great for skipping unused optionalDependenciesThe - removes the package entirely.
Override peer dependencies
Overrides also apply to peerDependencies:
overrides:
"react-dom>react": "18.1.0"Without a selector, an override applies to dependencies, devDependencies, optionalDependencies, and peerDependencies. Use the :peer suffix to target only peerDependencies:
overrides:
"react-dom>react:peer": "^18.0.0 || ^19.0.0"
"@babel/*:peer": "*"Ranges,
workspace:, andcatalog:replace the peer range.Non-range specifiers (
link:,file:,npm:) leavepeerDependenciesunchanged (an untyped"foo": "file:./foo.tgz"replacesfooindependenciesonly).-removes the peer dependency and itspeerDependenciesMetaentry.To turn a peer into a direct dep: add it under
packageExtensions.<pkg>.dependenciesand override"<pkg>>dep:peer": "-".
Dependency-type selectors and wildcards
Append :prod (only dependencies), :optional, or :peer to the target to restrict the group. Both parent and target selectors support * on package names:
overrides:
"foo:prod": "^2.0.0"
"@esbuild/*:optional": "-" # also removes duplicate declaration from dependenciesConvergence overrides
An empty range selector "pkg@" rewrites an edge only when the pinned version satisfies the range that edge declares, so compatible consumers converge without forcing an incompatible one:
overrides:
"form-data@": 4.0.6 # ^4.0.5 edges -> 4.0.6; ^3.0.0 edges untouchedValue must be an exact version (or a catalog: entry resolving to one), else ERR_PNPM_INVALID_CONVERGENCE_OVERRIDE. Only plain semver edges participate. Cannot combine with a parent selector ("parent>pkg@" rejected). A regular override wins for the same edge. pnpm warns when the override is stale.
Common Use Cases
Security Fix
Force patched version of vulnerable package:
overrides:
# Fix CVE in transitive dependency
"minimist": "^1.2.6"
"json5": "^2.2.3"Deduplicate Dependencies
Force single version when multiple are installed:
overrides:
"react": "^18.2.0"
"react-dom": "^18.2.0"Fix Peer Dependency Issues
overrides:
"@types/react": "^18.2.0"Replace Deprecated Package
overrides:
"request": "npm:@cypress/request@^3.0.0"Hooks Alternative
For more complex scenarios, use .pnpmfile.mjs:
function readPackage(pkg, context) {
// Override dependency version
if (pkg.dependencies?.lodash) {
pkg.dependencies.lodash = '^4.17.21'
}
// Add missing peer dependency
if (pkg.name === 'some-package') {
pkg.peerDependencies = {
...pkg.peerDependencies,
react: '*'
}
}
return pkg
}
export const hooks = {
readPackage
}Or extend a manifest declaratively with packageExtensions (no JS needed):
packageExtensions:
react-redux:
peerDependencies:
react-dom: '*'Overrides vs Catalogs
| Feature | Overrides | Catalogs |
|---|---|---|
| Affects | All dependencies (including transitive) | Direct dependencies only |
| Usage | Automatic | Explicit catalog: reference |
| Purpose | Force versions, fix issues | Version management |
| Granularity | Can target specific parents | Package-wide only |
Debugging
Check which version is resolved:
# See resolved versions
pnpm why lodash
# List all versions
pnpm list lodash --depth=Infinity<!-- Source references: - https://pnpm.io/settings#overrides - https://pnpm.io/settings#packageextensions - https://pnpm.io/pnpmfile -->
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