Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

turborepoTurborepo Monorepo 构建

Agent Skill

turborepo 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

490

周安装

20

GitHub Stars

11

下载量

157
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:turborepo(Turborepo Monorepo 构建)
来源仓库:https://github.com/acedergren/agentic-tools
仓库路径:skills/turborepo
安装命令:
npx skills add https://github.com/acedergren/agentic-tools --skill turborepo
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/acedergren/agentic-tools --skill turborepo

简介

turborepo 提供 Turborepo 架构决策支持,涵盖包边界划分、缓存策略优化和构建性能分析。

  • 它适用于多包共享代码频繁、部署独立或服务间依赖复杂的 Monorepo 项目。
  • 使用时需评估团队规模、语言栈和构建耗时,判断是否值得引入 Monorepo 管理开销。
  • 安装前请核实项目是否基于 JS/TS 技术栈及 CI 环境中缓存配置。
  • 建议结合 Nx 等替代方案对比,并根据实际协作模式选择合适工具链。

SKILL.md

Turborepo - Monorepo Architecture Expert

Assumption: You know turbo run build. This covers architectural decisions.

Arguments

  • $ARGUMENTS: Monorepo decision, package boundary, or cache issue to analyze

- Example: /turborepo why is turbo cache missing in CI - Example: /turborepo should packages/ui be split from packages/web-core - If empty: ask which Turborepo architecture problem is in scope


Before Adopting Turborepo: Strategic Assessment

SignalRecommendation
1-3 engineersPolyrepo — monorepo overhead not worth it
<20% shared codePolyrepo
>50% shared code + frequent coordinationMonorepo compelling
Mixed languages (Go/Python/JS)Nx or polyrepo — Turborepo is JS/TS focused
All builds <5min totalOverhead not justified yet
Breaking changes require 3+ reposMonorepo wins
Services deploy independentlyPolyrepo

Break-even: Monorepo worth it when 3+ apps share 30%+ code AND frequent coordination is required.


Critical Rule: Package Tasks, Not Root Tasks

The #1 Turborepo mistake: Putting task logic in root package.json.

// WRONG - defeats parallelization
// Root package.json
{ "scripts": { "build": "cd apps/web && next build && cd ../api && tsc" } }

// CORRECT - each package owns its task
// apps/web/package.json
{ "scripts": { "build": "next build" } }

// Root package.json - ONLY delegates
{ "scripts": { "build": "turbo run build" } }

Why: Turborepo can't parallelize sequential shell commands. Package tasks enable task graph parallelization.


Decision: When to Split a Package

Considering splitting code into a package?
│
├─ Used by 1 app only → DON'T split yet
│   └─ Keep in app; wait for second consumer
│      WHY: Premature abstraction, overhead > benefit
│
├─ Used by 2+ apps → MAYBE split
│   ├─ Stable API (rarely changes) → Split
│   ├─ Unstable (changes every sprint) → DON'T split yet
│   └─ Mixed team ownership → DON'T split (use import path)
│      WHY: Shared packages need stable APIs + clear owners
│
├─ Publishing to npm → MUST split
│
└─ CI builds > 10min → Split by stability, not domain
    └─ Stable packages cache; unstable packages always rebuild

Anti-pattern: Creating packages for "clean architecture" with no consumers. Every package adds build, test, and version overhead.


Anti-Patterns

❌ #1: Circular Dependencies

Symptom: turbo run build fails with "Could not resolve dependency graph"

packages/ui → packages/utils
packages/utils → packages/ui  // circular

Fix: Extract shared code to a third package (packages/shared).

For indirect cycles (A → B → C → A), use: npx madge --circular --extensions ts,tsx packages/

❌ #2: Overly Granular Packages

Symptom: Every feature touches 5+ packages; 10+ version bumps per sprint; pnpm workspace:* version hell.

Fix: Group by change frequency, not by domain:

