
Turborepo
Configure Turborepo task pipelines, package-level scripts, remote cache, and CI filters for a JavaScript/TypeScript monorepo with apps and packages folders.
Overview
Turborepo is an agent skill most often used in Build (also Ship) that teaches package-level task pipelines, turbo.json, and cache-aware monorepo workflows for JS/TS repos.
Install
npx skills add https://github.com/vercel-labs/vercel-skills --skill turborepoWhat is this skill?
- Enforces package tasks in each package.json, not root task logic, to preserve parallel execution
- Covers turbo.json dependsOn, caching, remote cache, --filter, and --affected for changed-package CI
- Documents environment variables, internal packages, boundaries, and monorepo best practices
- Delegates from root package.json via turbo run only
- Targets turbo.json, turbo CLI, and apps/packages directory layouts
- Hard rule: do not create root tasks—always package tasks plus turbo.json registration
Adoption & trust: 57 installs on skills.sh; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have multiple apps and shared packages but builds are slow, duplicated at the root, or CI runs everything because turbo.json and per-package scripts are misaligned.
Who is it for?
Solo builders shipping a Next.js or Node monorepo on Vercel or self-hosted CI who need turbo.json and remote cache set up correctly the first time.
Skip if: Single-package repos with no apps/packages split, or teams that only need npm workspaces without a task orchestrator.
When should I use this skill?
User configures turbo.json, task pipelines, dependsOn, caching, remote cache, turbo CLI, --filter, --affected, monorepo apps/packages, or shares code between apps.
What do I get? / Deliverables
After applying the skill, each package owns its scripts, turbo.json registers consistent tasks, and turbo run leverages caching and --affected so CI and local dev only pay for what changed.
- Correct turbo.json task definitions
- Per-package scripts aligned with pipeline
- CI commands using turbo run and filters
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Monorepo task graphs and package scripts are defined during product construction before day-to-day shipping cadence stabilizes. Turborepo wires shared libraries, apps, and tooling into one orchestrated build graph—the integration layer of a multi-package codebase.
Where it fits
Wire shared UI and API packages with consistent build, lint, and test tasks in each package.json plus root turbo.json.
Trim CI to turbo run build --filter=...[origin/main] so pull requests only build affected apps.
Enable remote cache and env var passthrough so production-like builds stay deterministic across laptops and CI.
How it compares
Use for monorepo orchestration and cache graphs, not as a substitute for framework-specific deploy skills like Vercel or Next.js routing docs.
Common Questions / FAQ
Who is turborepo for?
Indie and solo developers (and small teams) maintaining JavaScript or TypeScript monorepos with multiple apps and shared packages who want an agent to configure Turborepo correctly.
When should I use turborepo?
Use it when you create or edit turbo.json, set up task pipelines and dependsOn, add internal packages, configure remote cache, run turbo with --filter or --affected, or debug cache behavior during build and ship CI tuning.
Is turborepo safe to install?
It is guidance-only skill metadata; review the Security Audits panel on this Prism page before trusting any third-party skill package in your agent.
SKILL.md
READMESKILL.md - Turborepo
# Turborepo Skill Build system for JavaScript/TypeScript monorepos. Turborepo caches task outputs and runs tasks in parallel based on dependency graph. ## IMPORTANT: Package Tasks, Not Root Tasks **DO NOT create Root Tasks. ALWAYS create package tasks.** When creating tasks/scripts/pipelines, you MUST: 1. Add the script to each relevant package's `package.json` 2. Register the task in root `turbo.json` 3. Root `package.json` only delegates via `turbo run <task>` **DO NOT** put task logic in root `package.json`. This defeats Turborepo's parallelization. ```json // DO THIS: Scripts in each package // apps/web/package.json { "scripts": { "build": "next build", "lint": "eslint .", "test": "vitest" } } // apps/api/package.json { "scripts": { "build": "tsc", "lint": "eslint .", "test": "vitest" } } // packages/ui/package.json { "scripts": { "build": "tsc", "lint": "eslint .", "test": "vitest" } } ``` ```json // turbo.json - register tasks { "tasks": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] }, "lint": {}, "test": { "dependsOn": ["build"] } } } ``` ```json // Root package.json - ONLY delegates, no task logic { "scripts": { "build": "turbo run build", "lint": "turbo run lint", "test": "turbo run test" } } ``` ```json // DO NOT DO THIS - defeats parallelization // Root package.json { "scripts": { "build": "cd apps/web && next build && cd ../api && tsc", "lint": "eslint apps/ packages/", "test": "vitest" } } ``` Root Tasks (`//#taskname`) are ONLY for tasks that truly cannot exist in packages (rare). ## Secondary Rule: `turbo run` vs `turbo` **Always use `turbo run` when the command is written into code:** ```json // package.json - ALWAYS "turbo run" { "scripts": { "build": "turbo run build" } } ``` ```yaml # CI workflows - ALWAYS "turbo run" - run: turbo run build --affected ``` **The shorthand `turbo <tasks>` is ONLY for one-off terminal commands** typed directly by humans or agents. Never write `turbo build` into package.json, CI, or scripts. ## Quick Decision Trees ### "I need to configure a task" ``` Configure a task? ├─ Define task dependencies → references/configuration/tasks.md ├─ Lint/check-types (parallel + caching) → Use Transit Nodes pattern (see below) ├─ Specify build outputs → references/configuration/tasks.md#outputs ├─ Handle environment variables → references/environment/RULE.md ├─ Set up dev/watch tasks → references/configuration/tasks.md#persistent ├─ Package-specific config → references/configuration/RULE.md#package-configurations └─ Global settings (cacheDir, daemon) → references/configuration/global-options.md ``` ### "My cache isn't working" ``` Cache problems? ├─ Tasks run but outputs not restored → Missing `outputs` key ├─ Cache misses unexpectedly → references/caching/gotchas.md ├─ Need to debug hash inputs → Use --summarize or --dry ├─ Want to skip cache entirely → Use --force or cache: false ├─ Remote cache not working → references/caching/remote-cache.md └─ Environment causing misses → references/environment/gotchas.md ``` ### "I want to run only changed packages" ``` Run only what changed? ├─ Changed packages + dependents (RECOMMENDED) → turbo run build --affected ├─ Custom base branch → --affected --affected-base=origin/develop ├─ Manual git comparison → --filter=...[origin/main] └─ See all filter options → references/filtering/RULE.md ``` **`--affected` is the pri