Command Palette

Search for a command to run...

Назад к скиллам
скилл № 01018

turborepo

Turborepo expert guidance. Use when setting up or optimizing monorepo builds, configuring task caching, remote caching, parallel execution, or the --affected…

БесплатноБез исполняемых скриптов
openaiот openai★ 8 494 звезды на GitHub

Установить turborepo в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Turborepo

You are an expert in Turborepo v2.8 — "the build system for agentic coding" — a high-performance build system for JavaScript/TypeScript monorepos, built by Vercel with a Rust-powered core.

Key Features

  • Task caching: Content-aware hashing — only rebuilds when files actually change
  • Remote caching: Share build caches across machines and CI via Vercel
  • Parallel execution: Uses all CPU cores automatically
  • Incremental builds: --affected flag runs only changed packages + dependents
  • Pruned subsets: Generate minimal monorepo for deploying a single app
  • Dependency graph awareness: Understands package relationships
  • Git worktree cache sharing: Automatically shares local cache across worktrees (2.8+)
  • Devtools: Visual package and task graph explorer via turbo devtools (2.8+)
  • Composable configuration: Extend turbo.json from any package, not just root (2.7+)
  • AI-enabled docs: turbo docs returns markdown responses optimized for AI agents (2.8+)

Setup

npx create-turbo@latest
# or add to existing monorepo:
npm install turbo --save-dev
# upgrade existing Turborepo:
npx @turbo/codemod migrate

turbo.json Task Pipeline

The turbo.json file defines your task dependency graph. Here are comprehensive examples:

Basic pipeline

{
  "$schema": "https://turborepo.dev/schema.json",
  "tasks": {
    "build": {
      "description": "Compile TypeScript and bundle the application",
      "dependsOn": ["^build"],
      "outputs": [".next/**", "dist/**"]
    },
    "test": {
      "description": "Run the test suite",
      "dependsOn": ["build"]
    },
    "lint": {
      "description": "Lint source files"
    },
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}

Advanced pipeline with environment variables and inputs

{
  "$schema": "https://turborepo.dev/schema.json",
  "globalDependencies": [".env"],
  "globalEnv": ["CI", "NODE_ENV"],
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": [".next/**", "dist/**"],
      "env": ["DATABASE_URL", "NEXT_PUBLIC_API_URL"],
      "inputs": ["src/**", "package.json", "tsconfig.json"]
    },
    "test": {
      "dependsOn": ["build"],
      "outputs": ["coverage/**"],
      "env": ["TEST_DATABASE_URL"]
    },
    "test:unit": {
      "dependsOn": [],
      "outputs": ["coverage/**"]
    },
    "lint": {
      "inputs": ["src/**", ".eslintrc.*"]
    },
    "typecheck": {
      "dependsOn": ["^build"],
      "inputs": ["src/**", "tsconfig.json"]
    },
    "db:generate": {
      "cache": false
    },
    "dev": {
      "cache": false,
      "persistent": true
    },
    "clean": {
      "cache": false
    }
  }
}

Key Configuration

  • dependsOn: ["^build"] — Run build in dependencies first (^ = topological)
  • dependsOn: ["build"] — Run build in the same package first (no ^)
  • outputs — Files to cache (build artifacts)
  • inputs — Files that affect the task hash (default: all non-gitignored files)
  • env — Environment variables that affect the task hash
  • cache: false — Skip caching (for dev servers, codegen)
  • persistent: true — Long-running tasks (dev servers)
  • globalDependencies — Files that invalidate all task caches when changed
  • globalEnv — Env vars that invalidate all task caches when changed

Workspace Filtering

Run tasks in specific packages or subsets of your monorepo:

# Single package
turbo build --filter=web

# Package and its dependencies
turbo build --filter=web...

# Package and its dependents (what depends on it)
turbo build --filter=...ui

# Multiple packages
turbo build --filter=web --filter=api

# By directory
turbo build --filter=./apps/*

# Packages that changed since main
turbo build --filter=[main]

# Combine: changed packages and their dependents
turbo build --filter=...[main]

# Exclude a package
turbo build --filter=!docs

# Packages matching a pattern
turbo build --filter=@myorg/*

Filter syntax reference

Pattern Meaning
web Only the web package
web... web and all its dependencies
...web web and all its dependents
...web... web, its dependencies, and its dependents
./apps/* All packages in the apps/ directory
[main] Packages changed since main branch
{./apps/web}[main] web only if it changed since main
!docs Exclude the docs package

CI Matrix Strategies

GitHub Actions — parallel jobs per package

name: CI
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0 # Required for --affected
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: turbo build test lint --affected
        env:
          TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
          TURBO_TEAM: ${{ vars.TURBO_TEAM
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • agents/openai.yaml

FAQ

Что делает скилл turborepo?

Turborepo expert guidance. Use when setting up or optimizing monorepo builds, configuring task caching, remote caching, parallel execution, or the --affected flag for incremental CI.

Как установить скилл turborepo?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл turborepo запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить turborepo с