turborepo

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.

Install
npx skills add 'https://github.com/vercel/turborepo/tree/main/skills/turborepo'
Download bundle ↓
main · 064d74aScanned 2026-09-15

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗
View on GitHub
← Back to SKILL.md

Boundaries

Experimental feature - See RFC

Full docs: https://turborepo.dev/docs/reference/boundaries

The Boundaries command checks workspace architecture by detecting:

  1. Imports of files outside the package's directory
  2. Imports of packages not declared in package.json dependencies
  3. Circular dependencies between packages in the workspace graph

Usage

turbo boundaries

Run this to check for workspace violations across your monorepo.

Circular package dependencies

Boundaries reports packages that cyclically depend on each other through their package.json dependency declarations. The diagnostic includes the dependency path and repeats the first package at the end to show where the cycle closes:

Circular package dependency detected: @repo/pkg-a -> @repo/pkg-b -> @repo/pkg-c -> @repo/pkg-a

The cycle check applies to the complete workspace package graph, independently of tag rules. Remove one of the dependencies in the reported path to make the package graph acyclic.

Tags

Tags allow you to create rules for which packages can depend on each other.

Adding Tags to a Package

// packages/ui/turbo.json
{
  "tags": ["internal"]
}

Configuring Tag Rules

Rules go in root turbo.json:

// turbo.json
{
  "boundaries": {
    "tags": {
      "public": {
        "dependencies": {
          "deny": ["internal"]
        }
      }
    }
  }
}

This prevents public-tagged packages from importing internal-tagged packages.

Rule Types

Allow-list approach (only allow specific tags):

{
  "boundaries": {
    "tags": {
      "public": {
        "dependencies": {
          "allow": ["public"]
        }
      }
    }
  }
}

Deny-list approach (block specific tags):

{
  "boundaries": {
    "tags": {
      "public": {
        "dependencies": {
          "deny": ["internal"]
        }
      }
    }
  }
}

Restrict dependents (who can import this package):

{
  "boundaries": {
    "tags": {
      "private": {
        "dependents": {
          "deny": ["public"]
        }
      }
    }
  }
}

Using Package Names

Package names work in place of tags:

{
  "boundaries": {
    "tags": {
      "private": {
        "dependents": {
          "deny": ["@repo/my-pkg"]
        }
      }
    }
  }
}

Key Points

  • Rules apply transitively (dependencies of dependencies)
  • Helps enforce architectural boundaries at scale
  • Catches violations before runtime/build errors
Referenced from SKILL.md