link-workspace-packages

Link sibling workspace packages and resolve module imports in JavaScript monorepos.

6|4|Updated Nov 1, 2025
One-click install
npx skills add https://github.com/Montte-erp/montte-nx --skill link-workspace-packages-montte-erp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: link-workspace-packages
Source: https://github.com/Montte-erp/montte-nx/tree/main/.opencode/skills/link-workspace-packages
Command: npx skills add https://github.com/Montte-erp/montte-nx --skill link-workspace-packages-montte-erp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Resolves missing or unresolved imports for sibling workspace packages by adding proper workspace dependencies so local packages are linked and resolvable by the runtime and TypeScript.

Core Features & Use Cases

  • Package-manager aware linking: Uses each manager's workspace semantics (pnpm workspace:, yarn workspace, npm/bun workspace behavior) to declare and install local dependencies.
  • Fix module resolution errors: Addresses errors like "cannot find module", "failed to resolve import", and TypeScript TS2307 by wiring consumer packages to provider packages correctly.
  • Verification and hoisting awareness: Guides verification of symlinks or manager-specific resolution (node_modules symlinks, pnpm strict isolation, yarn PnP) and notes hoisting differences.

Quick Start

From the consumer package directory, run the repository package manager's workspace add/install command to add the sibling package and create the proper workspace link.

Frequently Asked Questions about link-workspace-packages

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

FAQPage Schema
How do I fix "cannot find module" errors for sibling packages in a monorepo?

Fixing unresolved monorepo imports requires declaring workspace dependencies using your package manager's specific linking semantics, which creates local symlinks or resolution entries so the runtime and TypeScript can correctly find sibling packages.

How do I link workspace packages in pnpm, yarn, npm, or bun?

Linking workspace packages involves using package-manager-specific commands and declarations like `pnpm workspace:`, `yarn workspace`, or `bun add` to install local dependencies and generate the proper workspace links without manual path hacks.

Why does TypeScript show TS2307 errors for local imports in my JavaScript monorepo?

TypeScript TS2307 errors occur because consumer packages lack properly declared workspace dependencies, meaning you must apply package-manager-specific workspace installs to wire the consumer to the provider package correctly.

Can I use manual package.json path hacks to link monorepo workspace packages?

Manual package.json path hacks are unnecessary; you should use your package manager's native workspace behavior to declare and install local dependencies, which automatically handles symlinks and resolution entries.

Do I need to verify hoisting differences when linking dependencies in a monorepo?

Yes, you need to verify hoisting differences because package managers handle workspace resolution differently, such as node_modules symlinks, pnpm strict isolation, and yarn PnP, which affects how linked dependencies are resolved.