nrwl avatar

Link Workspace Packages

This handles the surprisingly fiddly task of wiring up dependencies between packages in a monorepo, whether you're using npm, yarn, pnpm, or bun. It knows when to use workspace protocols versus let the package manager auto-symlink, and critically, it recognizes when "cannot find module" errors mean you need proper workspace linking instead of tsconfig path hacks. The workflow is straightforward: detect your package manager from lockfiles, identify which package needs which dependency, run the right command with the right flags. Honestly, the main value is not having to remember whether your setup wants `--filter`, `--workspace`, or just a plain add from the right directory.

skills.sh installs
3.1K
GitHub stars
30
last updated
Aug 21, 2026

Install

$ npx -y skills add nrwl/nx-ai-agents-config --skill link-workspace-packages --agent claude-code

Installs into .claude/skills of the current project.

Files

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.

# 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

Sponsors

Details

Repository
github.com/nrwl/nx-ai-agents-config
Categories
AI & Agent Building, Debugging
First seen
Apr 16, 2026

More from nrwl/nx-ai-agents-config

All 7
1paulrberg avatareffect-tspaulrberg/agent-skillsUse for nontrivial Effect-TS work including services/layers, typed errors, Schema/JSONSchema, Config, runtime/concurrency, @effect/vitest, @effect/ai, @effect/s3.1Kskills.sh installs
2nrwl avatarnx-pluginsnrwl/nx-ai-agents-configFind and add Nx plugins. USE WHEN user wants to discover available plugins, install a new plugin, or add support for a specific framework or technology to the w3.1Kskills.sh installs
3shubhamsaboo avatarstrategy-advisorshubhamsaboo/awesome-llm-appsHigh-level strategic thinking and business decision guidance for planning and direction-setting. Use when: making strategic decisions, evaluating business optio3.1Kskills.sh installs
4coinbase avatartradecoinbase/agentic-wallet-skillsSwap or trade tokens on Base or Polygon. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and POL. C3.1Kskills.sh installs
5hashicorp avatarpush-to-registryhashicorp/agent-skillsPush Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version cont3.1Kskills.sh installs
6openai avatarfigma-useopenai/skills**MANDATORY prerequisite** — you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Sk3.1Kskills.sh installs