turborepo

Configure and optimize Turborepo task pipelines, caching, and monorepo workflows.

7|1|Updated Mar 29, 2024
One-click install
npx skills add https://github.com/aBgAmeuR/harmony --skill turborepo-abgameur
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: turborepo
Source: https://github.com/aBgAmeuR/harmony/tree/main/.agents/skills/turborepo
Command: npx skills add https://github.com/aBgAmeuR/harmony --skill turborepo-abgameur

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up and debugging Turborepo monorepos involves many subtle configuration decisions—task dependencies, cache inputs, environment variables, and filtering—that are easy to get wrong, leading to slow builds, broken caches, and incorrect task orchestration. ## Core Features & Use Cases - Task Pipeline Configuration: Guides correct setup of turbo.json tasks, dependsOn relationships, outputs, and package tasks versus root tasks. - Cache Debugging & Optimization: Diagnoses cache misses, configures remote caching, and explains hash inputs including environment variables and .env files. - Filtering & CI Integration: Covers --affected, --filter syntax, GitHub Actions setup, and turbo-ignore for running only changed packages. - Use Case: When your CI builds every package on every pull request, use this Skill to configure turbo run build --affected with proper remote caching so only changed packages and their dependents are rebuilt. ## Quick Start Ask the assistant to configure a build and test pipeline in turbo.json for your monorepo with proper caching and dependency ordering.

Frequently Asked Questions about turborepo

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

FAQPage Schema
How do I configure a build pipeline in turbo.json?

Define a build task with dependsOn set to ["^build"] so dependency packages build first, and declare outputs like ["dist/**"] so results are cached. Add the build script to each package's package.json and delegate from root with turbo run build.

How do I run tasks only for changed packages in Turborepo?

Use the --affected flag, for example turbo run build --affected, which compares your branch against the default branch and runs tasks in changed packages plus their dependents. You can customize the base with --affected-base=origin/develop.

Why is my Turborepo cache not working?

Common causes include missing outputs keys for file-producing tasks, environment variables not declared in env, or .env files absent from inputs. Use --summarize or --dry to inspect hash inputs and identify what invalidates the cache.

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 commands typed directly in a terminal.

How do I set up Turborepo remote caching in GitHub Actions?

Add TURBO_TOKEN as a secret and TURBO_TEAM as a variable in your repository settings, then expose them as environment variables in the workflow. Also set fetch-depth to at least 2 on checkout so --affected can compute the merge base.

When should I use root tasks instead of package tasks?

Root tasks (//#taskname) should only be used for work that truly cannot live in a package, such as repo-wide release scripts or Vitest Projects' //#test. Everything else should be a package task to preserve parallelization, per-package caching, and filtering.