turborepo
What it does
This skill guides your AI through Turborepo, a build system for projects that hold several apps and packages in one repository. It is for developers who want faster builds and a clear task order.
When to use it
- βWhen you set up a monorepo with several apps or shared packages.
- βWhen you edit turbo.json or need tasks to run in the right order.
- βWhen your builds are slow and you want to use caching or run only the parts that changed.
Skill link
https://github.com/trycompai/crm/blob/release/.agents/skills/turborepo/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up Turborepo for my monorepo so the build and test tasks run in parallel.β
5 new skills a week. 1 minute to read.
How it works
The skill explains that scripts should live in each package, then registers the tasks in turbo.json so Turborepo can run them in parallel and reuse cached results.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
Prefer package tasks over Root Tasks.
When creating tasks/scripts/pipelines, you MUST default to package tasks:
- Add the script to each relevant package's
package.json - Register the task in root
turbo.json - Root
package.jsononly delegates viaturbo run <task>
DO NOT put task logic in root package.json when it can live in packages. This defeats Turborepo's parallelization.
// 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" } }
// turbo.json - register tasks
{
"tasks": {
"build": { "dependsOn": ["^build"], "outputs": ["dist/**"] },
"lint": {},
"test": { "dependsOn": ["build"] }
}
}
// Root package.json - ONLY delegates, no task logic
{
"scripts": {
"build": "turbo run build",
"lint": "turbo run lint",
"test": "turbo run test"
}
}
// 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, such as Vitest Projects' //#test, repo-wide release scripts, or tooling that does not invoke turbo itself.
Secondary Rule: turbo run vs turbo
Always use turbo run when the command is written into code:
// package.json - ALWAYS "turbo run"
{
"scripts": {
"build": "turbo run build"
}
}
# 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 primary way to run only changed packages. It automatically compares against the default branch and includes dependents.
"I want to filter packages"
Filter packages?
ββ Only changed packages β --affected (see above)
ββ By package name β --filter=web
ββ By directory β --filter=./apps/*
ββ Package + dependencies β --filter=web...
ββ Package + dependents β --filter=...web
ββ Complex combinations β references/filtering/patterns.md
"Environment variables aren't working"
Environment issues?
ββ Vars not available at runtime β Strict mode filtering (default)
ββ Cache hits with wrong env β Var not in `env` key
ββ .env changes not causing rebuilds β .env not in `inputs`
ββ CI variables missing β references/environment/gotchas.md
ββ Framework vars (NEXT_PUBLIC_*) β Auto-included via inference
"I need to set up CI"
CI setup?
ββ GitHub Actions β references/ci/github-actions.m
FAQ
Should scripts go in the root package.json?
The skill recommends putting task scripts in each package and keeping the root package.json only to run turbo commands.
What does turbo.json do?
It lists the tasks, their order, their outputs and their dependencies, so Turborepo knows what to run and cache.
Does it cover CI speed?
Yes. The skill mentions CI optimization, remote cache and running only the affected parts of the repository.
Details
Original description by the author
Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.
repo: trycompai/crm
Popularity
- GitHub stars
- 12k
- Ranking position
- #11527
- License
- MIT
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
ai-elements
12kHelps your agent build AI chat interfaces with ready-made components for conversations, messages, tool displays and prompt inputs.
ai-sdk
12kHelps your agent build AI features with the Vercel AI SDK, including text generation, streaming, tool calling and agents.
better-accessibility
12kHelps your agent make interfaces usable with a keyboard and screen readers, covering focus, labels, ARIA and forms.
better-auth-best-practices
12kHelps your agent set up Better Auth for login, sessions, OAuth and plugins in a TypeScript app, following its documented steps.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.