turborepo

Configure Turborepo task pipelines, caching, and filtering for JavaScript monorepos.

Updated Dec 17, 2022
One-click install
npx skills add https://github.com/Foodshareclub/foodshare-web --skill turborepo-foodshareclub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: turborepo
Source: https://github.com/Foodshareclub/foodshare-web/tree/main/.agents/skills/turborepo
Command: npx skills add https://github.com/Foodshareclub/foodshare-web --skill turborepo-foodshareclub

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up and debugging a Turborepo monorepo involves many subtle configuration decisions—task dependencies, cache outputs, environment variable hashing, and CI filtering—where small mistakes silently break caching or parallelization. This Skill provides structured guidance, decision trees, and anti-pattern detection so your turbo.json, package scripts, and CI workflows follow Turborepo best practices from the start. ## Core Features & Use Cases - Task Pipeline Configuration: Register package tasks in turbo.json with correct dependsOn (^build vs build), outputs, inputs, and persistent settings, always preferring package tasks over root tasks. - Cache Debugging & Optimization: Diagnose cache misses with --summarize and --dry, configure remote caching with TURBO_TOKEN/TURBO_TEAM, and fix missing outputs or unhashed environment variables. - Filtering & CI Setup: Run only changed packages with --affected, use --filter syntax for names, directories, and git ranges, and set up GitHub Actions or Vercel deployments with turbo-ignore. - Use Case: Your CI builds every package on every pull request. Use this Skill to switch to turbo run build test lint --affected with proper fetch-depth and remote caching, so only changed packages and their dependents are rebuilt. ## Quick Start Ask the assistant to review your turbo.json and package.json scripts and configure a build, lint, and test pipeline that caches outputs and runs only affected packages in CI.

Frequently Asked Questions about turborepo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run only changed packages in Turborepo?

Use the --affected flag: turbo run build test lint --affected. It compares your branch against main (or master) and runs tasks in changed packages plus their dependents. Set TURBO_SCM_BASE to compare against a different base branch.

How do I configure task dependencies in turbo.json?

Use dependsOn with caret syntax: "build": { "dependsOn": ["^build"] } runs build in dependency packages first, while "test": { "dependsOn": ["build"] } runs build in the same package first. Register scripts in each package's package.json, not the root.

Why is my Turborepo cache not working?

Common causes are missing outputs keys for file-producing tasks, environment variables not declared in the env key, or .env files absent from inputs. Debug with --summarize or --dry to inspect hash inputs, and use --force to bypass cache entirely.

Should I use turbo or turbo run in package.json scripts?

Always use turbo run in package.json scripts, CI workflows, and any committed code. The shorthand turbo <task> is intended only for one-off terminal commands typed directly by humans.

Does Turborepo support remote caching in GitHub Actions?

Yes, via Vercel Remote Cache using either OpenID Connect with the setup-turborepo-remote-cache-action or a personal access token. Set TURBO_TOKEN and TURBO_TEAM environment variables, and use fetch-depth of at least 2 for --affected to work.

When should I use Root Tasks instead of package tasks?

Root Tasks (//#taskname) are only for work that cannot exist in packages, such as repo-wide release scripts or Vitest Projects' //#test. Default to package tasks since they enable parallelization, individual caching, and filtering.