
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-codeInstalls 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→ pnpmyarn.lock→ yarnbun.lock/bun.lockb→ bunpackage-lock.json→ npm
Workflow
- Identify consumer package (the one importing)
- Identify provider package(s) (being imported)
- Add dependency using package manager's workspace syntax
- 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