link-workspace-packages

Link missing workspace dependencies in monorepos using npm, yarn, pnpm, or bun.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/johnnystefan/test-saas-business --skill link-workspace-packages-johnnystefan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: link-workspace-packages
Source: https://github.com/johnnystefan/test-saas-business/tree/main/.github/skills/link-workspace-packages
Command: npx skills add https://github.com/johnnystefan/test-saas-business --skill link-workspace-packages-johnnystefan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Monorepo consumers often fail to resolve sibling workspace packages after creating or importing new modules, causing errors like cannot find module or TS2307 even when the code exists.

Core Features & Use Cases

  • Detects package managers by checking packageManager fields and lockfiles to choose the right workspace syntax for pnpm, yarn berry, npm, or bun.
  • Adds workspace dependencies using the package manager's commands so imports from sibling packages are wired to actual symlinks instead of relying on manual edits.
  • Use Case: After generating a new @org/ui library and importing it in @org/app, run the workspace add command so pnpm or npm links the provider and resolves the import without phantom dependency errors.

Quick Start

Use the link-workspace-packages instructions to add the missing workspace dependency with your package manager's workspace add command so imports can resolve automatically.

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 when importing a new package in a monorepo?

To fix 'cannot find module' errors in a monorepo, you must add the sibling package as a workspace dependency using your package manager's workspace add command, which creates symlinks for proper resolution.

How do I link a new workspace package in pnpm or yarn without manual package.json edits?

You link a new workspace package by running your package manager's workspace add command, which wires imports to actual symlinks automatically without requiring manual package.json edits.

Why does TypeScript show TS2307 cannot find module errors for sibling monorepo packages?

TypeScript shows TS2307 errors because the sibling package is not linked as a workspace dependency, requiring the package manager's workspace add command to resolve the import correctly.

Does workspace linking work across npm, yarn, pnpm, and bun monorepos?

Yes, workspace linking works across npm, yarn, pnpm, and bun by detecting packageManager fields and lockfiles to choose the correct workspace syntax for each package manager.

What is the best way to add missing workspace dependencies to resolve phantom dependency errors?

The best way to resolve phantom dependency errors is using the package manager's workspace add command, which deterministically links provider packages and resolves imports without manual edits.