yarn-classic-to-pnpm

Migrate Yarn Classic repositories to pnpm and audit transitive dependency version drift.

Updated May 20, 2026
One-click install
npx skills add https://github.com/TeXmeijin/agent-skills --skill yarn-classic-to-pnpm-texmeijin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: yarn-classic-to-pnpm
Source: https://github.com/TeXmeijin/agent-skills/tree/main/.apm/skills/yarn-classic-to-pnpm
Command: npx skills add https://github.com/TeXmeijin/agent-skills --skill yarn-classic-to-pnpm-texmeijin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Migrating from Yarn Classic 1.x to pnpm often silently changes transitive dependency versions, and tools like pnpm import or passing tests cannot prove version equality. This Skill performs the migration and then mechanically compares yarn.lock, pnpm-lock.yaml, package-manager list output, and node_modules to expose every version drift down to grandchild packages. ## Core Features & Use Cases - Guided Migration Workflow: Converts Yarn resolutions to pnpm overrides, pins packageManager metadata, updates .npmrc, rewrites CI/Docker commands, and generates pnpm-lock.yaml from yarn.lock. - Mechanical Drift Audit: A bundled zero-dependency Python script compares lockfiles, installed node_modules, and yarn list/pnpm list JSON output, classifying drift as VERSION_SET_CHANGED, MAJOR_COLLAPSED, or MISSING_NAME with npm alias resolution. - Risk Triage & Reporting: Prioritizes production-path major collapses and missing packages, and produces a PR-ready report template with reproduction commands. - Use Case: You are reviewing a PR that migrates a monorepo with server/, global-app/, and global-app/server/ lockfile units from Yarn to pnpm. Run the all-locks and all-node-modules verifier modes to get a summary table proving exactly which transitive versions changed before approving. ## Quick Start Ask the agent to migrate my Yarn Classic project to pnpm and run the drift audit to verify every transitive dependency version matches.

Frequently Asked Questions about yarn-classic-to-pnpm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a Yarn Classic project to pnpm?

Pin pnpm in package.json via the packageManager field, convert Yarn resolutions to pnpm.overrides, add an .npmrc with node-linker=hoisted, then run pnpm import to generate pnpm-lock.yaml from yarn.lock. Finish by rewriting CI and Docker commands from yarn to pnpm equivalents.

How to verify dependency versions match after Yarn to pnpm migration?

Run the bundled verify-pnpm-migration-versions.py script in lock mode against yarn.lock and pnpm-lock.yaml, or node-modules mode against both installed trees. It compares exact (name, version) sets and reports every mismatch with a risk classification.

Does pnpm import guarantee identical transitive dependencies?

No. pnpm and Yarn Classic model peer and optional dependencies differently, and adding overrides or reinstalling can re-resolve transitive packages. The final pnpm-lock.yaml must still be compared mechanically against the old yarn.lock.

What does MAJOR_COLLAPSED mean in a lockfile comparison?

MAJOR_COLLAPSED means the package still exists in pnpm but an entire Yarn-side major version line disappeared, such as zod 4.x collapsing to only 3.x. It is flagged CHECK_REQUIRED because it needs runtime review even if semver-legal.

Can the verifier run in CI to fail on dependency drift?

Yes. The all-locks and all-node-modules modes exit 0 by default for human review, but adding --fail-on-drift makes them exit non-zero when true Yarn-side drift is detected, enabling CI-style gating.