shepherdjerred/monorepo/bun-workspaces
Claude Code and agent skill by shepherdjerred/monorepo
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Current Bun workspace guidance for isolated and hoisted linkers, catalogs, filters, scripts, dependency classes, lockfiles, lifecycle trust, caches, publishing, TypeScript package exports, and containers. Use when configuring or reviewing a Bun monorepo.
Install
npx vskill@latest install shepherdjerred/monorepo/bun-workspacesSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Bun Workspaces
Use one root workspace and lockfile, resolve internal packages through workspace:* links and package exports, and choose script scheduling from dependency order and task lifetime. Do not hide packaging errors with TypeScript source aliases.
Current baseline
Verified against Bun 1.3.14 on 2026-08-03:
New workspace projects with lockfile configVersion = 1 default to the isolated linker. Existing and migrated projects preserve historical linker choices. Bun 1.3.14 adds an experimental isolated-linker global virtual store that is off by default.
Read references/releases.md for the 49-page research ledger. Read references/linkers-dependencies-and-lockfiles.md for linker, store, catalogs, dependency classes, lifecycle trust, and migration. Read references/scripts-builds-and-publishing.md for filters, scheduling, package exports, TypeScript, CI, containers, audit, pack, and publish.
Workspace declaration
The root owns the workspace patterns and shared lockfile:
catalog: resolves the singular default catalog. A named catalog entry uses catalog:name. Do not put a named default group under catalogs and reference it as bare catalog:.
Internal package dependency:
Bun rewrites workspace and catalog protocols appropriately during publication.
Linker selection
| Project | Default/behavior | |
|---|---|---|
| New workspace with current lockfile config | Isolated linker | |
| New single-package project | Hoisted linker | |
| Existing/pre-1.3.2 project | Preserves historical hoisted behavior unless changed | |
| npm/yarn migration | Preserves hoisted model | |
| pnpm migration | Uses isolated model |
Set the linker explicitly when deterministic strictness is required:
Isolated installs prevent phantom dependencies and create peer-set-specific package identities. Test tools and bundlers against the real layout; do not depend on accidental hoisting.
Cache versus global store
The global cache at ~/.bun/install/cache stores fetched package content and metadata. The experimental global virtual store is different: it is isolated-linker-only, disabled by default, and symlinks projects through the cache's links area.
Keep this setting machine-local unless the repository has revalidated parallel CI behavior. General upstream race-safety claims do not supersede the repository's known shared-store CI constraint.
Dependencies
Bun installs peer and optional dependencies by default. peerDependenciesMeta.optional means a peer may be absent; it does not force installation.
bun add does not have --filter; use --cwd or run from the package directory. Use omit flags only when the install contract intentionally excludes peer/optional packages.
Lockfile and CI
bun.lock is the authoritative text lockfile. Use:
bun ci is the concise frozen install. bun install --lockfile-only skips node_modules installation but writes the lockfile and can populate global cache metadata or Git/tarball dependencies.
Yarn v1 lockfile printing creates an interoperability artifact on every install; do not make it a generic default.
For bun.lockb migration, generate and inspect bun.lock, run a clean frozen install and focused verification, then remove the preserved binary source lockfile. Automatic migration occurs only when bun.lock is absent.
Lifecycle trust
Dependency lifecycle scripts are allow-listed. trustedDependencies replaces Bun's built-in trusted list rather than extending it; an empty list trusts none. Non-registry sources require explicit trust.
--ignore-scripts disables project and trusted dependency lifecycle scripts. In bunfig, use ignoreScripts; there is no documented lifecycle = ["postinstall"] policy setting.
Review untrusted scripts before enabling them:
Script scheduling
Filtered finite scripts honor workspace dependency order; independent packages can overlap. Keep local builds focused:
At this monorepo's root, use bunx turbo run build for repo-wide and focused builds so dependencies run in task-graph order. Never use bun run --filter '*' build here: bypassing the bounded Turbo task graph can launch thousands of processes and exhaust the machine.
Long-running dev servers block dependents under dependency ordering. Start only the intended independent servers. Run each selected workspace in its own terminal, or use the repository's bounded dev orchestrator:
Focused execution remains the default during development. Do not apply blanket parallelism to builds whose order matters.
Updates and overrides
bun update respects current semver ranges by default. For a reviewed workspace selection:
--latest can rewrite ranges across breaking versions and needs migration review.
Overrides/resolutions are top-level only and can affect direct or transitive dependencies. Document the reason and removal condition for every forced version.
TypeScript and package exports
Resolve workspace packages through Bun's node_modules links and each package's exports. TypeScript warns against paths entries that point at monorepo package sources because they bypass real package exports and consumer resolution.
Use project references for compiler graph ordering. Put the types export condition before runtime conditions:
Export every documented subpath or import public types from the root. Choose Bun, Node, or browser build targets from supported consumers. TypeScript normally belongs in devDependencies, not peers, unless consumers use a compiler API in the public contract.
Do not add skipLibCheck to conceal workspace declaration errors.
CI and containers
Use current oven-sh/setup-bun@v2 and pin the project's Bun version instead of latest. In Docker, preserve workspace manifest paths; a wildcard copy into one directory flattens manifests and breaks the declared layout.
Prefer a pinned multi-stage image, install against the complete/preserved workspace tree, copy only runtime artifacts, and run as the image's non-root bun user.
Pack, publish, and audit
Inspect package contents before publication:
Publishing is an external mutation requiring explicit package, registry, tag/access, artifact, and credentials. Bun strips/resolves workspace and catalog protocols. Publishing a supplied tarball does not run pack/publish lifecycle scripts. There is no implicit monorepo-wide publish command.
bun audit sends installed package/version data to npm and skips non-default registries. Account for that privacy and coverage boundary.
Review checklist
- Verify Bun 1.3.14 and the lockfile config/linker history.
- Use isolated installs explicitly when strict dependency boundaries matter.
- Keep experimental global store machine-local until CI is revalidated.
- Use singular default catalog and named
catalogscorrectly. - Add dependencies through package
--cwd; do not invent add filters. - Preserve peer/optional semantics and lifecycle trust policy.
- Use
bun ciand inspect lockfile migration before deleting the old lock. - Run finite builds dependency-aware and long-lived servers explicitly parallel.
- Resolve packages through workspace links/exports, not TypeScript source paths.
- Preserve workspace directories in Docker and use a non-root runtime stage.
- Dry-run and inspect package contents before authorized publication.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/dotfiles/dot_agents/skills/bun-workspaces/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shepherdjerred/monorepo/bun-workspaces)