packages/ui/            # All components (changes often)
packages/ui-primitives/ # Headless components (stable)
packages/icons/         # Generated SVGs (rarely changes)

Rule: Package boundary = different change frequency. Packages that always change together should be one package.

❌ #3: Missing Task Dependencies

Symptom: Tests pass locally, fail in CI with "Cannot find module './dist/index.js'"

Cause: Tests run before build completes — race condition.

// WRONG - no dependsOn for test
{ "tasks": { "build": { "outputs": ["dist/**"] }, "test": {} } }

// CORRECT
{
  "tasks": {
    "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] },
    "test": { "dependsOn": ["build"] }
  }
}

^build = build this package's dependencies first. build = build this package first.

❌ #4: Cache Miss Hell

Symptom: Cache never hits; every run rebuilds everything.

Cause: inputs glob too broad — comment changes trigger rebuild.

// WRONG
{ "build": { "inputs": ["src/**"] } }

// CORRECT
{ "build": { "inputs": ["src/**/*.{ts,tsx}", "!src/**/*.test.ts"] } }

Debug:

turbo run build --dry --graph          # Visualize task graph
turbo run build --dry=json | jq '.tasks[] | select(.cache.status == "MISS")'

Decision: Monorepo vs Polyrepo

Starting new project?
│
├─ Single team, single product → Polyrepo (simpler)
│
├─ Shared UI library → Monorepo
│   └─ Develop library + test in consumers simultaneously
│
├─ Microservices in different languages → Polyrepo
│   └─ Turborepo is JS/TS focused
│
└─ Multiple teams, shared code, atomic changes needed → Monorepo

Practical advice: Start polyrepo, migrate to monorepo when the cross-repo coordination pain exceeds the tooling cost.


Package Boundary Patterns

By stability (recommended):

packages/core/      # Changes quarterly (semantic versioning)
packages/features/  # Changes weekly (workspace protocol)
packages/utils/     # Changes monthly

By consumer:

packages/public-api/  # External consumers — strict versioning
packages/internal/    # Internal apps — workspace protocol OK

By team: Only works if teams rarely share code. Otherwise creates silos.


Turborepo vs Alternatives

Prefer TurborepoPrefer NxPrefer Rush
JS/TS monorepoProject graph visualization needed100+ packages
Vercel remote cachingPolyglot (JS + Python + Go)Publishing to npm is primary goal
pnpm/npm workspacesWant opinionated project structurePhantom dependency detection needed

Error Recovery

Cache never hits

  1. turbo run build --dry=json | jq '.tasks[0].hash' — see current hash
  2. Narrow inputs glob to exclude non-code files
  3. Fallback: "cache": false in turbo.json temporarily to debug without cache pressure

Circular dependency error

  1. turbo run build --dry --graph=graph.html — visualize in browser
  2. npx madge --circular --extensions ts,tsx packages/ — for indirect cycles
  3. Extract common code to packages/shared

Tests fail in CI but pass locally

  1. turbo run test --dry --graph — verify build runs before test
  2. Add "dependsOn": ["build"] to test task
  3. turbo run test --force — bypass cache to confirm ordering

Overly granular packages causing version hell

  1. git log --oneline --since="1 month ago" -- packages/ — count version bumps per package
  2. Packages that change together 5+ times → merge them
  3. Fallback: use workspace:* to auto-link versions while planning merge

When to Load Full Reference

READ references/cli-options.md when: encountering 3+ unknown CLI flags, need advanced --filter patterns across 10+ packages, or setting up complex pipeline options.

READ references/remote-cache-setup.md when: setting up remote cache for teams, debugging cache auth errors, or configuring self-hosted cache with custom storage.

Do NOT load references for: basic architecture decisions, single cache miss debugging, or monorepo adoption decisions — all covered above.


Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

40.1%
按下载量换算63

Claude

27.73%
按下载量换算44

Cursor

19.54%
按下载量换算31

Gemini CLI

9.83%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills