link-workspace-packages
Skill18 starsChanged 6 months agoMITView on GitHub
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". DO NOT patch around with tsconfig paths or manual package.json edits - use the package manager''s workspace commands to fix actual linking.
- Installs packages
15 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- getlarge/themoltnetword for word, first seen Nov 3, 2026
- code-dimension/code-dimension-skillsword for word, first seen Oct 17, 2026
- daveyplate/better-auth-uiword for word, first seen Oct 9, 2026
- nrwl/nx-consoleword for word, first seen Oct 8, 2026
- ever-co/ever-teamsedited, first seen Oct 8, 2026
- dotCMS/coreword for word, first seen Oct 8, 2026
Other versions15 projects use a version of this.
Word for word · 14
- nrwl/nx★ 29k100% same
- tsparticles/tsparticles★ 9.1k100% same
- supabase/supabase-js★ 4.6k100% same
- better-auth-ui/better-auth-ui★ 1.7k100% same
- daveyplate/better-auth-ui★ 1.7k100% same
- nrwl/nx-console★ 1.4k100% same
- dotCMS/core★ 971100% same
- getlarge/themoltnet★ 28100% same
- anayatkhan1/kit★ 16100% same
- socialrobot-io/agent-kit★ 6100% same
4 more not listed
Edited · 1
- ever-co/ever-teams★ 606100% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository55 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-cost-manager-reducerSkill
- api-contract-reviewerSkill
- apps-language-rulesSkill
- cli-developerSkill
- contract-dto-consistency-reviewerSkill
- database-schema-reviewerSkill
- deep-code-reviewerSkill
- docs-managerSkill
- docs-publication-managerSkill
- feature-slice-designerSkill
- github-issue-solverSkill
- grasp-ooad-reviewSkill
- language-integratorSkill
- link-workspace-packagesSkill
- mcp-managerSkill
- migration-risk-reviewerSkill
- mobile-app-designerSkill
- mobile-app-integratorSkill
- mobile-app-product-ownerSkill
- mobile-app-reviewerSkill
- mobile-language-checkerSkill
- mobile-rulesetSkill
- mobil-ui-ux-rulesetSkill
- monitor-ciSkill
- nx-generateSkill
- nx-importSkill
- nx-pluginsSkill
- nx-run-tasksSkill
- nx-workspaceSkill
- product-owner-deciderSkill
- react-native-performance-reviewerSkill
- react-vite-performance-reviewerSkill
- release-readiness-reviewerSkill
- repo-architecture-auditorSkill
- repo-performance-guardSkill
- repository-pattern-reviewerSkill
- security-reviewerSkill
- smart-commitSkill
- supabase-api-rpc-reviewerSkill
- supabase-index-trigger-reviewerSkill
- supabase-rls-security-reviewerSkill
- supabase-schema-reviewerSkill
- tailwind-ui-ux-reviewerSkill
- ui-contract-guardSkill
- test-managerSkill
- unit-test-plannerSkill
- vite-performance-engineerSkill
- monitor-ciSkill
- nx-generateSkill
- nx-importSkill
- nx-pluginsSkill
- nx-run-tasksSkill
- nx-workspaceSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Add dependencies between packages in a monorepo.
- Very specific: line 12
Check whether there's a packageManager field in the root-level package.json.
- Distinctive: line 25
Add dependency using package manager's workspace syntax
- Very specific: line 26
Verify symlinks created in consumer's node_modules/
- Very specific: line 116
Check if dependency is declared in consumer's package.json
- Distinctive: line 117
If not, add it using appropriate command above
- Very specific: line 118
Run install (pnpm install, npm install, etc.)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
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 --workspaceResult in package.json:
{ "dependencies": { "@org/ui": "workspace:*" } }yarn (v2+/berry)
Also uses workspace: protocol.
yarn workspace @org/app add @org/uiResult in package.json:
{ "dependencies": { "@org/ui": "workspace:^" } }npm
No workspace: protocol. npm auto-symlinks workspace packages.
npm install @org/ui --workspace @org/appResult 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/uiResult in package.json:
{ "dependencies": { "@org/ui": "workspace:*" } }Examples
Example 1: pnpm - link ui lib to app
pnpm add @org/ui --filter @org/app --workspaceExample 2: npm - link multiple packages
npm install @org/data-access @org/ui --workspace @org/dashboardExample 3: Debug "Cannot find module"
- Check if dependency is declared in consumer's
package.json - If not, add it using appropriate command above
- 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)
- npm/bun: hoist shared deps to root
- Root
package.jsonshould have"private": trueto prevent accidental publish
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

