link-workspace-packages

Installation
Summary

Link workspace packages in monorepos across npm, yarn, pnpm, and bun.

  • Detects package manager via packageManager field or lockfile presence, then uses the appropriate workspace linking command for each manager
  • pnpm and yarn use workspace: protocol; npm auto-symlinks workspace packages; bun supports workspace: protocol
  • Resolves "cannot find module" and import resolution errors by adding dependencies between sibling packages with proper symlink creation
  • Each manager has different hoisting and isolation behavior: npm/bun hoist to root, pnpm enforces strict isolation, yarn berry uses Plug'n'Play
SKILL.md

Link Workspace Packages

Add dependencies between packages in a monorepo. All package managers support workspaces but with different syntax.

Detect Package Manager

Check whether there's a packageManager field in the root-level package.json.

Alternatively check lockfile in repo root:

  • pnpm-lock.yaml → pnpm
  • yarn.lock → yarn
  • bun.lock / bun.lockb → bun
  • package-lock.json → npm

Workflow

  1. Identify consumer package (the one importing)
  2. Identify provider package(s) (being imported)
Related skills

More from nrwl/nx-ai-agents-config

Installs
1.5K
GitHub Stars
19
First Seen
Feb 4, 2026