bundles/backend/skills/turborepo/SKILL.md
Turborepo monorepo build system guidance. Triggers on: `turbo.json`, task pipelines, `dependsOn`, caching, remote cache, the `turbo` CLI, `--filter`, `--affected`, CI optimization, environment variables, internal packages, monorepo structure, and package boundaries. Use when the user configures tasks or workflows, creates packages, sets up a monorepo, shares code between apps, runs changed packages, debugs cache behavior, or works in an `apps/` plus `packages/` workspace.
npx skillsauth add shipshitdev/library turborepoInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build system guidance for JavaScript and TypeScript monorepos using Turborepo.
turbo.json.package.json delegate with turbo run <task>.turbo <task> only for interactive one-off terminal commands, not in committed code.package.json so dependsOn: ["^build"] can resolve actual package relationships.// apps/web/package.json
{
"scripts": {
"build": "next build",
"lint": "eslint .",
"test": "vitest"
}
}
// turbo.json
{
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
},
"lint": {},
"test": {
"dependsOn": ["build"]
}
}
}
// root package.json
{
"scripts": {
"build": "turbo run build",
"lint": "turbo run lint",
"test": "turbo run test"
}
}
Read only the reference files needed for the task:
| Need | Read |
| --- | --- |
| Task definitions, dependsOn, outputs, persistent, package overrides | references/configuration/RULE.md, references/configuration/tasks.md |
| Global options, daemon, cacheDir, env mode | references/configuration/global-options.md |
| Cache misses or remote cache | references/caching/RULE.md, references/caching/gotchas.md, references/caching/remote-cache.md |
| Env vars, .env, strict vs loose mode | references/environment/RULE.md, references/environment/modes.md, references/environment/gotchas.md |
| --affected, --filter, package selection | references/filtering/RULE.md, references/filtering/patterns.md |
| CI, GitHub Actions, Vercel, turbo-ignore | references/ci/RULE.md, references/ci/github-actions.md, references/ci/vercel.md, references/ci/patterns.md, references/cli/commands.md |
| Repo structure, package creation, dependency management | references/best-practices/RULE.md, references/best-practices/structure.md, references/best-practices/packages.md, references/best-practices/dependencies.md |
| Watch mode and long-running dev tasks | references/watch/RULE.md, references/configuration/tasks.md |
| Package boundaries and isolation | references/boundaries/RULE.md |
Configure a task?
├─ Define dependencies or outputs → configuration/tasks.md
├─ Handle environment variables → environment/RULE.md
├─ Set package-specific overrides → configuration/RULE.md#package-configurations
├─ Add persistent/watch behavior → configuration/tasks.md + watch/RULE.md
└─ Tune global options → configuration/global-options.md
Cache issue?
├─ Outputs not restored → add or fix `outputs`
├─ Unexpected misses → caching/gotchas.md
├─ Remote cache issue → caching/remote-cache.md
└─ Env or .env drift → environment/gotchas.md
Need changed packages only?
├─ Default path → `turbo run <task> --affected`
├─ Custom comparison base → add `--affected-base=...`
└─ Custom package selection → filtering/RULE.md + filtering/patterns.md
CI setup?
├─ GitHub Actions → ci/github-actions.md
├─ Vercel deployment → ci/vercel.md
├─ Remote cache in CI → caching/remote-cache.md
└─ Skip unchanged work → ci/patterns.md + cli/commands.md
Repo/package structure?
├─ apps/ vs packages/ layout → best-practices/RULE.md
├─ Create internal package → best-practices/packages.md
├─ Workspace dependency management → best-practices/dependencies.md
└─ Enforce package boundaries → boundaries/RULE.md
turbo run, not embed app-specific task logic.turbo build or turbo lint commands in package.json, CI, or scripts. Use turbo run ... in committed code.prebuild chains that compile sibling packages instead of declaring workspace dependencies and using ^build.outputs on tasks that write files. Read the actual script before deciding whether a task is cacheable.env or .env files omitted from inputs, causing stale cache hits..env files in a monorepo, which create hidden coupling between packages.turbo.json instead of using per-package turbo.json files.See the detailed examples in:
references/configuration/gotchas.mdreferences/caching/gotchas.mdreferences/environment/gotchas.mdreferences/best-practices/structure.mdreferences/best-practices/packages.md{
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
},
"dev": {
"cache": false,
"persistent": true
}
}
}
{
"tasks": {
"transit": {
"dependsOn": ["^transit"]
},
"lint": {
"dependsOn": ["transit"]
}
}
}
Use this when a task can run in parallel but still needs dependency source changes to invalidate its cache.
Use turbo watch for file-change loops, not turbo run ... --watch patterns improvised in scripts. Read references/watch/RULE.md before configuring persistent, interruptible, or with.
turbo run ....dependsOn matches the actual dependency relationship: ^task for upstream packages, task for same-package prerequisites.outputs.env or globalEnv..env files are represented in inputs.--affected or filters when appropriate instead of rebuilding everything by default.Based on official Turborepo docs (library v2.9.7-canary.12): apps/docs/content/docs/ — https://turborepo.dev/docs
development
Coordinates a weekly engineering review of board accuracy, recent code changes, operational health, and scoped cleanup. Use for a recurring repository health review or a review of the last several days.
testing
Audits project board configuration and prepares explicitly requested setup, copy, or normalization changes while preserving the existing workflow and provider boundaries. Use when inspecting a board's fields, columns, scope, or configuration.
testing
Reconciles a project board with current work and delivery evidence, reports incomplete coverage and metadata gaps, and applies only approved provider-supported field changes. Use when auditing board drift, reviewing blocked work, or assessing upcoming delivery.
development
Walk through how a subsystem works. Use for "how does X work", code walkthroughs before changing something, and placement or ownership questions. Explains architecture, runtime flow, and onboarding mental models. Can critique architecture. Use why for motivation.