workspace domain
owns the repository's package graph, source roots, task graph, and generation ordering.
why
a repository is a graph of packages and tasks before it is a set of files. source roots, import aliases, lint gates, and generation ordering group together because they all answer who may depend on what and in which order things build. implicit graph: every package change is a root-level negotiation. owned graph: each package evolves alone.
when to use
owns repository-structure decisions — package graph, source roots, import aliases, folder and file naming, lint and format gates, task graph, generation ordering. behavior of the code inside those packages belongs to other domains.
good and bad
bad
root package.json owns app scripts, lint rules, and local build behavior.
- the root becomes a polluted proxy for every workspace
- a new workspace cannot configure its own dependencies or build steps — they go into root, causing version conflicts across unrelated packages
- one workspace's linter configuration blocks another's build
- the root is a bottleneck for every change
good
each package owns generate, format, lint, typecheck, and build; root runs Turbo.
- ownership stays local; the root only orchestrates the declared pipeline
- each workspace declares its own dependencies and build steps; a new workspace is self-contained
- the root is minimal and change-proof
- parallel work in different packages never collides at the root
- a failing gate stays inside the package that owns it
- the task graph — not a human — decides build and test order