# Optimize Turborepo Monorepos

Complex task graphs and cache settings can make monorepos slow or unreliable. This skill provides focused Turborepo configuration, debugging, and CI guidance.

## Install

```bash
npx skillstore add antfu/turborepo
```

## Metadata

- Status: approved
- Slug: antfu-turborepo
- Version: 2.9.19-canary.9
- Author version: 2.9.19-canary.9
- Skillstore revision: r2
- Version status: valid
- Tree hash: c2da452148f826c016952f87bd2abf1db3747d161e154c3fd7201a1b2cdf2df1
- Author: antfu
- GitHub username: antfu
- License: MIT
- Repository: https://github.com/antfu/skills/tree/main/skills/turborepo/
- Ref: 89edfdc710d0846129dcee6a929477b04f08052c
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: network, filesystem, env\_access, external\_commands
- Quality score: 74
- Public page: https://skillstore.pages.dev/skills/antfu-turborepo
- Manifest: https://skillstore.pages.dev/api/skills/antfu-turborepo/manifest

## Capabilities

- Reviews task dependencies, outputs, cache settings, and package scripts.
- Explains filtering with affected packages, dependency ranges, and directory scopes.
- Diagnoses cache misses caused by files, environment variables, and missing outputs.
- Guides remote caching, GitHub Actions, Vercel, and general CI optimization.
- Recommends package structure, dependency ownership, exports, and architectural boundaries.
- Configures development, watch, persistent, interruptible, and transit tasks.

## Use Cases

- Configure a New Monorepo: Define package tasks, dependencies, outputs, and cache inputs for a new Turborepo workspace.
- Diagnose Cache Behavior: Find missing outputs, undeclared environment inputs, and broad dependencies that cause incorrect or inefficient caching.
- Optimize Continuous Integration: Run affected packages, configure remote caching, and reduce unnecessary work across continuous integration jobs.

## Prompt Templates

### Review Basic Configuration

```
Review my turbo.json and package scripts. Identify missing task dependencies, outputs, and cache settings. Explain each recommended change.
```

### Debug Cache Misses

```
Analyze these task logs and configuration. Explain why cache misses occur. Check file inputs, environment variables, outputs, and dependency relationships.
```

### Improve CI Performance

```
Review this CI workflow for a Turborepo repository. Add affected-package execution and remote caching guidance. Preserve required deployment and test dependencies.
```

### Redesign an Advanced Task Graph

```
Redesign this task graph for parallel execution and correct invalidation. Evaluate package configurations, transit tasks, watch mode, environment scope, and architectural boundaries.
```

## Limitations

- Guidance targets Turborepo 2.9.19 canary and may not reflect later behavior.
- It does not inspect remote cache providers or validate account permissions.
- It cannot prove task correctness without repository configuration and package scripts.
- Suggested commands may install packages, authenticate services, or change files. Users should review them before execution.

## Best Practices

- Provide turbo.json, root package.json, and relevant package scripts for accurate advice.
- State the package manager, Turborepo version, CI provider, and expected task outputs.
- Review environment passthrough and remote cache settings before applying generated changes.

## Anti Patterns

- Do not place package task logic in root scripts when package-level scripts can own it.
- Do not include secret values in prompts. Provide variable names only.
- Do not use broad cache inputs or loose environment mode without documenting the tradeoff.

## Security Audit

- Audited at: 2026-07-23T07:30:45.157\+00:00
- Summary: All 356 static findings are false positives caused by Markdown examples, configuration names, placeholder URLs, and explanatory snippets. The documentation contains no executable scripts, secret collection, data exfiltration, or prompt injection. Normal use may run Turborepo commands, edit repository configuration, and connect to remote caching services at the user's direction.

## Stats

- Views: 232
- Downloads: 6
- Favorites: 0
- Popularity score: 0
