link-workspace-packages

Detect the monorepo package manager and link workspace packages with correct syntax.

Updated May 14, 2026
One-click install
npx skills add https://github.com/chroniicallydiistracted/LorcanaChamp --skill link-workspace-packages-chroniicallydiistracted
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: link-workspace-packages
Source: https://github.com/chroniicallydiistracted/LorcanaChamp/tree/main/references/lorcana-simulator/.opencode/skills/link-workspace-packages
Command: npx skills add https://github.com/chroniicallydiistracted/LorcanaChamp --skill link-workspace-packages-chroniicallydiistracted

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves monorepo dependency linking issues where workspace packages like @org/* cannot be resolved, triggering errors such as cannot find module or TS2307.

Core Features & Use Cases

  • Detects the correct workspace package manager: Chooses pnpm, yarn (berry), npm, or bun based on packageManager metadata or lockfiles.
  • Applies the proper workspace linking workflow: Uses each manager’s supported workspace syntax to wire consumer and provider packages without hacks.
  • Helps verify the result: Confirms that symlinks are created in the consumer’s node_modules according to the manager’s expected behavior.

Use case: After generating or adding a new package in a monorepo, the app imports @org/ui but fails to resolve it; this Skill guides you to declare the dependency using the correct workspace command for your tooling.

Quick Start

Use the link-workspace-packages skill to link your newly created workspace package to the consumer package that is importing it.

Frequently Asked Questions about link-workspace-packages

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

FAQPage Schema
Why does my monorepo get a cannot find module error when importing a sibling @org/* package?

A cannot find module error for sibling @org/* packages in a monorepo usually means workspace dependency linking is missing or incorrect. You must declare the dependency using your package manager's supported workspace protocol so symlinks are properly created.

How do I link workspace packages in a monorepo using pnpm or yarn?

To link workspace packages in a monorepo, detect your package manager from package.json or lockfiles, then apply the correct workspace dependency syntax. This ensures pnpm or yarn creates the proper symlinks in the consumer's node_modules.

Does npm install --workspace work for linking newly created packages in a monorepo?

Yes, npm install --workspace works for linking newly created packages by wiring consumer and provider packages. The correct approach depends on detecting your specific manager from lockfiles to use the proper workspace protocol.

What is the best way to fix TS2307 errors when wiring dependencies in a TypeScript monorepo?

Fixing TS2307 errors in a TypeScript monorepo requires correctly wiring workspace dependencies using the manager-supported syntax. This resolves module-resolution failures by ensuring symlinks are correctly created for the imported @org/* packages.

How does workspace package resolution work across different Node package managers?

Workspace package resolution works by using manager-specific workspace protocols to wire dependencies and create symlinks. Each manager like pnpm, yarn, npm, or bun has supported workspace syntax that must be matched to your lockfile configuration.

Can I use the bun workspace protocol to fix dependency linking for sibling packages?

Yes, the bun workspace protocol can fix dependency linking for sibling packages. The system detects your package manager from package.json metadata or lockfiles and applies the matching workspace syntax to create correct symlinks.