Skip to content
Join free
nrwl

Link Workspace Packages skill

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) you get resolution errors for workspace packages (@org/*) like "cannot find module", "failed to resolve import", "TS2307", or "cannot resolve".

$npx alyn-cli add link-workspace-packages
View this skill on GitHubnrwl/nx-ai-agents-config/skills/link-workspace-packages/SKILL.md
Pack stars
29
Pack installs
123k
Alyn Score
53/99
Updated
31 h ago
License
MIT

nrwl

Link Workspace Packages

What is the Link Workspace Packages skill?

Link Workspace Packages is a coding skill by nrwl for Claude Code, Cursor, Codex and other AI coding agents. 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) you get resolution errors for workspace packages (@org/*) like "cannot find module", "failed to resolve import", "TS2307", or "cannot resolve".

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

When to use it

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) you get resolution errors for workspace packages (@org/*) like "cannot find module", "failed to resolve import", "TS2307", or "cannot resolve".

What the SKILL.md covers

  • Detect Package Manager
  • Workflow
  • pnpm
  • yarn (v2+/berry)
  • npm
  • bun
  • Examples
  • Notes
Author
nrwl
Pack
nrwl/nx-ai-agents-config (10 skills)
Category
Coding, #1543 of 1826
Alyn Score
53 / 99
Files
1
License
MIT
Last updated
31 h ago
Works with
Claude Code, Claude, Cursor, Codex, Gemini CLI, Copilot

Link Workspace Packages compared to similar skills

SkillAlyn ScoreGitHub starsUpdated
Link Workspace Packages · nrwl532931 h ago
Cfe Patch Method · Nikolay-Shirokov5882310 days ago
Jlink · zhinkgit588128 days ago
Dsh Find Simplifications · qufei1993471.9k3 days ago

Install Link Workspace Packages

Pick your agent. Every command is ready to paste.

$npx alyn-cli add link-workspace-packages

Detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

$npx skills add nrwl/nx-ai-agents-config --skill link-workspace-packages

Or use the open skills CLI directly.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads link-workspace-packages when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the link-workspace-packages skill”. In Codex, type $link-workspace-packages.

The skill itself

SKILL.md

FolderGitHub

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.

# 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:

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

yarn (v2+/berry)

Also uses workspace: protocol.

yarn workspace @org/app add @org/ui

Result in package.json:

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

npm

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

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

Result in package.json:

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

npm resolves to local workspace automatically during install.


bun

Supports workspace: protocol (pnpm-compatible).

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

Result in package.json:

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

Examples

Example 1: pnpm - link ui lib to app

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

Example 2: npm - link multiple packages

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

Tips for Link Workspace Packages

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • It is part of a pack with 10 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about Link Workspace Packages

What does the Link Workspace Packages skill do?

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) you get resolution errors for workspace packages (@org/*) like "cannot find module", "failed to resolve import", "TS2307", or "cannot resolve".

How do I install Link Workspace Packages?

Run "npx alyn-cli add link-workspace-packages" in your project. The Alyn CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does Link Workspace Packages work in Cursor and Codex?

Yes. Link Workspace Packages uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

When should I use the Link Workspace Packages skill?

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) you get resolution errors for workspace packages (@org/*) like "cannot find module", "failed to resolve import", "TS2307", or "cannot resolve".

What is inside the Link Workspace Packages skill?

The SKILL.md covers Detect Package Manager, Workflow, pnpm, yarn (v2+/berry), npm, bun.

What is a good alternative to Link Workspace Packages?

Cfe Patch Method by Nikolay-Shirokov is the highest-ranked similar skill from another creator, with an Alyn Score of 58 compared to 53 for Link Workspace Packages.

Is Link Workspace Packages free?

Link Workspace Packages is open source on GitHub under the MIT license. It is free to install; check the license before commercial use.

Who made Link Workspace Packages?

Link Workspace Packages is published by nrwl in the nrwl/nx-ai-agents-config repository, together with 9 other skills.

Similar skills. From other creators.