pnpm
Skill2 starsChanged 4 months agoMITView on GitHub
Use when a task touches package.json, pnpm-lock.yaml, pnpm-workspace.yaml or node_modules: installing or upgrading, resolving lockfile merge conflicts, testing an unreleased library change in a consumer, patching a dependency, or running commands across a workspace. Triggers: pnpm, lockfile, merge conflict, overrides, pnpm patch, workspace, --filter, packageManager, corepack, 'can only be tested after release'.
- Installs packages
30 other projects use a version of this.
Adopted by
Most recently taken up by
- Contentrain/studiotheir own version, first seen Nov 8, 2026
- ptonlix/OneSelftheir own version, first seen Nov 8, 2026
- antfu/skillstheir own version, first seen Nov 5, 2026
- louisbrulenaudet/monorepo-templatetheir own version, first seen Oct 29, 2026
- ldaume/agentic-engineering-harnesstheir own version, first seen Oct 20, 2026
- LuanRoger/next-dxtheir own version, first seen Oct 17, 2026
Used with
Projects with it also use antfu-design, xsai and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
wltn7810-dotcomSkillantfu-design
antfu-style design conventions, broadened. UnoCSS-first, class-based semantic tokens with dual light/dark for tooling and devtools UIs, plus design-read, anti-slop, and micro-interaction polish for landing pages and product surfaces. Use when building or refactoring any interface with UnoCSS.
Also in 3 projects that use this
alint-devSkillxsai
Use this skill when the user is building with `xsai` or any `@xsai/*` package, or is evaluating xsAI for a small OpenAI-compatible workflow with text generation, streaming, tool calling, structured output, embeddings, image generation, speech synthesis, or transcription.
Also in 3 projects that use this
SentrySkillnitro
Build and deploy universal JavaScript servers with Nitro v3. Use when working with nitro.config.ts, defineNitroConfig, defineHandler, defineConfig, server.ts entry, filesystem routing, route rules, useStorage, defineCachedHandler, useDatabase, definePlugin, runtime hooks, Vercel/Cloudflare deployment, or migrating from Nitro v2/nitropack.
Also in 3 projects that use this
GitHubSkillmulti-stage-dockerfile
Create optimized multi-stage Dockerfiles for any language or framework
Also in 3 projects that use this
MicrosoftSkillsimple-english
Write or rewrite text in plain, layman-readable English in the spirit of ASD-STE100 Simplified Technical English: short sentences, active voice, simple tenses, one word one meaning, condition before command, every technical term defined at first use, no AI slop. Default mode is Plain. Strict mode applies full STE vocabulary compliance when the user names STE, ASD-STE100, or compliance. Use for documentation, READMEs, runbooks, procedures, error messages, release notes, incident reports, API guides, and explanations for readers outside the field. Also use when the user says "STE", "Simplified Technical English", "ASD-STE100", "plain English", "layman's terms", "explain it simply", "no jargon", "de-slop", "make this readable", "write for non-native readers", or asks for docs that translate well. The same rules govern the reply: answer first, prose only.
Also in 3 projects that use this
MicrosoftSkilltypescript
TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.
Also in 3 projects that use this
- +1 more from microsoft
Other versions30 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 30
- moeru-ai/airi★ 51ksame name
- joe-bell/cva★ 6.9ksame name
- antfu/skills★ 6.1ksame name
- TheEdoRan/next-safe-action★ 3.1ksame name
- sanity-io/next-sanity★ 956same name
- oyjt/uniapp-vue3-template★ 628same name
- JetBrains/skills★ 386same name
- Mindrally/skills★ 275same name
- tazo90/next-openapi-gen★ 196same name
- yamcodes/arkenv★ 151same name
20 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adopt-agentic-workflowSkill
- branch-and-commitSkill
- byeSkill
- commit-notationSkill
- commitSkill
- dedicated-browserSkill
- handling-pull-requestsSkill
- jest-testing-conventionsSkill
- markdownSkill
- reality-checkSkill
- schweizer-schreibweiseSkill
- show-your-workSkill
- test-driven-developmentSkill
- triage-ticketSkill
- typescript-strict-patternsSkill
- working-with-bitbucket-apiSkill
- working-with-bitbucket-webSkill
- working-with-jira-webSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 5 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Read the CI configuration before trusting a convenience script.
- Very specific: line 38
Run pnpm install. pnpm detects the markers, merges both sides, and writes a clean lockfile.
- Very specific: line 39
Check the diff: git diff --stat origin/main -- pnpm-lock.yaml.
- Distinctive: line 40
Read every entry both branches changed.
- Very specific: line 48
Remove the duplicated block by hand, then run pnpm install.
- Very specific: line 50
Never delete pnpm-lock.yaml and reinstall.
- Distinctive: line 56
Run git diff --stat -- pnpm-lock.yaml.
- Very specific: line 58
When the diff is larger than the change explains: restore the lockfile from the base branch, run the intended command again (pnpm add …
- Distinctive: line 60
Commit only the lockfile lines the change needs.
- Very specific: line 70
Run pnpm install without --frozen-lockfile.
- Very specific: line 82
Run pnpm patch <name>@<version>.
- Very specific: line 84
Run pnpm patch-commit <directory>.
- Distinctive: line 86
Commit the patch file with the manifest and lockfile changes.
- Very specific: line 108
Write pnpm run and pnpm exec explicitly in scripts and pipelines.
“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
pnpm
Package workflows with pnpm: the facts that change a decision, six recipes that each end with the command proving they worked, and the shortcuts that cost more than they save.
Facts that change decisions
node_modulesis isolated. Each package sees only its declared dependencies through symlinks intonode_modules/.pnpm. Nothing is hoisted to the top level unless a setting asks for it.pnpm-lock.yamlis the source of truth. A plainpnpm installreuses every existing lockfile entry and resolves only new or changed specifiers. A manifest change can still move transitive entries when two manifests request different majors of the same package, so recipe 2 separates that case from an accidental full re-resolution.- The lockfile holds one dependency graph per
name@version. Two packages that need different transitive versions produce two entries; a diff that touches both is normal. - The store is content-addressed. The lockfile pins each tarball's integrity hash, and a frozen install refuses a tarball whose hash changed.
pnpm install --frozen-lockfilefails when the lockfile and the manifests disagree. CI turns it on by default, so it is the check that proves a lockfile is right.- pnpm implements the npm commands it has with the same behaviour.
pnpm runneeds a script,pnpm execneeds a binary, and barepnpm <x>runs a builtin command first, then apackage.jsonscript, then a binary fromnode_modules/.binorPATH. It stops withCommand "<x>" not foundwhen none of the three matches. - Settings live in
pnpm-workspace.yaml(camelCase) or.npmrc(kebab-case). pnpm 10 also reads thepnpmfield of the rootpackage.json; pnpm 11 does not. REFERENCE.md lists the differences.
Preflight checks
- Run
pnpm -vand compare it with thepackageManagerfield in the rootpackage.json. pnpm 10 and later download and run the pinned version on their own. A mismatch usually means a different pnpm is first onPATH, or a pnpm below 10 that does not honour the pin. - Note the major version. It decides where settings live and which flags exist.
- Read the CI configuration before trusting a convenience script. A failing script proves the script is broken only when CI runs that script. The default branch is green until CI says otherwise.
- Anchor search paths at the repository root. An empty search from a drifted working directory proves nothing.
Recipes
1. Lockfile merge conflict
Situation: git merge or git rebase reports a conflict in pnpm-lock.yaml.
- Resolve the conflicts in
package.jsonand source files by hand. Leave the conflict markers inpnpm-lock.yaml. - Run
pnpm install. pnpm detects the markers, merges both sides, and writes a clean lockfile. It printsMerge conflict detected in pnpm-lock.yaml and successfully merged. - Check the diff:
git diff --stat origin/main -- pnpm-lock.yaml. Expect only the lines the working branch added. - Read every entry both branches changed. pnpm keeps both sides' entries and its documentation states that it cannot guarantee it picked the right head.
- Prove:
pnpm install --frozen-lockfileexits 0. The frozen install proves that lockfile and manifests agree, not that the merge chose the right version. - Stage the lockfile and complete the merge.
Variant, broken lockfile without markers: a textual merge done elsewhere produced valid-looking YAML with duplicate keys. pnpm install --frozen-lockfile fails with ERR_PNPM_BROKEN_LOCKFILE … duplicated mapping key. A plain pnpm install prints WARN Ignoring broken lockfile and regenerates the whole file, which re-resolves every floating range. Do one of these instead:
- Restore the lockfile from the base branch with
git checkout origin/main -- pnpm-lock.yamland runpnpm install. pnpm adds the entries the branch needs and keeps everything else. - Redo the merge locally so the markers exist, then apply steps 1 to 6.
- Remove the duplicated block by hand, then run
pnpm install.
Never delete pnpm-lock.yaml and reinstall. That upgrades every package with a floating range and hides the upgrades inside a merge commit.
2. Lockfile hygiene after a dependency change
Situation: pnpm add, pnpm remove, or a version bump changed the lockfile.
- Run
git diff --stat -- pnpm-lock.yaml. Expect a few lines per package added, removed, or bumped. - A large diff means something re-resolved. Common causes: a deleted or broken lockfile,
pnpm update,pnpm dedupe, a changed override or peer setting, or two manifests that request different majors of the same transitive package. - When the diff is larger than the change explains: restore the lockfile from the base branch, run the intended command again (
pnpm add <pkg>@<version>), and compare. - Prove:
pnpm install --frozen-lockfileexits 0. - Commit only the lockfile lines the change needs.
3. Local verification of an unreleased library change
Situation: a library changed, a downstream project consumes the released package, and the task asks whether the change works there. The change is testable now. Nothing needs to be merged or published first.
- In the library: run the build. Set a local version so the tarball name and the lockfile entry differ from every release:
pnpm version 1.2.3-local.1 --no-git-tag-version. Runpnpm pack --pack-destination /tmp/packs. pnpm appliesfilesandpublishConfig, so the tarball is what a publish would upload. Inspect it withtar tzf /tmp/packs/<name>-1.2.3-local.1.tgzwhen in doubt. - In the consumer: point the package at the tarball.
- Single-package repository:
pnpm add /tmp/packs/<name>-1.2.3-local.1.tgz. - Workspace: add a root override with an absolute
file:path. pnpm 10:"pnpm": { "overrides": { "@scope/lib": "file:/tmp/packs/scope-lib-1.2.3-local.1.tgz" } }in the rootpackage.json, oroverrides:inpnpm-workspace.yaml. pnpm 11:pnpm-workspace.yamlonly. A non-root override is ignored with a warning.
- Single-package repository:
- Run
pnpm installwithout--frozen-lockfile. The lockfile gains the tarball's integrity hash. - Prove: run the consumer's build and tests, then check the resolved path once.
ls -l node_modules/@scope/libin the consuming package's directory prints a symlink intonode_modules/.pnpm/whose target names the local tarball. This works for an ESM-only package too. - Report what ran against the tarball. Revert the override or the
file:specifier and the lockfile before committing, unless the task is to pin the tarball.
Re-pack after another change: bump the local suffix to -local.2 and repeat from step 1. A tarball with the same version and new content fails a frozen install with ERR_PNPM_TARBALL_INTEGRITY, and an existing node_modules under a frozen install reports Already up to date and keeps the old files.
pnpm link <dir> is a smoke check, not a verification. It resolves the source layout, skips files, publishConfig and exports, runs no build, and does not install the linked package's dependencies. When a link is used, say so.
4. Dependency patch in place
Situation: a dependency has a bug, the fix is small, and the task cannot wait for an upstream release.
- Run
pnpm patch <name>@<version>. pnpm prints an editable directory. - Edit the files in that directory.
- Run
pnpm patch-commit <directory>. pnpm writespatches/<name>@<version>.patchand registers it underpatchedDependencies(pnpm 10: rootpackage.jsonorpnpm-workspace.yaml; pnpm 11:pnpm-workspace.yaml). - Prove:
pnpm install --frozen-lockfileexits 0 and the test that exposed the bug passes. - Commit the patch file with the manifest and lockfile changes.
- Open the upstream change afterwards. The patch is the local fork until the release lands;
pnpm patch-remove <name>@<version>removes it then.
5. Workspace commands
Situation: the repository has pnpm-workspace.yaml.
pnpm -r <cmd>runs in every package in dependency order.pnpm --filter <pkg> <cmd>runs in the selected package without-r.--filter <pkg>...adds dependencies.--filter ...<pkg>adds dependents.--filter "...[origin/main]"selects packages changed since a ref plus their dependents.--filter ./packages/**selects by path. A leading!excludes.pnpm why <pkg>at the workspace root prints nothing, because without-rit inspects only the root package's own dependencies. Usepnpm why -r <pkg>orpnpm why --filter <package-name> <pkg>.- Depend on a sibling with
"@scope/sibling": "workspace:*". pnpm refuses to resolve it from a registry and rewrites it to the real version onpackandpublish. - Share a version pin across packages with
catalog:inpnpm-workspace.yamland"react": "catalog:"in the manifests. overridestake effect only at the root and apply to every package.--ignore-scriptsskips every lifecycle script, including apostinstallthat installs a nested package. Add an explicit install step for that package in CI.- Prove:
pnpm -r exec pwdlists every workspace package, andpnpm why -r <pkg>prints the packages that depend on<pkg>.
6. Toolchain and CI
- Respect the
packageManagerpin. pnpm 10 and later download and run the pinned version on their own;pnpm self-updatemaintains the pin. The pnpm maintainers do not recommend corepack, and Node 25 and later do not ship it. - When a repository uses corepack anyway: install it with
npm i -g corepack@latest, keep its integrity checks on, and never rely on a barecorepack enableinside a pipeline. Pin the version inpackageManagerwith its hash, and let pnpm 10 and later or a versionedcorepackinstall resolve that pin. The hash verifies the pnpm download. - CI passes
pnpm install --frozen-lockfileexplicitly. The CI-detected default does not turn a broken lockfile into a failure. pnpm 11 addspnpm cifor a clean frozen install. - Since pnpm 10, dependency lifecycle scripts do not run unless the repository allows them (
pnpm approve-builds; pnpm 11:allowBuilds). A missing native build is a policy, not a bug. - Write
pnpm runandpnpm execexplicitly in scripts and pipelines. Recommendpackage.jsonscripts over raw tool flags in documentation. - Prove:
pnpm -vprints the version named inpackageManager, andpnpm install --frozen-lockfileexits 0.
Pitfalls
| Observed phrase or shortcut | What is true | Recipe |
| "This can only be tested after merge and release" | pnpm pack produces the release artefact now; a root override installs it in the consumer | 3 |
Delete pnpm-lock.yaml and reinstall | Every floating range re-resolves; unrelated upgrades land in the commit | 1, 2 |
| Hand-edit the lockfile to resolve a conflict | pnpm install on the markers merges both sides in one step; a hand edit is the fallback for a marker-free broken file only, it removes the duplicate block, and it never edits integrity hashes | 1 |
Plain pnpm install on a broken lockfile "fixed it" | It printed a warning and regenerated the file | 1 |
| "pnpm hoisting explains why it resolves" | Nothing is hoisted to the top level by default; re-run the search from the repository root first, then check the package's own manifest and the hoist settings in .npmrc or pnpm-workspace.yaml | Facts, REFERENCE.md |
pnpm why shows nothing, so it is not installed | Without -r it inspects only the root package's own dependencies; use -r | 5 |
| The script fails, so the default branch is broken | CI runs a different script, or a different pnpm; check both | Preflight checks |
Disable corepack integrity checks or run a bare corepack enable so the pipeline passes | The packageManager hash verifies the download; a pipeline pins the corepack version or lets pnpm 10 and later resolve the pin | 6 |
| "This needs an upstream release first" | pnpm patch ships the fix in this repository today | 4 |
pnpm link proved the change works | Link skips files, publishConfig and the build; the tarball is the proof | 3 |
Retry --frozen-lockfile, add --fix-lockfile, prune the store | None of these read the error; ERR_PNPM_BROKEN_LOCKFILE names a YAML problem, ERR_PNPM_OUTDATED_LOCKFILE a manifest mismatch | 1, REFERENCE.md |
Quick reference
pnpm install # reuse the lockfile, resolve only what changed
pnpm install --frozen-lockfile # prove lockfile and manifests agree (CI)
pnpm add <pkg>[@<range>] [-D] [-w] # -w targets the workspace root
pnpm remove <pkg>
pnpm why -r <pkg> # who depends on it, across the workspace
pnpm list -r --depth Infinity <pkg>
pnpm outdated -r
pnpm update -i -L # interactive, latest tags
pnpm dedupe --check # exit 1 when a dedupe would change the lockfile
pnpm pack --pack-destination <dir>
pnpm patch <name>@<version> # then pnpm patch-commit <dir>, pnpm patch-remove <name>@<version>
pnpm -r <cmd> # every package; --filter <pkg> / --filter "...[origin/main]"
pnpm store path / pnpm store prune
pnpm dlx <pkg> [args] # run a package binary without installing itRelated skills
typescript-strict-patternscovers initial project tooling once the packages are in place.- Release and changeset conventions belong to the release skills and to each repository's own rules. This skill stops at the lockfile.
REFERENCE.md holds the version differences, install flags, settings, and error codes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

