Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
giuseppe-trisciuoglio avatar

Turborepo Monorepo

  • 1.8k installs
  • 311 repo stars
  • Updated June 22, 2026
  • giuseppe-trisciuoglio/developer-kit

Turborepo monorepo setup guide.

About

The turborepo-monorepo skill covers Turborepo management for TypeScript JavaScript monorepos including workspace creation via pnpm create turbo, turbo.json task dependencies and outputs, Next.js NestJS setup, Vitest Jest pipelines, GitHub Actions GitLab CI, Vercel Remote Cache, build tuning, and migration from other monorepo tools. Instructions include minimal configs debugging cache misses and optimizing hit ratios. Developers invoke when initializing monorepos wiring task graphs implementing remote caching or troubleshooting dependency chains across packages in Turborepo workspaces for faster CI and local builds. pnpm create turbo workspace scaffolding. turbo.json tasks outputs dependencies. Next.js NestJS Vitest Jest monorepo setup. Vercel Remote Cache and CI workflows. Debug cache misses and task graphs. Turborepo monorepo setup guide. User asks Turborepo tasks or remote cache.

  • pnpm create turbo workspace scaffolding.
  • turbo.json tasks outputs dependencies.
  • Next.js NestJS Vitest Jest monorepo setup.
  • Vercel Remote Cache and CI workflows.
  • Debug cache misses and task graphs.

Turborepo Monorepo by the numbers

  • 1,786 all-time installs (skills.sh)
  • +86 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #116 of 1,453 DevOps & CI/CD skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

turborepo-monorepo capabilities & compatibility

Capabilities
workspace setup · remote cache
Use cases
ci cd · devops
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill turborepo-monorepo

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.8k
repo stars311
Security audit3 / 3 scanners passed
Last updatedJune 22, 2026
Repositorygiuseppe-trisciuoglio/developer-kit

How configure turbo.json remote cache?

Configure Turborepo workspaces, turbo.json, Next.js/NestJS apps, tests, remote cache, and CI for TS monorepos.

Who is it for?

Teams adopting Turborepo.

Skip if: Single package apps.

When should I use this skill?

User asks Turborepo tasks or remote cache.

What you get

Monorepo with CI optimized builds.

  • GitHub Actions CI workflow YAML
  • Turborepo remote cache configuration

By the numbers

  • CI job timeout-minutes set to 15 in the basic workflow example
  • Uses pnpm version 9 and Node.js 20 in GitHub Actions setup steps

Files

SKILL.mdMarkdownGitHub ↗

Turborepo Monorepo

Overview

Provides guidance for Turborepo monorepo management: workspace creation, turbo.json task configuration, Next.js/NestJS integration, testing pipelines (Vitest/Jest), CI/CD setup, and build performance optimization.

When to Use

  • Create or initialize Turborepo workspaces
  • Configure turbo.json tasks with dependencies and outputs
  • Set up Next.js/NestJS apps in monorepo structure
  • Configure Vitest/Jest test pipelines
  • Build CI/CD workflows (GitHub Actions, GitLab CI)
  • Implement remote caching with Vercel Remote Cache
  • Optimize build times and cache hit ratios
  • Debug task dependency or cache issues
  • Migrate from other monorepo tools to Turborepo

Instructions

Workspace Creation

1. Create a new workspace:

   pnpm create turbo@latest my-workspace
   cd my-workspace

2. Initialize in existing project:

   pnpm add -D -w turbo

3. Create turbo.json in root (minimal config):

   {
     "$schema": "https://turborepo.dev/schema.json",
     "pipeline": {
       "build": { "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**"] },
       "lint": { "outputs": [] },
       "test": { "dependsOn": ["build"], "outputs": ["coverage/**"] }
     }
   }

4. Add scripts to root package.json:

   { "scripts": { "build": "turbo run build", "dev": "turbo run dev", "lint": "turbo run lint", "test": "turbo run test", "clean": "turbo run clean" } }

5. Validate task graph before CI:

   turbo run build --dry-run --filter=...  # Verify task execution order

Task Configuration

1. Configure tasks in turbo.json:

   { "pipeline": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] }, "test": { "dependsOn": ["build"], "outputs": ["coverage/**"] }, "lint": { "outputs": [] } } }

2. Run tasks:

   turbo run build                      # All packages
   turbo run lint test build           # Multiple tasks
   turbo run build --filter=web       # Specific package

3. Parallel type checking (use transit nodes to avoid cache issues):

   { "pipeline": { "transit": { "dependsOn": ["^transit"] }, "typecheck": { "dependsOn": ["transit"] } } }

4. Validate before committing:

   turbo run build --dry-run  # Check task order and affected packages

Framework Integration

Next.js: outputs ".next/**" and env ["NEXT_PUBLIC_*"] - See references/nextjs-config.md

NestJS: outputs "dist/**", dev tasks with cache: false, persistent: true - See references/nestjs-config.md

Testing Setup

1. Vitest configuration:

   {
     "pipeline": {
       "test": {
         "outputs": [],
         "inputs": ["$TURBO_DEFAULT$", "vitest.config.ts"]
       },
       "test:watch": {
         "cache": false,
         "persistent": true
       }
     }
   }

2. Run affected tests:

   turbo run test --filter=[HEAD^]

See references/testing-config.md for complete testing setup.

Package Configurations

1. Create package-specific turbo.json:

   {
     "extends": ["//"],
     "tasks": {
       "build": {
         "outputs": ["$TURBO_EXTENDS$", ".next/**"]
       }
     }
   }

