This skill should be used when the user asks to "add Turborepo", "configure turbo.json", "set up the monorepo task graph", "add turbo caching", or "configure a Turborepo pipeline".
Configure Turborepo to orchestrate lint/test/build/typecheck tasks across all workspace packages with caching.
packages (required): array of workspace package paths (e.g., ['apps/frontend', 'apps/backend', 'packages/contracts']) — verify each is listed in pnpm-workspace.yamltasks (required): subset of ['build', 'lint', 'test', 'typecheck'] — only generate task entries for theseoutputsMap (required): per-task output globs for cache (e.g., {build: ['dist/**'], test: ['coverage/**']}) — substitute into each task's outputs arrayCreates/modifies:
turbo.json — task graph at the monorepo rootpackage.json (root) — adds turbo dev dependency and top-level lint, , , scripts that delegate to testbuildtypecheckturbo run <task>pnpm-workspace.yaml exists and lists all paths from the packages inputpackages has the task scripts from the tasks input in its own package.jsonVerify each path in the packages input is listed in pnpm-workspace.yaml. If a path is missing, add it to pnpm-workspace.yaml before continuing.
Install Turborepo as a root dev dependency:
pnpm add -D turbo -w
turbo.json at the monorepo root. Include only the task entries listed in the tasks input. For each task, substitute the output glob from outputsMap.<taskName> (omit outputs if outputsMap has no entry for that task):{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"lint": {
"dependsOn": [],
"outputs": []
},
"typecheck": {
"dependsOn": ["^build"],
"outputs": []
},
"test": {
"dependsOn": [],
"outputs": ["coverage/**"]
}
}
}
Remove any task block not present in the
tasksinput. Replace eachoutputsvalue with the corresponding entry fromoutputsMap— for example,outputsMap.build→["dist/**"]andoutputsMap.test→["coverage/lcov.info"]. Forlintandtypecheck, theoutputsarray stays[]since they produce no cacheable artifacts (unlessoutputsMapprovides values for them).
package.json scripts to delegate to Turborepo (add only the tasks from the tasks input):"lint": "turbo run lint",
"test": "turbo run test",
"build": "turbo run build",
"typecheck": "turbo run typecheck"
Run pnpm lint from the monorepo root — verify Turborepo picks up all apps and logs each package's output
Run pnpm lint again — verify cache hits appear as cache hit, replaying logs (FULL TURBO)
E_TASK_CYCLE: Circular dependsOn → remove the cycle; tasks within the same package cannot depend on each other via ^ — only cross-package dependency chains are supportedE_OUTPUTS_MISSING: Cache invalidates on every run → ensure the outputs glob from outputsMap matches the actual build artifact paths emitted by the compilerSee docs/project-overview.md → "INF-08 — Monorepo task graph (turbo.json)".