# Use pnpm

> Use pnpm is an open-source agent skill for developer tools. Guides an agent through pnpm installs, workspace commands and global-package recovery. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ruan-cat/monorepo/tree/main/ai-plugins/common-tools/skills/use-pnpm
- **Repository:** https://github.com/ruan-cat/monorepo
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** use-pnpm
- **Collection:** https://github.com/ruan-cat/monorepo
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill gives an agent a decision path for pnpm problems: figuring out whether pnpm is managed by Corepack or a standalone install, separating the global bin directory, global dependency tree, content store and virtual store, and then choosing a recovery route. It covers replacing npm, npx and yarn commands with pnpm equivalents, workspace filtering with --filter and -w, and verification steps after a fix.

The guidance also reaches into pnpm 12 migration gaps such as approval of build scripts, ignored settings in .npmrc, Corepack deprecation, and self-update results that do not take effect. It includes safety rules: back up global metadata before rebuilding, avoid hand-editing the generated module state file, avoid absolute virtual-store paths in global config, and prefer the Windows where.exe command when checking which executable runs.

The skill expects a shell with pnpm, Node and optionally Corepack available, and it is written for Windows and PowerShell usage. Longer procedures are split into reference documents that the agent reads on demand, and the skill ships no scripts.

## When your agent uses it

> Use when 需要处理 pnpm 包管理、workspace 命令、npm/npx/yarn 到 pnpm 的替换、pnpm 12 断代差异（allowBuilds、blockExoticSubdeps、ERR_PNPM_IGNORED_BUILDS、.npmrc 设置迁移）、Windows 或 PowerShell pnpm 故障、Corepack 管理的 pnpm 或 corepack 退役与 shim 复活、pnpm self-update 升级不生效或假成功（双行为分支、PNPM 布局迁移残留、Windows PATH 优先级竞争）、pnpm ls -g 空列表假象、manage-package-manager-versions 自动切换与 cwd 祖先链钉住、全局命令 shim 被历史坏 shim 劫持、包管理器迁移后第三方命令或 MCP 启动失败、全局 CLI 双安装遮蔽、NVM Desktop 切换 Node 后的路径错位、全局包更新、ERR_PNPM_UNEXPECTED_VIRTUAL_STORE、virtual-store-dir 混淆、PNPM_HOME/global-dir/store-dir 诊断，或 pnpm install/update/rebuild 排障；English: handling pnpm package management, workspace commands, npm/npx/yarn replacement, pnpm 12 migration gaps (allowBuilds, blockExoticSubdeps, ERR_PNPM_IGNORED_BUILDS, .npmrc settings migration), Windows or PowerShell pnpm failures, Corepack-managed pnpm or corepack deprecation and shim resurrection, pnpm self-update upgrade-not-effective or false success (dual behavior branches, layout migration residue, Windows PATH priority competition), pnpm ls -g empty-list

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ruan-cat/monorepo/tree/HEAD/ai-plugins/common-tools/skills/use-pnpm)
- [License: MIT](https://github.com/ruan-cat/monorepo/tree/HEAD/ai-plugins/common-tools/skills/use-pnpm)

## Features

- **Package Manager Ownership Check:** Determines whether pnpm comes from Corepack, a Node install, or a standalone installer before any change is made.
- **Global Tree Recovery:** Walks through backing up global metadata and rebuilding the global dependency tree after virtual store errors.
- **Workspace Command Guidance:** Explains when to target a package with --filter, use -w for root dependencies, or run commands from the root.
- **npm to pnpm Mapping:** Provides a reference for translating npm, npx and yarn commands into their pnpm counterparts.
- **Build Approval Handling:** Sets rules for approving build scripts one package at a time and recording whether each stage succeeded.
- **Verification Steps:** Lists commands to confirm global packages, paths, store and virtual store settings after a repair.

## Good for

- Fix an ERR_PNPM_UNEXPECTED_VIRTUAL_STORE error after updating global packages
- Work out which pnpm executable runs on Windows when several are on the PATH
- Replace npm or yarn commands with pnpm in a project
- Add a dependency to a single package inside a pnpm workspace
- Troubleshoot pnpm global packages after switching Node versions with NVM

## Install

### Claude Code

This skill ships in the `common-tools` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ruan-cat/monorepo
/plugin install common-tools@ruan-cat-tools
```

Or copy only this skill to `~/.claude/skills/use-pnpm`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/use-pnpm &&
cp -R "$tmp/ai-plugins/common-tools/skills/use-pnpm" ~/.claude/skills/use-pnpm &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/use-pnpm` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/use-pnpm` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/use-pnpm &&
cp -R "$tmp/ai-plugins/common-tools/skills/use-pnpm" ~/.agents/skills/use-pnpm &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/use-pnpm` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/use-pnpm` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/use-pnpm &&
cp -R "$tmp/ai-plugins/common-tools/skills/use-pnpm" ~/.cursor/skills/use-pnpm &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/use-pnpm` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ruan-cat/monorepo.git --path ai-plugins/common-tools/skills/use-pnpm
```

Or copy the folder to `~/.gemini/skills/use-pnpm` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/use-pnpm`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/use-pnpm &&
cp -R "$tmp/ai-plugins/common-tools/skills/use-pnpm" ~/.copilot/skills/use-pnpm &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/use-pnpm` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ruan-cat/monorepo.git
```

Then copy `monorepo/ai-plugins/common-tools/skills/use-pnpm` into your agent's skills folder as `use-pnpm`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Use pnpm change my global pnpm configuration automatically?

No. The skill tells the agent to back up global files first, avoid hand-editing generated state files, and only change global settings when the user has authorized it.

### What tools does the agent need to use Use pnpm?

The guidance assumes a terminal with pnpm, Node and Corepack, and uses Windows commands such as where.exe and PowerShell examples.

### Does Use pnpm ship scripts?

No. The skill contains only instructions and reference documents and does not include scripts.

### How do I install Use pnpm in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/use-pnpm to use it in all your projects, or to .claude/skills/use-pnpm in one project. Or install the common-tools plugin, which includes it: /plugin marketplace add ruan-cat/monorepo, then /plugin install common-tools@ruan-cat-tools.

### Does Use pnpm run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Use pnpm?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Use pnpm?

The closest alternatives to Use pnpm are Windows NPM run script shell, Package linter, CLI install, Find skills and Upgrade js deps.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Windows NPM run script shell](https://ai-powered.com/skills/windows-npm-run-script-shell): Windows NPM run script shell is an open-source agent skill for developer tools.
- [Package linter](https://ai-powered.com/skills/package-linter): Package linter is an open-source agent skill for developer tools.
- [CLI install](https://ai-powered.com/skills/cli-install): CLI install is an open-source agent skill for developer tools.
- [Find skills](https://ai-powered.com/skills/find-skills-melandlabs): Find skills is an open-source agent skill for developer tools.
- [Upgrade js deps](https://ai-powered.com/skills/upgrade-js-deps): Upgrade js deps is an open-source agent skill for developer tools.
- [Skills atlas](https://ai-powered.com/skills/skills-atlas): Skills atlas is an open-source agent skill for developer tools.
- [Cleanup agent team node processes](https://ai-powered.com/skills/cleanup-agent-team-node-processes): Cleanup agent team node processes is an open-source agent skill for developer tools.
- [Dependency management](https://ai-powered.com/skills/dependency-management): Dependency management is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/use-pnpm
