Fixes workspace module resolution errors by correctly linking internal dependencies using npm commands.
Install
mkdir -p .claude/skills/link-workspace-packages-vehpus && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15952" && unzip -o skill.zip -d .claude/skills/link-workspace-packages-vehpus && rm skill.zipInstalls to .claude/skills/link-workspace-packages-vehpus
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Link workspace packages in this npm workspace. 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". DO NOT patch around with tsconfig paths or manual package.json edits - use npm workspace commands to fix actual linking.Key capabilities
- →Identify consumer and provider packages in an npm workspace
- →Add dependencies using npm's workspace syntax
- →Verify symlinks are created in the consumer's `node_modules/`
- →Debug "Cannot find module" errors for workspace packages
- →Install multiple packages to a specific workspace
- →Ensure `package.json` has `
How it works
This skill uses npm workspace commands to link local packages by adding dependencies and verifying the creation of symlinks.
Inputs & outputs
When to use link-workspace-packages
- →Linking local workspace packages
- →Fixing module resolution errors
- →Adding sibling package dependencies
About this skill
Link Workspace Packages
Add dependencies between packages in this npm workspace.
Confirm Workspace Context
Check the root package.json for a packageManager field and confirm the committed root package-lock.json is present.
Workflow
- Identify consumer package (the one importing)
- Identify provider package(s) (being imported)
- Add dependency using npm's workspace syntax
- Verify symlinks created in consumer's
node_modules/
npm
npm links local workspace packages during install when the dependency name matches another workspace package.
# From the workspace root
npm install @org/ui --workspace @org/app
# Or from inside the consumer package directory
npm install @org/ui
Result in package.json:
{ "dependencies": { "@org/ui": "^0.0.1" } }
npm usually saves the current workspace package version range and resolves it to the local workspace during install.
Examples
Example 1: Link ui lib to app
npm install @org/ui --workspace @org/app
Example 2: npm - link multiple packages
npm install @org/data-access @org/ui --workspace @org/dashboard
Example 3: Debug "Cannot find module"
- Check if dependency is declared in consumer's
package.json - If not, add it using appropriate command above
- Run
npm installat the workspace root
Notes
- Symlinks appear in
<consumer>/node_modules/@org/<package> - npm workspaces hoist shared dependencies to the root
node_modulesby default, so each package should still declare its direct dependencies explicitly. - Root
package.jsonshould have"private": trueto prevent accidental publish
When not to use it
- →When patching around with tsconfig paths
- →When making manual package.json edits
Limitations
- →Root `package.json` should have `"private": true`
- →npm usually saves the current workspace package version range
- →npm workspaces hoist shared dependencies to the root `node_modules`
How it compares
This skill provides a workspace-aware method for linking npm packages, directly addressing resolution errors with proper symlinks, unlike manual `tsconfig` or `package.json` modifications.
Compared to similar skills
link-workspace-packages side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| link-workspace-packages (this skill) | 0 | 2mo | Review | Beginner |
| agent-release-manager | 0 | 6mo | Review | Intermediate |
| upgrade-deps | 0 | 2mo | No flags | Advanced |
| run-nx-generator | 5 | 3mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
agent-release-manager
ruvnet
Agent skill for release-manager - invoke with $agent-release-manager
upgrade-deps
obot-platform
Upgrade dependencies and runtimes safely, run CI, and report higher-risk options.
run-nx-generator
nrwl
Run Nx generators with prioritization for workspace-plugin generators. Use this when generating code, scaffolding new features, or automating repetitive tasks in the monorepo.
upgrading-expo
sickn33
Upgrade Expo SDK versions
pnpm
antfu
Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces, or managing dependencies with catalogs, patches, or overrides.
pnpm-upgrade
openai
Keep pnpm current: run pnpm self-update/corepack prepare, align packageManager in package.json, and bump pnpm/action-setup + pinned pnpm versions in .github/workflows to the latest release. Use this when refreshing the pnpm toolchain manually or in automation.