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.
npx skills add Mindrally/skills --skill turborepo -a claude-codeWhat 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/andpackages/ - write
turbo.jsonwith 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-code2Manually: put the files in place
~/.claude/skills/turborepo/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/turborepo/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill turborepo -a codex2Manually: put the files in place
.agents/skills/turborepo/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill turborepo -a cursor2Manually: put the files in place
.cursor/skills/turborepo/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills turborepo2Manually: put the files in place
.github/skills/turborepo/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill turborepo -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path turborepoManually: put the files in place
.devin/skills/turborepo/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill turborepo -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.