Generated banner for Pnpm
Generated logo for Pnpm

Pnpm

Anthony FuCommunityCreated by Anthony Fu

  • Skill
  • Tool integration
  • Software development
  • MIT
  • Low risk

From the author

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.
— the description by Anthony Fu

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

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/antfu/pnpm/download
  2. Unzip 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

TopicDescriptionReference
CLI Commandsinstall/add/remove/update, run, dlx/pnx, workspace, runtime, publishing (version, view, sbom, stage)core-cli
Configurationpnpm-workspace.yaml settings (camelCase), global config.yaml, config includes, packageConfigs, auth (.npmrc, auth.ini)core-config
WorkspacesMonorepo support: filtering, workspace protocol, shared lockfile, packageConfigscore-workspaces
StoreContent-addressable store, virtual store, node linker modes (incl. loaded/store loader), frozen/read-only storecore-store

Features

TopicDescriptionReference
CatalogsCentralized dependency versions; catalogMode, catalog: in overridesfeatures-catalogs
OverridesForce versions (incl. transitive & peer deps); packageExtensionsfeatures-overrides
PatchesModify third-party packages; patchedDependencies in pnpm-workspace.yamlfeatures-patches
AliasesInstall under custom names (npm:) and registry aliases (namedRegistries)features-aliases
Hooks.pnpmfile.mjs hooks (readPackage, updateConfig, beforePacking), finders, resolvers/fetchersfeatures-hooks
Peer DependenciesAuto-install, strict mode, rules, dedupePeers, peers checkfeatures-peer-deps
Config DependenciesShare hooks/settings/catalogs/patches across repos via configDependenciesfeatures-config-dependencies
Global Virtual Store & ShimsShared node_modules, git-worktree multi-agent setups, isolated global packages, project-aware bins, other package managersfeatures-global-virtual-store
Supply-Chain SecurityBuild approval (allowBuilds), permissions and agent skills, minimumReleaseAge, trustPolicy, lockfile integrityfeatures-supply-chain-security
Task OrchestrationCross-project task graphs (tasks/dependsOn), concurrency groups, priority, pnpm pipelinefeatures-task-orchestration
Release ManagementNative versioning: pnpm change/version -r/lane, lanes, epics, fixed groupsfeatures-versioning
Multi-EcosystemPython (pypi:) and Cargo (crate:) dependencies alongside npm (experimental)features-multi-ecosystem

Best Practices

TopicDescriptionReference
CI/CD SetupGitHub Actions, GitLab, Docker, pnpm ci, store caching, frozen lockfilesbest-practices-ci
Migrationnpm/Yarn → pnpm, phantom deps, and pnpm v10 → v11 → v12 upgrade notesbest-practices-migration
PerformanceInstall optimizations, allowBuilds, global virtual store, workspace parallelizationbest-practices-performance

Files

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: true

On 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 false

When 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 root

Deduplicate 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
    - webpack
allowedVersions

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@2
allowAny

Resolve matching peers from any version, ignoring the declared range. Name or glob only (no parent>peer).

peerDependencyRules:
  allowAny:
    - '@types/*'
    - eslint

Adding 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=Infinity

Best Practices

  1. Keep autoInstallPeers on for convenience (default in v8+)

  2. Use peerDependencyRules instead of blanket-ignoring warnings

  3. Document suppressed warnings explaining why they're safe

  4. Keep peer ranges wide in libraries (e.g. "react": "^17 || ^18")

  5. Run pnpm peers check in 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.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pnpm.zip