AIPM
Theme

AIPM package

Link Workspace Packages

@nrwl/link-workspace-packages@1.0.0

Link workspace packages in monorepos (npm, yarn, pnpm, bun).

Scanned · no issues · Oct 22, 2026

GitHub stars: ★ 29

LinkedInPost

Install Skill

Pins this version in aipm.package.json and aipm-lock.json.

aipm add @nrwl/link-workspace-packages@1.0.0

Without project tracking

Writes the skill files only. Add --no-init to skip aipm.package.json and the lockfile.

aipm add @nrwl/link-workspace-packages@1.0.0 --no-init

How to use

Install the skill above, then run this in your AI tool:

/link-workspace-packages <your description>

About

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

Source

What gets added to your project

Preview every file this package writes on install before you run the command above.

Summary

Link workspace packages in monorepos (npm, yarn, pnpm, bun). USE WHEN: (1) you just created or generated new packages and need to wire up their dependencies, (2) user imports from a sibling package and needs to add it as a dependency, (3...

Skill instructions

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)
  3. Add dependency using package manager's workspace syntax
  4. Verify symlinks created in consumer's node_modules/

pnpm

Uses workspace: protocol - symlinks only created when explicitly declared.

bash
# From consumer directory
pnpm add @org/ui --workspace

# Or with --filter from anywhere
pnpm add @org/ui --filter @org/app --workspace

Result in package.json:

json
{ "dependencies": { "@org/ui": "workspace:*" } }

yarn (v2+/berry)

Also uses workspace: protocol.

bash
yarn workspace @org/app add @org/ui

Result in package.json:

json
{ "dependencies": { "@org/ui": "workspace:^" } }

npm

No workspace: protocol. npm auto-symlinks workspace packages.

bash
npm install @org/ui --workspace @org/app

Result in package.json:

json
{ "dependencies": { "@org/ui": "*" } }

npm resolves to local workspace automatically during install.


bun

Supports workspace: protocol (pnpm-compatible).

bash
cd packages/app && bun add @org/ui

Result in package.json:

json
{ "dependencies": { "@org/ui": "workspace:*" } }

Examples

Example 1: pnpm - link ui lib to app

bash
pnpm add @org/ui --filter @org/app --workspace

Example 2: npm - link multiple packages

bash
npm install @org/data-access @org/ui --workspace @org/dashboard

Example 3: Debug "Cannot find module"

  1. Check if dependency is declared in consumer's package.json
  2. If not, add it using appropriate command above
  3. Run install (pnpm install, npm install, etc.)

Notes

  • Symlinks appear in <consumer>/node_modules/@org/<package>
  • Hoisting differs by manager:
    • npm/bun: hoist shared deps to root node_modules
    • pnpm: no hoisting (strict isolation, prevents phantom deps)
    • yarn berry: uses Plug'n'Play by default (no node_modules)
  • Root package.json should have "private": true to prevent accidental publish

Loading package files…

Share this package

Add an Install with AIPM badge

Add this badge to a GitHub README so readers can open the package page and install the same version.

Install with AIPM
[![Install with AIPM](https://www.aipm-registry.com/install-with-aipm.svg)](https://www.aipm-registry.com/skills/nrwl/link-workspace-packages/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)

Publisher

Nx

This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.

AI assistant context

What this skill is for

@nrwl/link-workspace-packages@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: Link workspace packages in monorepos (npm, yarn, pnpm, bun). USE WHEN: (1) you just created or generated new packages and need to wire up their dependencies, (2) user imports from a sibling package and needs to add it as a dependency, (3...

Install
aipm add @nrwl/link-workspace-packages@1.0.0
Use after install
/link-workspace-packages <your description>

Tool targets

Install command by target

Add --no-init to any of these when you want the skill files without aipm.package.json or aipm-lock.json.

cursor

Run this variant when you want to install the package into cursor.

aipm add @nrwl/link-workspace-packages@1.0.0 --target cursor --ci

claude

Run this variant when you want to install the package into claude.

aipm add @nrwl/link-workspace-packages@1.0.0 --target claude --ci

Discussion

Comments (0)

Loading comments…

Package FAQ

Install and compatibility

How to install
Run aipm add @nrwl/link-workspace-packages@1.0.0 in a project that has AIPM initialized.
Supported tools
@nrwl/link-workspace-packages@1.0.0 supports All tools.

Before installing

AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.