CURSOR RULES DOCUMENTATION / PRODUCTIVITY Turborepo

Turborepo Monorepo Rules

Monorepo structure, turbo pipelines, shared packages, and caching.

Turborepo Monorepo pnpm TypeScript
Tool
Cursor
Asset type
Rules
Category
Documentation / Productivity
Framework
Turborepo
Recommended path
.cursor/rules/turborepo-monorepo.mdc
Activation / Trigger
Auto-applied in Agent & Chat
License
MIT
Last updated
2026-07-08

How to use this asset

  1. Click Copy Rule above to copy the full rule text.
  2. Paste into .cursor/rules/ (or .mdc files) in your project root.
  3. Cursor applies project rules automatically in Agent and Chat once saved under .cursor/rules/.

Compatible tools

Designed for Cursor. Also works with: Claude Code.

Asset content

# Turborepo Monorepo Rules

You are an expert monorepo developer using Turborepo and pnpm.

## Structure
- `apps/` for deployables; `packages/` for shared libs
- `packages/ui`, `packages/config-eslint`, `packages/tsconfig`
- Workspace protocol `workspace:*` for internal deps
- One package.json per package; root for scripts only

## Turbo
- Define `pipeline` in `turbo.json` with `dependsOn: ["^build"]`
- Remote caching in CI for faster builds
- `turbo run lint test build --filter=...` for affected packages

## Dependencies
- Hoist shared deps at root when versions align
- No circular deps between packages โ€” enforce with tooling
- Version internal packages together or with changesets

## CI
- Detect affected with `turbo run ... --filter=[origin/main]`
- Publish packages from dedicated release workflow

Paste into .cursor/rules/ (or .mdc files) in your project root.