Skip to main content
skill CX Codex

turborepo · mindrally — Claude Code skill: monorepo build setup

A skill that tells the agent how to configure Turborepo: workspace layout, turbo.json, caching and task filters. Useful once the monorepo already exists.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill turborepo -a claude-code
Open on GitHub

What turborepo does

This skill encodes Turborepo conventions for JavaScript and TypeScript monorepos. It keeps workspaces split into apps/, packages/ and tooling/, wants a minimal root package.json, and expects consistent naming across workspaces. Internal packages are referenced with the workspace protocol, as in "@repo/ui": "workspace:*".

The turbo.json section is the meat of it. The agent sets dependsOn with the ^ prefix for topological ordering, defines outputs so caching actually hits, and excludes directories like !.next/cache/**. Dev tasks get cache: false and persistent: true. For CI the skill points at remote caching and splits environment variables between globalEnv and env.

One thing to know before installing: the skill assumes Turborepo is already in the project. It configures and optimizes an existing monorepo, it does not scaffold one. Commands such as turbo build --filter=web and turbo watch only make sense against real workspaces.

What it helps with

  • lay out workspaces under apps/ and packages/
  • write turbo.json with task dependencies and outputs
  • turn on remote caching for CI builds
  • build a single app with --filter
  • extract shared TypeScript and ESLint configs into packages

Example prompts for the agent

  • Set up turbo.json for this monorepo: build depends on ^build, dev without cache
  • Split workspaces into apps/ and packages/ and wire @repo/ui through workspace:*
  • Add remote caching and globalEnv for the GitHub Actions build

How to install turborepo

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill turborepo -a claude-code

2Manually: put the files in place

~/.claude/skills/turborepo/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/turborepo/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about turborepo

How do I install the turborepo skill in Claude?

Run npx skills add Mindrally/skills --skill turborepo -a claude-code. The skill lands at ~/.claude/skills/turborepo/SKILL.md.

What does the turborepo skill do?

It gives the agent rules for Turborepo configuration: workspace structure, turbo.json contents, caching strategy and task ordering.

Do I need Turborepo installed already?

Yes. The skill covers configuration and optimization of an existing monorepo rather than creating one from scratch.

Source text

SKILL.md · Apache-2.0
---
name: turborepo
description: Best practices for Turborepo monorepo build system configuration and optimization
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Turborepo Development

You are an expert in Turborepo, the high-performance build system for JavaScript and TypeScript monorepos.

## Project Structure

- Organize workspaces following the standard Turborepo structure:
  - `apps/` - Application workspaces (web apps, APIs, mobile apps)
  - `packages/` - Shared packages (UI components, utilities, configs)
  - `tooling/` - Build tools and configurations (optional)
- Keep the root `package.json` minimal with workspace configuration
- Use consistent naming conventions across all workspaces

## Workspace Configuration

- Define workspaces in the root `package.json`:
  ```json
  {
    "workspaces": ["apps/*", "packages/*"]
  }
  ```
- Each workspace should have its own `package.json` with proper dependencies
- Use internal package references with workspace protocol: `"@repo/ui": "workspace:*"`

## turbo.json Configuration

```json
{
  "$schema": "https://turbo.build/schema.json",
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**", "!.next/cache/**"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    },
    "lint": {},
    "test": {
      "dependsOn": ["build"]
    }
  }
}
```

- Use `^` prefix for topological dependencies (build dependencies first)
- Define proper `outputs` for caching
- Mark development tasks with `cache: false` and `persistent: true`

## Caching Strategy

- Configure remote caching for CI/CD with Vercel or self-hosted solutions
- Define accurate `outputs` arrays to ensure proper cache hits
- Use `inputs` to specify which files affect task caching
- Exclude cache directories from outputs (e.g., `!.next/cache/**`)

## Task Dependencies

- Use `dependsOn` to define task relationships:
  - `"^build"` - Run build in dependencies first
  - `"lint"` - Run lint in the same package
  - `"@repo/ui#build"` - Run build in a specific package
- Define proper task ordering for complex build pipelines

## Shared Configurations

- Create shared config packages:
  - `@repo/typescript-config` - Shared TypeScript configurations
  - `@repo/eslint-config` - Shared ESLint configurations
  - `@repo/tailwind-config` - Shared Tailwind configurations
- Reference configs using `extends` or imports in workspace configs

## Development Workflow

- Use `turbo dev` to run development servers across workspaces
- Filter commands to specific workspaces: `turbo build --filter=web`
- Use `--filter` with patterns: `turbo build --filter=./apps/*`
- Watch mode with `turbo watch` for continuous builds

## CI/CD Integration

- Enable remote caching in CI for faster builds
- Use `--dry-run` to preview what would be executed
- Implement proper environment variable handling with `globalEnv` and `env`
- Set up GitHub Actions or other CI with Turborepo caching

## Best Practices

- Keep task definitions consistent across similar workspaces
- Use workspace-level `turbo.json` for package-specific overrides
- Minimize root-level dependencies; install in workspaces that need them
- Document workspace purposes and relationships in README files
- Use TypeScript project references for faster type checking
- Implement incremental builds for large codebases

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

Everything for DevOps and infrastructure →

turborepo by other authors comes first.

turborepo vercel Configures Turborepo monorepos and troubleshoots task pipelines. Useful when editing turbo.json, setting up caching, or fixing CI builds. CX Codex +1 84,700installs turborepo official Vercel Labs A skill that teaches Claude how Turborepo v2.8 works: task caching, remote cache, parallel runs and the --affected flag for CI. CX Codex GP ChatGPT 7installs turborepo-caching Seth Hobson This skill configures Turborepo for local and remote build caching. Use it when setting up a monorepo, tuning CI/CD, or investigating cache misses. CX Codex 10,600installs turborepo-monorepo giuseppe-trisciuoglio A skill that walks your agent through Turborepo: workspaces, turbo.json tasks, test pipelines and build caching. CX Codex +1 4,100installs Monorepo taste f A prompt that hands the agent a fixed set of monorepo conventions: pnpm workspaces, Turborepo, package boundaries and shared configs. Useful when repo structure keeps drifting. GP ChatGPT ★ 174,597repo stars bazel-build-optimization Seth Hobson This skill helps configure Bazel for monorepos, remote execution, and build caching. Use it when build setup or debugging needs a clear Bazel workflow. CX Codex 10,300installs web-frameworks mrgoonie A skill group for full-stack work: it gives the agent references for Next.js, Turborepo monorepos and RemixIcon so it stops guessing at project structure. CX Codex +1 372installs nx-monorepo giuseppe-trisciuoglio A skill that walks the agent through Nx: workspace setup, generators, affected commands, Module Federation and CI. CX Codex +1 3,700installs

From the same set168

netlify-development A skill that gives your agent Netlify build and deploy rules: serverless and edge functions, Blobs, Image CDN, build config. Useful when it writes functions or edits netlify.toml. CX Codex +1 665installs viewcomfy-api-rules Guides an agent through wiring the ViewComfy API into a Python and FastAPI web app: flatten workflow params, call the endpoint, save the returned files. CX Codex +1 663installs salesforce-development A skill that gives your agent Salesforce coding rules: Apex, triggers, Lightning Web Components, SOQL and metadata. Useful when you build on the platform and want the agent to respect its limits. CX Codex +1 659installs graphql-development A skill that gives the agent GraphQL guidelines: schema design, type-safe clients, React and Next.js integration. Useful when it writes resolvers and queries. CX Codex +1 661installs rollup-bundler This skill gives your agent Rollup.js rules: output formats, external dependencies, tree-shaking and the plugins needed to bundle a library. CX Codex +1 657installs serverless A skill that gives the agent rules for FastAPI services in serverless and microservice setups: AWS Lambda, Azure Functions, API gateways. CX Codex +1 655installs convex Tells the agent how to write Convex code: queries, mutations, actions, indexes and file uploads. Useful once Convex is your backend. CX Codex +1 651installs lerna A skill that gives your coding agent Lerna conventions: package layout, versioning, publishing and running scripts across a monorepo. CX Codex +1 650installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor