turborepo

Configure and optimize Turborepo task pipelines, caching, and monorepo build orchestration.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal --skill turborepo-zubairimtiaz3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: turborepo
Source: https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal/tree/main/.agents/skills/turborepo
Command: npx skills add https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal --skill turborepo-zubairimtiaz3

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up and maintaining a JavaScript/TypeScript monorepo build system involves tricky decisions around task dependencies, cache invalidation, environment variables, and CI configuration. This Skill provides expert guidance for Turborepo so tasks run in parallel, caches hit reliably, and only changed packages get rebuilt. ## Core Features & Use Cases - Task Pipeline Configuration: Define tasks in turbo.json with correct dependsOn, outputs, inputs, and env keys, following the package-tasks-over-root-tasks principle. - Caching & Filtering: Debug cache misses, set up Vercel Remote Cache, and use --affected or --filter to run only changed packages and their dependents. - CI/CD & Best Practices: Set up GitHub Actions workflows, enforce package boundaries, structure internal packages, and manage workspace dependencies. - Use Case: Your CI builds every package on every pull request. Use this Skill to switch to turbo run build test lint --affected with remote caching so only changed packages and their dependents are rebuilt. ## Quick Start Ask the assistant to configure a build pipeline in turbo.json for your monorepo with caching and affected-package filtering enabled.

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. Declare outputs like ["dist/**"] so results are cached.

Why is my Turborepo cache not working?

Cache misses usually come from missing outputs keys, undeclared environment variables, or .env files not listed in inputs. Debug with --summarize or --dry to inspect hash inputs, and check that lockfiles and globalDependencies are configured correctly.

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 by humans or agents.

Does Turborepo support environment variables in caching?

Yes. List variables in a task's env key or globalEnv so changes invalidate the cache. Use passThroughEnv for runtime-only variables that should not affect hashing, and add .env files to inputs so edits trigger rebuilds.

When should I use Root Tasks instead of package tasks?

Root Tasks (//#taskname) are only for work that truly cannot live in packages, such as repo-wide release scripts or Vitest Projects' //#test. Prefer package tasks because they enable parallelization, per-package caching, and filtering.