typescript-monorepo
install
source · Clone the upstream repo
git clone https://github.com/unoplat/unoplat-code-confluence
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/unoplat/unoplat-code-confluence "$T" && mkdir -p ~/.claude/skills && cp -r "$T/unoplat-code-confluence-query-engine/src/unoplat_code_confluence_query_engine/skills/typescript-monorepo" ~/.claude/skills/unoplat-unoplat-code-confluence-typescript-monorepo && rm -rf "$T"
manifest:
unoplat-code-confluence-query-engine/src/unoplat_code_confluence_query_engine/skills/typescript-monorepo/SKILL.mdsource content
TypeScript Monorepo Workflow Guidance
Install Commands
- Workspace-scoped install runs from workspace root, not leaf
- bun:
at workspace rootbun install - pnpm:
at workspace rootpnpm install - npm:
at workspace rootnpm ci - working_directory = workspace root (repo-relative)
Workspace Root Discovery
- If
is present, use it as the direct hint for workspace-owned commandsworkspace_root - If
is missing but provenance is inherited, walk upward fromworkspace_root
to find the nearest owning workspace rootcodebase_path - Inspect parent directories one level at a time with absolute paths using
andget_directory_treeread_file_content - Stop when you find the nearest workspace-owned signals such as
, a rootpnpm-workspace.yaml
withpackage.json
, a lockfile,workspaces
, orturbo.jsonnx.json - Do not assume the leaf owns install/build commands just because the exact workspace root was not precomputed
Build Commands
- Turborepo:
orturbo run build
at workspace rootbun run build - Individual:
from workspace rootbun run build --filter <package> - Check turbo.json or nx.json for build pipeline configuration
- working_directory = workspace root
Test/Lint/TypeCheck Commands
- Usually leaf-specific: run from codebase root (omit working_directory)
- Some monorepos configure workspace-level lint/test via turbo.json/nx.json
- Inspect the leaf's package.json scripts section for available commands
Working Directory Rules
- working_directory = workspace root for install/build commands
- working_directory = omit (None) for leaf-local test/lint/type_check
- working_directory = "." when command must run from repository root
- If both workspace-level and leaf-level commands exist for same stage, emit both with distinct working_directory
Config File Path Rules
- config_file must always be repository-root-relative
- Never use absolute paths in config_file
- Never use codebase-relative
segments in config_file.. - For workspace-owned configs above the leaf, emit the full repository-root path, for example:
infra/services/turbo.jsoninfra/services/pnpm-workspace.yaml
Upward Discovery Example
- Given
and inherited provenance with nocodebase_path = /opt/unoplat/repositories/acme/infra/services/apps/apiworkspace_root - Inspect
, then/opt/unoplat/repositories/acme/infra/services/apps/api
, then/opt/unoplat/repositories/acme/infra/services/apps/opt/unoplat/repositories/acme/infra/services - If
exists, use repo-relative/opt/unoplat/repositories/acme/infra/services/pnpm-workspace.yaml
as the workspace rootinfra/services - Then emit workspace-owned commands like install/build with
working_directory = "infra/services"
Package Manager Inheritance
- Leaf inherits manager from nearest workspace aggregator
- Commands use the inherited manager's CLI (bun, pnpm, npm, yarn)
- Lock files live at workspace root, not leaf
- If leaf has its own local manager, provenance=local and no workspace root