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-peer-deps.md
name: pnpm-peer-dependencies description: Handling peer dependencies with auto-install and resolution rules
pnpm Peer Dependencies
pnpm has strict peer dependency handling by default. It provides configuration options to control how peer dependencies are resolved and reported.
All peer-dependency settings live in pnpm-workspace.yaml (camelCase). The package.json#pnpm field is no longer read.
Auto-Install Peer Dependencies
By default (since v8), pnpm automatically installs missing non-optional peer dependencies:
autoInstallPeers: trueOn conflicting requirements (e.g. one dep needs react@^16, another react@^17), pnpm installs nothing and prints a warning - resolve it manually, or opt in to joining the ranges:
autoInstallPeersFromHighestMatch: true # default false; joins ranges with ||, installs the highest match (react@17)This also lets pnpm resolve missing required/optional peers from compatible versions elsewhere in the workspace (even with autoInstallPeers: false). A missing optional peer is only resolved if the workspace already has a satisfying version (e.g. from another project's devDependencies). To disable workspace-wide peer reuse, set both autoInstallPeers and dedupePeerDependents to false. Resolved peers are not added to your declared deps: if scripts run a peer's binary, declare it directly.
Strict Peer Dependencies
strictPeerDependencies: true # default falseWhen strict, commands fail on a missing or invalid peer dependency in the tree.
Resolve from workspace root
resolvePeersFromWorkspaceRoot: true # default; install shared peers once at the rootDeduplicate peers
dedupePeerDependents: true # default; share package instances across projects when peers match
dedupePeers: false # version-only peer suffixes (name@version), fewer instances
addMissingPeerTypes: false # v12.12+: every peer `foo` also gets optional peer `@types/foo` (@babel/core -> @types/babel__core)addMissingPeerTypes helps with enableGlobalVirtualStore, where types installed in your project are otherwise not found next to the package. It changes the lockfile.
Peer Dependency Rules
peerDependencyRules is deprecated (still works): it only silences warnings after resolution. To change declared peer ranges so resolution changes, use overrides with :peer:
overrides:
'react:peer': '-' # remove the peer declaration (and its peerDependenciesMeta)
'button@2>react:peer': '16 || 17' # widen the declared peer range
'@babel/*:peer': '*'peerDependencyRules:
ignoreMissing:
- '@babel/*'
- eslint
allowedVersions:
react: '17 || 18'
allowAny:
- '@types/*'ignoreMissing
Suppress warnings for missing peer dependencies. Patterns: exact name (react), scope (@babel/*), or * (not recommended). Does not support parent>peer selectors.
peerDependencyRules:
ignoreMissing:
- '@babel/*'
- eslint
- webpackallowedVersions
Allow specific versions that would otherwise warn. Target a specific parent with parent>peer.
peerDependencyRules:
allowedVersions:
react: '17'
'button@2>react': '17' # only when react is a peer of button@2allowAny
Resolve matching peers from any version, ignoring the declared range. Name or glob only (no parent>peer).
peerDependencyRules:
allowAny:
- '@types/*'
- eslintAdding Peer Dependencies via packageExtensions
Declaratively add a missing peer dependency without JS:
packageExtensions:
problematic-package:
peerDependencies:
react: '*'For conditional logic, use a readPackage hook in .pnpmfile.mjs instead.
Peer Dependencies in Workspaces
Workspace packages can satisfy peer dependencies:
// packages/app/package.json
{
"dependencies": {
"react": "^18.2.0",
"@myorg/components": "workspace:^"
}
}
// packages/components/package.json
{
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0"
}
}The workspace app provides react which satisfies components' peer dependency.
Common Scenarios
Monorepo with Shared React
# pnpm-workspace.yaml
catalog:
react: ^18.2.0
react-dom: ^18.2.0// packages/ui/package.json
{
"peerDependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
}
}
// apps/web/package.json
{
"dependencies": {
"react": "catalog:",
"react-dom": "catalog:",
"@myorg/ui": "workspace:^"
}
}Suppress ESLint Plugin Warnings
peerDependencyRules:
ignoreMissing:
- eslint
- '@typescript-eslint/parser'Allow Multiple Major Versions
peerDependencyRules:
allowedVersions:
webpack: '4 || 5'
postcss: '7 || 8'Debugging Peer Dependencies
# Report unmet/missing peers from the lockfile (exit code 1 on issues; bare `pnpm peers` = check)
pnpm peers check # also: --json, -r (all workspace projects), -g, --lockfile-only
# See why a package is installed
pnpm why <package>
# Check dependency tree
pnpm list --depth=InfinityBest Practices
Keep
autoInstallPeerson for convenience (default in v8+)Use
peerDependencyRulesinstead of blanket-ignoring warningsDocument suppressed warnings explaining why they're safe
Keep peer ranges wide in libraries (e.g.
"react": "^17 || ^18")Run
pnpm peers checkin CI to catch peer regressions
<!-- Source references: - https://pnpm.io/settings#peerdependencyrules - https://pnpm.io/settings#autoinstallpeers - https://pnpm.io/cli/peers -->
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