Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Configure Turborepo for efficient monorepo builds with local and remote caching. Use when setting up Turborepo, optimizing build pipelines, or implementing distributed caching.
.claude/skills/dicklesworthstone-turborepo-caching/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 67% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 106% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 296% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 97% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 53% | 0% |
Production patterns for Turborepo build optimization.
Workspace Root/
├── apps/
│ ├── web/
│ │ └── package.json
│ └── docs/
│ └── package.json
├── packages/
│ ├── ui/
│ │ └── package.json
│ └── config/
│ └── package.json
├── turbo.json
└── package.json| Concept | Description | | -------------- | -------------------------------- | | dependsOn | Tasks that must complete first | | cache | Whether to cache outputs | | outputs | Files to cache | | inputs | Files that affect cache key | | persistent | Long-running tasks (dev servers) |
json{ "$schema": "https://turbo.build/schema.json", "globalDependencies": [".env", ".env.local"], "globalEnv": ["NODE_ENV", "VERCEL_URL"], "pipeline": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**", "!.next/cache/**"], "env": ["API_URL", "NEXT_PUBLIC_*"] }, "test": { "dependsOn": ["build"], "outputs": ["coverage/**"], "inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts"] }, "lint": { "outputs": [], "cache": true }, "typecheck": { "dependsOn": ["^build"], "outputs": [] }, "dev": { "cache": false, "persistent": true }, "clean": { "cache": false } } }
json// apps/web/turbo.json { "$schema": "https://turbo.build/schema.json", "extends": ["//"], "pipeline": { "build": { "outputs": [".next/**", "!.next/cache/**"], "env": ["NEXT_PUBLIC_API_URL", "NEXT_PUBLIC_ANALYTICS_ID"] }, "test": { "outputs": ["coverage/**"], "inputs": ["src/**", "tests/**", "jest.config.js"] } } }
bash# Login to Vercel npx turbo login # Link to Vercel project npx turbo link # Run with remote cache turbo build --remote-only # CI environment variables TURBO_TOKEN=your-token TURBO_TEAM=your-team
yaml# .github/workflows/ci.yml name: CI on: push: branches: [main] pull_request: env: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} TURBO_TEAM: ${{ vars.TURBO_TEAM }} jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 cache: "npm" - name: Install dependencies run: npm ci - name: Build run: npx turbo build --filter='...[origin/main]' - name: Test run: npx turbo test --filter='...[origin/main]'
typescript// Custom remote cache server (Express) import express from "express"; import { createReadStream, createWriteStream } from "fs"; import { mkdir } from "fs/promises"; import { join } from "path"; const app = express(); const CACHE_DIR = "./cache"; // Get artifact app.get("/v8/artifacts/:hash", async (req, res) => { const { hash } = req.params; const team = req.query.teamId || "default"; const filePath = join(CACHE_DIR, team, hash); try { const stream = createReadStream(filePath); stream.pipe(res); } catch { res.status(404).send("Not found"); } }); // Put artifact app.put("/v8/artifacts/:hash", async (req, res) => { const { hash } = req.params; const team = req.query.teamId || "default"; const dir = join(CACHE_DIR, team); const filePath = join(dir, hash); await mkdir(dir, { recursive: true }); const stream = createWriteStream(filePath); req.pipe(stream); stream.on("finish", () => { res.json({ urls: [`${req.protocol}://${req.get("host")}/v8/artifacts/${hash}`], }); }); }); // Check artifact exists app.head("/v8/artifacts/:hash", async (req, res) => { const { hash } = req.params; const team = req.query.teamId || "default"; const filePath = join(CACHE_DIR, team, hash); try { await fs.access(filePath); res.status(200).end(); } catch { res.status(404).end(); } }); app.listen(3000);
json// turbo.json for self-hosted cache { "remoteCache": { "signature": false } }
bash# Use self-hosted cache turbo build --api="http://localhost:3000" --token="my-token" --team="my-team"
bash# Build specific package turbo build --filter=@myorg/web # Build package and its dependencies turbo build --filter=@myorg/web... # Build package and its dependents turbo build --filter=...@myorg/ui # Build changed packages since main turbo build --filter='...[origin/main]' # Build packages in directory turbo build --filter='./apps/*' # Combine filters turbo build --filter=@myorg/web --filter=@myorg/docs # Exclude package turbo build --filter='!@myorg/docs' # Include dependencies of changed turbo build --filter='...[HEAD^1]...'
json{ "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"], "inputs": ["$TURBO_DEFAULT$", "!**/*.md", "!**/*.test.*"] }, "test": { "dependsOn": ["^build"], "outputs": ["coverage/**"], "inputs": ["src/**", "tests/**", "*.config.*"], "env": ["CI", "NODE_ENV"] }, "test:e2e": { "dependsOn": ["build"], "outputs": [], "cache": false }, "deploy": { "dependsOn": ["build", "test", "lint"], "outputs": [], "cache": false }, "db:generate": { "cache": false }, "db:push": { "cache": false, "dependsOn": ["db:generate"] }, "@myorg/web#build": { "dependsOn": ["^build", "@myorg/db#db:generate"], "outputs": [".next/**"], "env": ["NEXT_PUBLIC_*"] } } }
json{ "name": "my-turborepo", "private": true, "workspaces": ["apps/*", "packages/*"], "scripts": { "build": "turbo build", "dev": "turbo dev", "lint": "turbo lint", "test": "turbo test", "clean": "turbo clean && rm -rf node_modules", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "changeset": "changeset", "version-packages": "changeset version", "release": "turbo build --filter=./packages/* && changeset publish" }, "devDependencies": { "turbo": "^1.10.0", "prettier": "^3.0.0", "@changesets/cli": "^2.26.0" }, "packageManager": "npm@10.0.0" }
bash# Dry run to see what would run turbo build --dry-run # Verbose output with hashes turbo build --verbosity=2 # Show task graph turbo build --graph # Force no cache turbo build --force # Show cache status turbo build --summarize # Debug specific task TURBO_LOG_VERBOSITY=debug turbo build --filter=@myorg/web
"@myorg/ui": "workspace:*"persistent: true| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 10,400 | 10,689 | +3% | 1 | 1 | 0% | 1,946 | 4,594 | +136% | 0 | 0 | — |
case-02 | fail→fail | 12,816 | 12,774 | -0% | 1 | 1 | 0% | 2,289 | 5,171 | +126% | 0 | 0 | — |
case-03 | pass→pass | 6,074 | 7,822 | +29% | 1 | 1 | 0% | 1,159 | 3,985 | +244% | 0 | 0 | — |
case-04 | fail→pass | 16,690 | 14,741 | -12% | 1 | 1 | 0% | 3,291 | 5,504 | +67% | 0 | 0 | — |
case-05 | pass→pass | 7,095 | 6,157 | -13% | 1 | 1 | 0% | 1,447 | 3,803 | +163% | 0 | 0 | — |
case-06 | pass→pass | 3,786 | 3,153 | -17% | 1 | 1 | 0% | 627 | 3,055 | +387% | 0 | 0 | — |
case-07 | fail→pass | 8,957 | 3,617 | -60% | 1 | 1 | 0% | 1,510 | 3,115 | +106% | 0 | 0 | — |
case-08 | fail→fail | 26,300 | 6,063 | -77% | 1 | 1 | 0% | 4,638 | 3,551 | -23% | 0 | 0 | — |
case-09 | fail→pass | 4,589 | 2,028 | -56% | 1 | 1 | 0% | 706 | 2,796 | +296% | 0 | 0 | — |
case-10 | pass→pass | 4,557 | 2,916 | -36% | 1 | 1 | 0% | 798 | 2,970 | +272% | 0 | 0 | — |
case-11 | fail→fail | 8,881 | 6,167 | -31% | 1 | 1 | 0% | 1,487 | 3,580 | +141% | 0 | 0 | — |
case-12 | pass→pass | 6,312 | 4,928 | -22% | 1 | 1 | 0% | 1,123 | 3,425 | +205% | 0 | 0 | — |
case-13 | pass→pass | 6,114 | 4,624 | -24% | 1 | 1 | 0% | 1,145 | 3,347 | +192% | 0 | 0 | — |
case-14 | fail→pass | 11,076 | 6,668 | -40% | 1 | 1 | 0% | 1,973 | 3,885 | +97% | 0 | 0 | — |
case-15 | fail→pass | 10,023 | 3,254 | -68% | 1 | 1 | 0% | 2,021 | 3,094 | +53% | 0 | 0 | — |
case-16 | fail→pass | 12,835 | 5,682 | -56% | 1 | 1 | 0% | 2,496 | 3,517 | +41% | 0 | 0 | — |
case-17 | fail→pass | 13,757 | 14,011 | +2% | 1 | 1 | 0% | 2,422 | 4,940 | +104% | 0 | 0 | — |
case-18 | pass→pass | 8,901 | 6,551 | -26% | 1 | 1 | 0% | 1,623 | 3,767 | +132% | 0 | 0 | — |
case-19 | pass→pass | 10,051 | 6,391 | -36% | 1 | 1 | 0% | 1,702 | 3,562 | +109% | 0 | 0 | — |
case-20 | pass→pass | 14,150 | 7,221 | -49% | 1 | 1 | 0% | 2,005 | 3,692 | +84% | 0 | 0 | — |
case-21 | pass→pass | 11,798 | 13,216 | +12% | 1 | 1 | 0% | 2,314 | 5,067 | +119% | 0 | 0 | — |
case-22 | pass→pass | 6,390 | 6,368 | -0% | 1 | 1 | 0% | 1,213 | 3,639 | +200% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.