link-workspace-packages

Link workspace packages in monorepos using npm, yarn, pnpm, or bun workspace commands.

3|Updated May 14, 2026
One-click install
npx skills add https://github.com/jbadeau/fabster --skill link-workspace-packages-jbadeau
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: link-workspace-packages
Source: https://github.com/jbadeau/fabster/tree/main/.cursor/skills/link-workspace-packages
Command: npx skills add https://github.com/jbadeau/fabster --skill link-workspace-packages-jbadeau

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Newly created packages in a monorepo fail to resolve imports from sibling packages, producing errors like "cannot find module", "failed to resolve import", or "TS2307". This Skill wires up dependencies between workspace packages using the correct package manager syntax instead of fragile tsconfig path patches. ## Core Features & Use Cases - Package Manager Detection: Identifies npm, yarn, pnpm, or bun from the root package.json packageManager field or lockfile. - Manager-Specific Linking: Applies the correct workspace syntax for each tool, including pnpm and bun workspace:* protocol, yarn berry workspace:^, and npm auto-symlinking. - Resolution Error Diagnosis: Walks through debugging "Cannot find module" errors by checking declared dependencies and re-running install. - Use Case: After generating a new @org/ui library, an app importing it fails to build. The Skill detects pnpm from the lockfile and runs pnpm add @org/ui --filter @org/app --workspace to create the symlink. ## Quick Start Link the @org/ui package as a dependency of @org/app in this monorepo and fix the module resolution errors.

Frequently Asked Questions about link-workspace-packages

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

FAQPage Schema
How do I link packages in a pnpm monorepo?

Use `pnpm add @org/ui --filter @org/app --workspace` to add a sibling package as a dependency. pnpm writes `"workspace:*"` into the consumer's package.json and creates symlinks only when the workspace protocol is explicitly declared.

How to fix "cannot find module" for workspace packages?

First check whether the dependency is declared in the consumer package's package.json. If missing, add it with your package manager's workspace command, then run install again so the symlink is created in node_modules.

What is the difference between npm and pnpm workspace linking?

npm auto-symlinks workspace packages and records `"*"` as the version, with no workspace protocol. pnpm requires the explicit `workspace:` protocol and does not hoist dependencies, giving strict isolation that prevents phantom dependencies.

Does yarn berry support the workspace protocol?

Yes, yarn v2 and later support the workspace protocol. Running `yarn workspace @org/app add @org/ui` records `"workspace:^"` in package.json, and yarn berry uses Plug'n'Play by default instead of node_modules.

Why should I avoid tsconfig paths for workspace package resolution?

tsconfig paths only patch TypeScript resolution and do not create real dependency links, so bundlers and runtime resolution can still fail. Using the package manager's workspace commands fixes actual linking in node_modules.