JavaScript Monorepo Builds
Purpose
Help agents diagnose, plan, or review Turborepo-based JavaScript and TypeScript monorepo build problems by naming the real failure class first and then fixing the smallest honest seam. This is a guardrail, not a Turborepo manual.
Use When
- the task involves
turbo.json, package scripts, workspace filters, remote cache, or incremental CI
- a leaf package change causes too many rebuilds, missed dependents, or inconsistent cache hits
- the prompt is about
dependsOn, outputs, inputs, env, globalDependencies, or --affected
- package boundaries or CI checkout depth are part of the failure
- the answer needs repo evidence before it can choose a fix
Do Not Use When
- the work is not Turborepo-based
- the issue is a broad monorepo architecture discussion with no build-graph evidence
- another more specific skill already owns the exact runtime seam
- the prompt only needs generic JavaScript advice without graph, cache, boundary, or CI semantics
Quick Start
- Classify the request first as
graph fix, cache fix, boundary fix, or CI fix.
- Collect repo evidence:
turbo.json, workspace manifests, package scripts, lockfile, CI config, and the exact turbo commands the repo runs.
- Check
dependsOn, outputs, inputs, env, globalDependencies, and --affected against that evidence before proposing implementation.
- Choose the smallest honest change: a graph edge, cache key, workspace filter, boundary rule, or CI step.
- Verify with the narrowest command or config diff that proves the claim.
Operating Constraints
- Do not turn a graph or cache problem into a repo-wide rebuild or rewrite.
- Do not guess Turborepo semantics from memory when the repo evidence is available.
- Do not use all files as inputs unless the repo actually needs that hash surface.
- Do not omit
outputs for tasks that produce cached artifacts.
- Do not let local and CI cache inputs drift without explaining the difference.
- Do not trust
--affected on a shallow checkout or the wrong base ref.
- Do not hide boundary violations inside package scripts.
- Do not disable caching as the first response to a cache miss.
- Rejected trope: "just rebuild everything and move on."
- Better alternative: fix the exact graph edge, cache key, workspace filter, boundary rule, or CI checkout step that is wrong.
- Rejected trope: "rewrite the monorepo layout to make the build faster."
- Better alternative: keep the repo shape and adjust the task graph or cache contract first.
Inputs This Skill Expects
turbo.json or equivalent Turborepo config
- workspace manifests and package scripts
- lockfile(s)
- CI config, checkout settings, and cache settings
- the actual
turbo invocation used by local scripts or CI
- package boundary evidence when the prompt mentions a boundary violation
Output Contract
- Name the failure class first.
- State the smallest fix surface clearly.
- Tie the recommendation to the specific repo evidence.
- Explain
dependsOn, outputs, inputs, env, globalDependencies, and --affected before implementation advice.
- Keep the fix limited to graph order, cache key, workspace filter, boundary rule, or CI wiring unless the evidence proves more is needed.
- End with the next verifier and the evidence it should capture.
Procedure
- Read the repo evidence and the exact
turbo commands first.
- Classify the problem as
graph fix, cache fix, boundary fix, or CI fix.
- Trace the smallest evidence-backed change in
dependsOn, outputs, inputs, env, globalDependencies, workspace filters, or CI checkout and cache settings.
- Prefer a local graph or cache correction over a broad refactor.
- Verify with the narrowest command, diff, or config check that proves the chosen seam.
- Hand off to the next verifier with the repo evidence that supports the decision.
Pitfalls And Gotchas
- Cycles or overly broad edges in
dependsOn
- Missing or wrong
outputs
- Inputs that accidentally include everything
- Cache-key drift from environment or global dependency mismatch
--affected on a shallow clone or wrong base ref
- Missing remote cache env in CI
- Boundary leakage hidden in package scripts
- Repo-wide rebuilds when one edge or cache key is enough
Rejected Trope
- Rejected trope: treat a Turborepo cache miss as a reason to bypass the cache.
- Better alternative: inspect the hash surface, tighten
inputs or env, and keep the cache contract honest.
Progressive Disclosure
Start with the smallest useful decision: graph, cache, boundary, or CI fix. Expand only enough to prove the chosen seam. Keep the skill compact enough that it steers decisions instead of becoming a build-system manual.
Verification Pattern
Confirm the failure class, the relevant config surface, the exact turbo command or CI step, and one concrete proof step. Next verifier: build reviewer or CI checker; capture turbo.json, package scripts, lockfile, CI config, and the exact command line or diff that justifies the fix.
1---2name: javascript-monorepo-builds3description: Guardrail for Turborepo-based JavaScript/TypeScript monorepo build graphs, cache keys, workspace filters, boundaries, and incremental CI.4---56# JavaScript Monorepo Builds78## Purpose910Help agents diagnose, plan, or review Turborepo-based JavaScript and TypeScript monorepo build problems by naming the real failure class first and then fixing the smallest honest seam. This is a guardrail, not a Turborepo manual.1112### Use When1314- the task involves `turbo.json`, package scripts, workspace filters, remote cache, or incremental CI15- a leaf package change causes too many rebuilds, missed dependents, or inconsistent cache hits16- the prompt is about `dependsOn`, `outputs`, `inputs`, `env`, `globalDependencies`, or `--affected`17- package boundaries or CI checkout depth are part of the failure18- the answer needs repo evidence before it can choose a fix1920### Do Not Use When2122- the work is not Turborepo-based23- the issue is a broad monorepo architecture discussion with no build-graph evidence24- another more specific skill already owns the exact runtime seam25- the prompt only needs generic JavaScript advice without graph, cache, boundary, or CI semantics2627## Quick Start28291. Classify the request first as `graph fix`, `cache fix`, `boundary fix`, or `CI fix`.302. Collect repo evidence: `turbo.json`, workspace manifests, package scripts, lockfile, CI config, and the exact `turbo` commands the repo runs.313. Check `dependsOn`, `outputs`, `inputs`, `env`, `globalDependencies`, and `--affected` against that evidence before proposing implementation.324. Choose the smallest honest change: a graph edge, cache key, workspace filter, boundary rule, or CI step.335. Verify with the narrowest command or config diff that proves the claim.3435## Operating Constraints3637- Do not turn a graph or cache problem into a repo-wide rebuild or rewrite.38- Do not guess Turborepo semantics from memory when the repo evidence is available.39- Do not use all files as inputs unless the repo actually needs that hash surface.40- Do not omit `outputs` for tasks that produce cached artifacts.41- Do not let local and CI cache inputs drift without explaining the difference.42- Do not trust `--affected` on a shallow checkout or the wrong base ref.43- Do not hide boundary violations inside package scripts.44- Do not disable caching as the first response to a cache miss.45- Rejected trope: "just rebuild everything and move on."46- Better alternative: fix the exact graph edge, cache key, workspace filter, boundary rule, or CI checkout step that is wrong.47- Rejected trope: "rewrite the monorepo layout to make the build faster."48- Better alternative: keep the repo shape and adjust the task graph or cache contract first.4950## Inputs This Skill Expects5152- `turbo.json` or equivalent Turborepo config53- workspace manifests and package scripts54- lockfile(s)55- CI config, checkout settings, and cache settings56- the actual `turbo` invocation used by local scripts or CI57- package boundary evidence when the prompt mentions a boundary violation5859## Output Contract6061- Name the failure class first.62- State the smallest fix surface clearly.63- Tie the recommendation to the specific repo evidence.64- Explain `dependsOn`, `outputs`, `inputs`, `env`, `globalDependencies`, and `--affected` before implementation advice.65- Keep the fix limited to graph order, cache key, workspace filter, boundary rule, or CI wiring unless the evidence proves more is needed.66- End with the next verifier and the evidence it should capture.6768## Procedure69701. Read the repo evidence and the exact `turbo` commands first.712. Classify the problem as `graph fix`, `cache fix`, `boundary fix`, or `CI fix`.723. Trace the smallest evidence-backed change in `dependsOn`, `outputs`, `inputs`, `env`, `globalDependencies`, workspace filters, or CI checkout and cache settings.734. Prefer a local graph or cache correction over a broad refactor.745. Verify with the narrowest command, diff, or config check that proves the chosen seam.756. Hand off to the next verifier with the repo evidence that supports the decision.7677## Pitfalls And Gotchas7879- Cycles or overly broad edges in `dependsOn`80- Missing or wrong `outputs`81- Inputs that accidentally include everything82- Cache-key drift from environment or global dependency mismatch83- `--affected` on a shallow clone or wrong base ref84- Missing remote cache env in CI85- Boundary leakage hidden in package scripts86- Repo-wide rebuilds when one edge or cache key is enough8788### Rejected Trope8990- Rejected trope: treat a Turborepo cache miss as a reason to bypass the cache.91- Better alternative: inspect the hash surface, tighten `inputs` or `env`, and keep the cache contract honest.9293## Progressive Disclosure9495Start with the smallest useful decision: graph, cache, boundary, or CI fix. Expand only enough to prove the chosen seam. Keep the skill compact enough that it steers decisions instead of becoming a build-system manual.9697## Verification Pattern9899Confirm the failure class, the relevant config surface, the exact `turbo` command or CI step, and one concrete proof step. Next verifier: build reviewer or CI checker; capture `turbo.json`, package scripts, lockfile, CI config, and the exact command line or diff that justifies the fix.