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
TypeScript refactoring and modernization guidelines from a principal specialist perspective. This skill should be used when refactoring, reviewing, or modernizing TypeScript code to ensure type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving TypeScript type architecture, narrowing, generics, error handling, or migration to modern TypeScript features.
tools
Resolves TypeScript and JavaScript problems across type-level programming, performance, monorepo management, migration, and modern tooling. Invoke when diagnosing "type instantiation excessively deep" errors, migrating JS to TS, configuring strict tsconfig, debugging module resolution, or choosing between Biome/ESLint/Turborepo/Nx.
tools
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.
tools
Provides Tailwind CSS v4 performance optimization and best practices guidelines. Triggers when writing, reviewing, or refactoring Tailwind CSS v4 code; when working with Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.