Back to Langfuse

Turborepo

.agents/skills/turborepo/command/turborepo.md

3.178.02.3 KB
Original Source

Load the Turborepo skill and help with monorepo task orchestration: creating workflows, configuring tasks, setting up pipelines, and optimizing builds.

Workflow

Step 1: Load turborepo skill

skill({ name: 'turborepo' })

Step 2: Identify task type from user request

Analyze $ARGUMENTS to determine:

  • Topic: configuration, caching, filtering, environment, CI, or CLI
  • Task type: new setup, debugging, optimization, or implementation

Use decision trees in SKILL.md to select the relevant reference files.

Step 3: Read relevant reference files

Based on task type, read from references/<topic>/:

TaskFiles to Read
Configure turbo.jsonconfiguration/RULE.md + configuration/tasks.md
Debug cache issuescaching/gotchas.md
Set up remote cachecaching/remote-cache.md
Filter packagesfiltering/RULE.md + filtering/patterns.md
Environment problemsenvironment/gotchas.md + environment/modes.md
Set up CIci/RULE.md + ci/github-actions.md or ci/vercel.md
CLI usagecli/commands.md

Step 4: Execute task

Apply Turborepo-specific patterns from references to complete the user's request.

CRITICAL - When creating tasks/scripts/pipelines:

  1. DO NOT create Root Tasks - Always create package tasks
  2. Add scripts to each relevant package's package.json (e.g., apps/web/package.json, packages/ui/package.json)
  3. Register the task in root turbo.json
  4. Root package.json only contains turbo run <task> - never actual task logic

Other things to verify:

  • outputs defined for cacheable tasks
  • dependsOn uses correct syntax (^task vs task)
  • Environment variables in env key
  • .env files in inputs if used
  • Use turbo run (not turbo) in package.json and CI

Step 5: Summarize

=== Turborepo Task Complete ===

Topic: <configuration|caching|filtering|environment|ci|cli>
Files referenced: <reference files consulted>

<brief summary of what was done>
<user-request> $ARGUMENTS </user-request>