pnpm-migrate
Skill3 starsChanged 5 months agoMITView on GitHub
Migrates a Node project from npm to a pinned pnpm, including a React client subdirectory when it has its own package.json. Uses the project's .nvmrc for Node, pins a compatible pnpm, blocks npm install, and confirms tests and CI commands. Use when the user asks to switch to pnpm, standardize on pnpm, or invokes /pnpm-migrate.
- Installs packages
In this repository18 other files it gives its agents.
- backlogSkill
- commitSkill
- copySkill
- coverageSkill
- deslopSkill
- fixSkill
- global-code-reviewSkill
- grand-syncSkill
- implementSkill
- interviewSkill
- prod-error-fixSkill
- prSkill
- raptorSkill
- soakSkill
- testsSkill
- typesafe-aiSkill
- verify-thisSkill
- worktreeSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Treat each of these as its own install root when it has a package.json:
- Distinctive: line 22
If the root is already a workspace that installs the client, migrate once at the root.
- Very specific: line 36
Use fnm/asdf/mise the same way when that is what the repo documents.
- Very specific: line 67
Remove package-lock.json and node_modules for that root.
- Distinctive: line 85
Update the files that tell a human or CI how to install.
- Very specific: line 93
Follow /tests for the suite (full log, no pipes).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
pnpm-migrate
Migrate install roots from npm to a pinned pnpm. Do not commit or push unless the user asks.
Install roots
Treat each of these as its own install root when it has a package.json:
- The repo root.
- A client/app subdirectory (common names:
client,web,frontend,apps/web,apps/client) that is a separate React (or other) app with its own lockfile.
If the root is already a workspace that installs the client, migrate once at the root. Do not give that client a second lockfile.
Skip archived specs and generated trees (node_modules, dist).
Node, then pnpm
Node comes from the nearest .nvmrc (root, else the install root). Do not pick a Node that .nvmrc does not name.
# repo or install root that contains .nvmrc
nvm use
node -vUse fnm/asdf/mise the same way when that is what the repo documents. Corepack on that Node supplies pnpm. Do not use a global pnpm that ignores the pin.
Pin the newest pnpm whose engines.node accepts this Node. Check the registry (npm view pnpm engines); if latest requires a newer Node, walk older majors until one fits. Pin that exact version. Corepack rejects ranges.
On every install root package.json:
{
"packageManager": "pnpm@X.Y.Z",
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "X.Y.Z",
"onFail": "error"
}
}
}packageManager is what Corepack and Yarn honor. devEngines with onFail: "error" is what makes npm install exit before it writes a lockfile. The version strings match. npm older than the devEngines field ignores it; say so if the pinned Node ships an older npm.
Activate it:
corepack enable
corepack prepare pnpm@X.Y.Z --activate
pnpm -vInstall
Remove package-lock.json and node_modules for that root. Keep yarn.lock only until that root is migrated; then delete it too.
pnpm installpnpm 12 does not read the pnpm key in package.json. Build-script policy goes in pnpm-workspace.yaml at that install root (settings only is fine when it is not a workspace):
allowBuilds:
esbuild: true
protobufjs: falsepnpm install exits on ignored build scripts. Allow a script only when the package does not work without it (native or binary download, typically esbuild). Set false for scripts that merely print a warning. Re-run install until it exits 0, and confirm pnpm -v is the pinned version.
Commands and docs
Update the files that tell a human or CI how to install. Leave historical tickets alone.
- GitHub Actions:
pnpm/action-setup@v4(readspackageManager), thenactions/setup-nodewithnode-version-filepointing at.nvmrcandcache: pnpm, thenpnpm install --frozen-lockfileandpnpm test/pnpm lint(the repo's real script names). - Docker:
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0,corepack enable, copypackage.jsonandpnpm-lock.yamlbefore install,pnpm install --frozen-lockfile(--prodfor the production deps stage). - README,
AGENTS.md, and other active docs:nvm use,corepack enable,pnpm install. Replacenpm test/npm run lint/npm ciwith the pnpm equivalents.
Confirm
Follow /tests for the suite (full log, no pipes). From each install root, with Node from .nvmrc:
pnpm installexits 0 and prints the pinned version.- The repo's test and lint (or
ci) scripts exit 0. npm installexits non-zero withEBADDEVENGINESand does not recreatepackage-lock.json.
Fix failures before calling the migration done. A client root gets the same three checks.
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.

