pnpm

Detect duplicate dependencies in pnpm-lock.yaml and guide scoped deduplication updates.

40|2|Updated Sep 24, 2025
One-click install
npx skills add https://github.com/remorses/opencode-config --skill pnpm-remorses
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pnpm
Source: https://github.com/remorses/opencode-config/tree/main/skills/pnpm
Command: npx skills add https://github.com/remorses/opencode-config --skill pnpm-remorses

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

pnpm workspace can end up with duplicate dependencies across packages, causing broken type checking, bundler resolution issues, and multiple instances of singleton-like libraries. This skill helps identify and fix these duplicates in a pnpm-managed monorepo.

Core Features & Use Cases

  • Detect duplicate packages across the workspace by inspecting pnpm-lock.yaml and package graphs.
  • Guide deduplication by identifying the older version cause and applying targeted updates to align versions across the tree.
  • Use cases include monorepos with shared dependencies (e.g., zod or react) that appear in multiple subtrees but with conflicting peer or transitive versions.

Quick Start

Run the deduplication workflow by identifying the older version with pnpm -r why packagename@version and then apply updates with pnpm update -r --latest on the affected packages.

Frequently Asked Questions about pnpm

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

FAQPage Schema
How do I find duplicate dependencies in a pnpm workspace monorepo?

Find duplicate dependencies in a pnpm workspace by inspecting the pnpm-lock.yaml file and package graphs to detect conflicting versions across shared packages. This identifies multiple instances of singleton-like libraries causing version skew.

Why does pnpm deduplication matter for monorepo type checking and bundler resolution?

pnpm deduplication matters because duplicate dependencies across workspace packages cause broken type checking, bundler resolution issues, and multiple instances of singleton-like libraries. Aligning versions resolves these conflicts and ensures consistent package behavior.

What is the best way to deduplicate packages in pnpm-lock.yaml?

The best way to deduplicate packages in pnpm-lock.yaml is identifying the older version using pnpm -r why packagename@version, then applying targeted updates with pnpm update -r --latest on affected packages to align versions across the tree.

Can I update a single shared dependency version across all pnpm workspace packages?

You can update a shared dependency across all pnpm workspace packages using scoped updates with pnpm update -r --latest. This applies targeted updates to align conflicting peer or transitive versions found in the lockfile.

When should I not use pnpm update -r --latest for dependency deduplication?

Avoid using pnpm update -r --latest for deduplication when targeted scoped updates are safer, as blanket updates across the monorepo can introduce unintended breaking changes. Always document safe update practices to avoid version skew.

How do I diagnose conflicting transitive versions in pnpm workspaces?

Diagnose conflicting transitive versions in pnpm workspaces by running pnpm -r why packagename@version to trace dependency trees. This identifies the older version causing duplicates and guides targeted updates to align versions.