See references/package-configs.md for detailed package configuration patterns.

CI/CD Setup

1. GitHub Actions with validation checkpoints:

   - name: Install dependencies
     run: pnpm install

   - name: Validate affected packages (dry-run)
     run: pnpm turbo run build --filter=[HEAD^] --dry-run
     # VALIDATE: Review output to confirm only expected packages will build

   - name: Run tests
     run: pnpm run test --filter=[HEAD^]

   - name: Build affected packages
     run: pnpm run build --filter=[HEAD^]

   - name: Verify cache hits
     run: pnpm turbo run build --filter=[HEAD^] --dry-run | grep "Cache"
     # VALIDATE: Confirm cache hits for unchanged packages

2. Remote cache setup:

   # Login to Vercel
   npx turbo login

   # Link repository
   npx turbo link

See references/ci-cd.md for complete CI/CD setup examples.

Task Properties Reference

PropertyDescriptionExample
dependsOnTasks that must complete first["^build"] - dependencies first
outputsFiles/folders to cache["dist/**"]
inputsFiles for cache hash["src/**/*.ts"]
envEnvironment variables affecting hash["DATABASE_URL"]
cacheEnable/disable cachingtrue or false
persistentLong-running tasktrue for dev servers
outputLogsLog verbosity"full", "new-only", "errors-only"

Dependency Patterns

  • ^task - Run task in dependencies first (topological order)
  • task - Run task in same package first
  • package#task - Run specific package's task

Filter Syntax

FilterDescription
webOnly web package
web...web + all dependencies
...webweb + all dependents
...web...web + deps + dependents
[HEAD^]Packages changed since last commit
./apps/*All packages in apps/

Best Practices

Performance Optimization

1. Use specific outputs - Only cache what's needed 2. Fine-tune inputs - Exclude files that don't affect output 3. Transit nodes - Enable parallel type checking 4. Remote cache - Share cache across team/CI 5. Package configurations - Customize per-package behavior

Caching Strategy

{
  "pipeline": {
    "build": {
      "outputs": ["dist/**"],
      "inputs": ["$TURBO_DEFAULT$", "!README.md", "!**/*.md"]
    }
  }
}

Task Organization

  • Independent tasks - No dependsOn: lint, format, spellcheck
  • Build tasks - dependsOn: ["^build"]: build, compile
  • Test tasks - dependsOn: ["build"]: test, e2e
  • Dev tasks - cache: false, persistent: true: dev, watch

Common Issues

Tasks not running in order

Problem: Tasks execute in wrong order

Solution: Check dependsOn configuration

{
  "build": {
    "dependsOn": ["^build"]
  }
}

Cache misses on unchanged files

Problem: Cache invalidating unexpectedly

Solution: Review globalDependencies and inputs

{
  "globalDependencies": ["tsconfig.json"],
  "pipeline": {
    "build": {
      "inputs": ["$TURBO_DEFAULT$", "!*.md"]
    }
  }
}

Type errors after cache hit

Problem: TypeScript errors not caught due to cache

Solution: Use transit nodes for type checking

{
  "transit": { "dependsOn": ["^transit"] },
  "typecheck": { "dependsOn": ["transit"] }
}

Examples

Example 1: Create New Workspace

Input: "Create a Turborepo with Next.js and NestJS"

pnpm create turbo@latest my-workspace
cd my-workspace

# Add Next.js app
pnpm add next react react-dom -F apps/web

# Add NestJS API
pnpm add @nestjs/core @nestjs/common -F apps/api

Example 2: Configure Testing Pipeline

Input: "Set up Vitest for all packages"

{
  "pipeline": {
    "test": {
      "dependsOn": ["build"],
      "outputs": ["coverage/**"],
      "inputs": ["$TURBO_DEFAULT$", "vitest.config.ts"]
    },
    "test:watch": {
      "cache": false,
      "persistent": true
    }
  }
}

Example 3: Run Affected Tests in CI

Input: "Only test changed packages in CI"

pnpm run test --filter=[HEAD^]

Example 4: Debug Cache Issues

Input: "Why is my cache missing?"

# Dry run to see what would be executed
turbo run build --dry-run --filter=web

# Show hash inputs
turbo run build --force --filter=web

Constraints and Warnings

  • Node.js 18+ is required for Turborepo
  • Package manager field required in root package.json
  • Outputs must be specified for caching to work
  • Persistent tasks cannot have dependents
  • Windows: WSL or Git Bash recommended
  • Remote cache requires Vercel account or self-hosted solution
  • Large monorepos may need increased concurrency settings

Reference Files

For detailed guidance on specific topics, consult:

TopicReference File
turbo.json templatereferences/turbo.json
Next.js integrationreferences/nextjs-config.md
NestJS integrationreferences/nestjs-config.md
Vitest/Jest/Playwrightreferences/testing-config.md
GitHub/CircleCI/GitLab CIreferences/ci-cd.md
Package configurationsreferences/package-configs.md

Related skills

Forks & variants (1)

Turborepo Monorepo has 1 known copy in the catalog totaling 22 installs. They canonicalize to this original listing.

How it compares

Pick turborepo-monorepo for Turborepo-specific GitHub Actions; pick generic pnpm CI skills when the repo is not using turbo.json task orchestration.

FAQ

Create workspace?

pnpm create turbo@latest then root turbo.json.

Test runners?

Vitest and Jest pipelines in monorepo.

Remote cache?

Vercel Remote Cache for CI and local.

Is Turborepo Monorepo safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

DevOps & CI/CDdevopsintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.