Skip to main content
turborepo-monorepo Provides comprehensive Turborepo monorepo management guidance for TypeScript/JavaScript projects. Use when creating Turborepo workspaces, configuring turbo.json tasks, setting up Next.js/NestJS apps, managing test pipelines (Vitest/Jest), configuring CI/CD, implementing remote caching, or optimizing build performance in monorepos
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill turborepo-monorepoThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... Related occupations SOC
Based on SOC occupation classification
More from this repository Posts review findings from a JSON file as inline comments on a GitHub Pull Request, attaching each comment to its file and line. Use when you have a list/JSON of review findings (each with a file path, line number, and a message such as summary/failure_scenario) and want them published on a PR as inline review comments. Triggers include "post these review comments on the PR", "associate comments to files in the PR", "publish review findings to PR
typescript-security-review Provides security review capability for TypeScript/Node.js applications, validates code against XSS, injection, CSRF, JWT/OAuth2 flaws, dependency CVEs, and secrets exposure. Use when performing security audits, before deployment, reviewing authentication/authorization implementations, or ensuring OWASP compliance for Express, NestJS, and Next.js. Triggers on "security review", "check for security issues", "TypeScript security audit".
Initialize Spec-Driven Development context — detects tech stack, conventions, architecture patterns, and bootstraps persistence backends. Triggers on 'sdd-init', 'init sdd', 'setup sdd', 'initialize sdd', 'setup project', 'initialize project context'. Creates/updates docs/specs/architecture.md & ontology.md (Constitution), and populates knowledge-graph.json.
name turborepo-monorepo description Provides comprehensive Turborepo monorepo management guidance for TypeScript/JavaScript projects. Use when creating Turborepo workspaces, configuring turbo.json tasks, setting up Next.js/NestJS apps, managing test pipelines (Vitest/Jest), configuring CI/CD, implementing remote caching, or optimizing build performance in monorepos allowed-tools Read, Write, Edit, Bash, Glob, Grep
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
Create a new workspace:
pnpm create turbo@latest my-workspace
cd my-workspace
Initialize in existing project:
pnpm add -D -w turbo
(minimal config):
Create turbo.json in root
{
"$schema" : "https://turborepo.dev/schema.json" ,
"pipeline" : {
"build" : { "dependsOn" : [ "^build" ] , "outputs" : [ "dist/**" , ".next/**" ] } ,
"lint" : { "outputs" : [ ] } ,
"test" : { "dependsOn" : [ "build" ] , "outputs" : [ "coverage/**" ] }
}
}
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" } }
Validate task graph before CI:
turbo run build --dry-run --filter=...
Task Configuration
Configure tasks in turbo.json:
{ "pipeline" : { "build" : { "dependsOn" : [ "^build" ] , "outputs" : [ "dist/**" ] } , "test" : { "dependsOn" : [ "build" ] , "outputs" : [ "coverage/**" ] } , "lint" : { "outputs" : [ ] } } }
Run tasks:
turbo run build
turbo run lint test build
turbo run build --filter=web
Parallel type checking (use transit nodes to avoid cache issues):
{ "pipeline" : { "transit" : { "dependsOn" : [ "^transit" ] } , "typecheck" : { "dependsOn" : [ "transit" ] } } }
Validate before committing:
turbo run build --dry-run
Framework Integration
Testing Setup
Vitest configuration:
{
"pipeline" : {
"test" : {
"outputs" : [ ] ,
"inputs" : [ "$TURBO_DEFAULT$" , "vitest.config.ts" ]
} ,
"test:watch" : {
"cache" : false ,
"persistent" : true
}
}
}
Run affected tests:
turbo run test --filter=[HEAD^]
See references/testing-config.md for complete testing setup.
Package Configurations
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
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
- 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"
Remote cache setup:
npx turbo login
npx turbo link
See references/ci-cd.md for complete CI/CD setup examples.
Task Properties Reference Property Description Example dependsOnTasks that must complete first ["^build"] - dependencies firstoutputsFiles/folders to cache ["dist/**"]inputsFiles for cache hash ["src/**/*.ts"]envEnvironment variables affecting hash ["DATABASE_URL"]cacheEnable/disable caching true or falsepersistentLong-running task true for dev serversoutputLogsLog 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 Filter Description 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
Use specific outputs - Only cache what's needed
Fine-tune inputs - Exclude files that don't affect output
Transit nodes - Enable parallel type checking
Remote cache - Share cache across team/CI
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
pnpm add next react react-dom -F apps/web
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?"
turbo run build --dry-run --filter=web
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: