Review Turborepo
Review the Turborepo setup for alignment with current official best practices - task graph correctness, cache effectiveness, boundaries enforcement, and developer experience on this pnpm monorepo. Your reply must be a plan of suggested changes: concise, actionable, structured - not only prose.
Invocation
Text after the slash command is additional scope/focus (e.g. "caching only", "boundaries") - narrow the review accordingly.
Ground truth (mandatory)
Your pre-trained knowledge of Turborepo may be outdated. Do not draft suggestions from memory alone.
- Resolve "Turborepo" via the Context7 MCP (
resolve-library-id → query-docs): turbo.json schema (tasks, dependsOn, inputs/outputs, caches), boundaries tags syntax, global dependencies/env handling, turbo query.
- For anything Context7 lacks, use Firecrawl search/scrape restricted to the official domain (
turborepo.com docs) - boundaries reference, caching guide, upgrade notes for the pinned major.
- Version currency: catalog
turbo pin in pnpm-workspace.yaml vs latest stable; check the pinned major's deprecations against config keys in use (legacy keys are a common drift).
- A local deep skill exists at
.agents/skills/turborepo/SKILL.md - consult it for repo-specific conventions, but treat official docs as ground truth.
- Cite the retrieved source next to every finding; label anything unverifiable as Unverified.
Scope artifacts
- Root turbo.json - task pipeline,
boundaries.tags
- Per-app/package
turbo.json files ("extends": ["//"], tags entries) under apps/*, packages/*
- Root scripts using turbo filters in package.json; CI
--affected phase in .github/workflows/ci.yml
- Remote-cache provisioning notes under
core/turborepo; lockfile/pnpm integration
Analysis axes
- Task graph:
dependsOn correctness (build ← ^build, test/lint dependency shape); inputs/outputs declared so caches hit; env vars that affect builds captured (env/globalEnv) without over-invalidating.
- Caching: local cache behavior sane; remote cache configured per repo provisioning path; tasks that should not be cached (dev, deploy, promote) marked correctly.
- Boundaries: tag rules in root
turbo.json enforce "nothing imports an app"; each package declares a valid tag (app, contracts, contracts-base, lib, config); pnpm boundaries is inside ci.
- Scoping & CI: filter idioms (
--filter=<pkg>, ...pkg..., --affected) used where intended; GitHub CI --affected limited to the check/test/build phase as documented.
- Version currency: new capabilities worth adopting (e.g. newer query/boundaries features); deprecated keys removed.
DX & AI-agentic workflow
Verify agent-friendliness: scoped turbo iteration documented so agents avoid full-graph runs; turbo query available for graph inspection; cache misses explainable (hash inputs visible).
Steps
- Collect ground truth before reading config.
- Read root + package turbo configs; trace one build and one test hash mentally through the graph.
- Run
pnpm boundaries to confirm green, and sample turbo query output.
- Walk each analysis axis; note findings or explicit one-line "no issues".
- Compose the plan grouped Critical / Improvements / Optional with what, where, why, and source citations.
Output format
- Critical - wrong dependencies causing bad caches/skipped work, boundary violations.
- Improvements - cache-hit improvements, graph simplification.
- Optional - nice-to-haves; prefix pure polish with Nit:.
Read-only review: produce the plan only; implement nothing unless explicitly asked afterwards.
1---2name: review-turborepo3description: Turborepo review (task graph, boundaries tags, caching, remote cache, --affected usage) against current official Turborepo best practices. USE WHEN: user runs /review-turborepo or explicitly asks for this review. DO NOT USE WHEN: reviewing app code, other dev dependencies, or implementing features.4---56# Review Turborepo78Review the Turborepo setup for alignment with current official best practices - task graph correctness, cache effectiveness, boundaries enforcement, and developer experience on this pnpm monorepo. Your reply must be a **plan of suggested changes**: concise, actionable, structured - not only prose.910## Invocation1112Text after the slash command is additional scope/focus (e.g. "caching only", "boundaries") - narrow the review accordingly.1314## Ground truth (mandatory)1516Your pre-trained knowledge of Turborepo may be outdated. **Do not draft suggestions from memory alone.**17181. Resolve "Turborepo" via the **Context7 MCP** (`resolve-library-id` → `query-docs`): `turbo.json` schema (tasks, `dependsOn`, inputs/outputs, caches), boundaries tags syntax, global dependencies/env handling, `turbo query`.192. For anything Context7 lacks, use **Firecrawl search/scrape restricted to the official domain** (`turborepo.com` docs) - boundaries reference, caching guide, upgrade notes for the pinned major.203. Version currency: catalog `turbo` pin in [pnpm-workspace.yaml](../../../pnpm-workspace.yaml) vs latest stable; check the pinned major's deprecations against config keys in use (legacy keys are a common drift).214. A local deep skill exists at `.agents/skills/turborepo/SKILL.md` - consult it for repo-specific conventions, but treat official docs as ground truth.225. Cite the retrieved source next to every finding; label anything unverifiable as **Unverified**.2324## Scope artifacts2526- Root [turbo.json](../../../turbo.json) - task pipeline, `boundaries.tags`27- Per-app/package `turbo.json` files (`"extends": ["//"]`, `tags` entries) under `apps/*`, `packages/*`28- Root scripts using turbo filters in [package.json](../../../package.json); CI `--affected` phase in [.github/workflows/ci.yml](../../../.github/workflows/ci.yml)29- Remote-cache provisioning notes under `core/turborepo`; lockfile/pnpm integration3031## Analysis axes3233- **Task graph**: `dependsOn` correctness (build ← ^build, test/lint dependency shape); `inputs`/`outputs` declared so caches hit; env vars that affect builds captured (`env`/`globalEnv`) without over-invalidating.34- **Caching**: local cache behavior sane; remote cache configured per repo provisioning path; tasks that should not be cached (dev, deploy, promote) marked correctly.35- **Boundaries**: tag rules in root `turbo.json` enforce "nothing imports an app"; each package declares a valid tag (`app`, `contracts`, `contracts-base`, `lib`, `config`); `pnpm boundaries` is inside `ci`.36- **Scoping & CI**: filter idioms (`--filter=<pkg>`, `...pkg...`, `--affected`) used where intended; GitHub CI `--affected` limited to the check/test/build phase as documented.37- **Version currency**: new capabilities worth adopting (e.g. newer query/boundaries features); deprecated keys removed.3839## DX & AI-agentic workflow4041Verify agent-friendliness: scoped turbo iteration documented so agents avoid full-graph runs; `turbo query` available for graph inspection; cache misses explainable (hash inputs visible).4243## Steps44451. Collect ground truth before reading config.462. Read root + package turbo configs; trace one build and one test hash mentally through the graph.473. Run `pnpm boundaries` to confirm green, and sample `turbo query` output.484. Walk each analysis axis; note findings or explicit one-line "no issues".495. Compose the plan grouped Critical / Improvements / Optional with **what**, **where**, **why**, and source citations.5051## Output format52531. **Critical** - wrong dependencies causing bad caches/skipped work, boundary violations.542. **Improvements** - cache-hit improvements, graph simplification.553. **Optional** - nice-to-haves; prefix pure polish with **Nit:**.5657Read-only review: produce the plan only; implement nothing unless explicitly asked afterwards.