turborepo
Fungsinya
Skill ini memandu AI Anda melalui Turborepo, sistem build untuk proyek yang memuat beberapa aplikasi dan paket dalam satu repositori. Skill ini ditujukan untuk developer yang ingin build lebih cepat dan urutan tugas yang jelas.
Kapan dipakai
- βSaat Anda menyiapkan monorepo dengan beberapa aplikasi atau paket bersama.
- βSaat Anda mengedit turbo.json atau membutuhkan tugas berjalan dalam urutan yang benar.
- βSaat build Anda lambat dan Anda ingin memakai caching atau hanya menjalankan bagian yang berubah.
Link skill
https://github.com/trycompai/crm/blob/release/.agents/skills/turborepo/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βSiapkan Turborepo untuk monorepo saya agar tugas build dan test berjalan secara paralel.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menjelaskan bahwa skrip sebaiknya berada di setiap paket, lalu mendaftarkan tugas di turbo.json agar Turborepo dapat menjalankannya secara paralel dan memakai ulang hasil cache.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Turborepo Skill
Build system for JavaScript/TypeScript monorepos. Turborepo caches task outputs and runs tasks in parallel based on dependency graph.
IMPORTANT: Package Tasks, Not Root Tasks
Prefer package tasks over Root Tasks.
When creating tasks/scripts/pipelines, you MUST default to package tasks:
- Add the script to each relevant package's
package.json - Register the task in root
turbo.json - Root
package.jsononly delegates viaturbo run <task>
DO NOT put task logic in root package.json when it can live in packages. This defeats Turborepo's parallelization.
// DO THIS: Scripts in each package
// apps/web/package.json
{ "scripts": { "build": "next build", "lint": "eslint .", "test": "vitest" } }
// apps/api/package.json
{ "scripts": { "build": "tsc", "lint": "eslint .", "test": "vitest" } }
// packages/ui/package.json
{ "scripts": { "build": "tsc", "lint": "eslint .", "test": "vitest" } }
// turbo.json - register tasks
{
"tasks": {
"build": { "dependsOn": ["^build"], "outputs": ["dist/**"] },
"lint": {},
"test": { "dependsOn": ["build"] }
}
}
// Root package.json - ONLY delegates, no task logic
{
"scripts": {
"build": "turbo run build",
"lint": "turbo run lint",
"test": "turbo run test"
}
}
// DO NOT DO THIS - defeats parallelization
// Root package.json
{
"scripts": {
"build": "cd apps/web && next build && cd ../api && tsc",
"lint": "eslint apps/ packages/",
"test": "vitest"
}
}
Root Tasks (//#taskname) are ONLY for tasks that truly cannot exist in packages, such as Vitest Projects' //#test, repo-wide release scripts, or tooling that does not invoke turbo itself.
Secondary Rule: turbo run vs turbo
Always use turbo run when the command is written into code:
// package.json - ALWAYS "turbo run"
{
"scripts": {
"build": "turbo run build"
}
}
# CI workflows - ALWAYS "turbo run"
- run: turbo run build --affected
The shorthand turbo <tasks> is ONLY for one-off terminal commands typed directly by humans or agents. Never write turbo build into package.json, CI, or scripts.
Quick Decision Trees
"I need to configure a task"
Configure a task?
ββ Define task dependencies β references/configuration/tasks.md
ββ Lint/check-types (parallel + caching) β Use Transit Nodes pattern (see below)
ββ Specify build outputs β references/configuration/tasks.md#outputs
ββ Handle environment variables β references/environment/RULE.md
ββ Set up dev/watch tasks β references/configuration/tasks.md#persistent
ββ Package-specific config β references/configuration/RULE.md#package-configurations
ββ Global settings (cacheDir, daemon) β references/configuration/global-options.md
"My cache isn't working"
Cache problems?
ββ Tasks run but outputs not restored β Missing `outputs` key
ββ Cache misses unexpectedly β references/caching/gotchas.md
ββ Need to debug hash inputs β Use --summarize or --dry
ββ Want to skip cache entirely β Use --force or cache: false
ββ Remote cache not working β references/caching/remote-cache.md
ββ Environment causing misses β references/environment/gotchas.md
"I want to run only changed packages"
Run only what changed?
ββ Changed packages + dependents (RECOMMENDED) β turbo run build --affected
ββ Custom base branch β --affected --affected-base=origin/develop
ββ Manual git comparison β --filter=...[origin/main]
ββ See all filter options β references/filtering/RULE.md
--affected is the primary way to run only changed packages. It automatically compares against the default branch and includes dependents.
"I want to filter packages"
Filter packages?
ββ Only changed packages β --affected (see above)
ββ By package name β --filter=web
ββ By directory β --filter=./apps/*
ββ Package + dependencies β --filter=web...
ββ Package + dependents β --filter=...web
ββ Complex combinations β references/filtering/patterns.md
"Environment variables aren't working"
Environment issues?
ββ Vars not available at runtime β Strict mode filtering (default)
ββ Cache hits with wrong env β Var not in `env` key
ββ .env changes not causing rebuilds β .env not in `inputs`
ββ CI variables missing β references/environment/gotchas.md
ββ Framework vars (NEXT_PUBLIC_*) β Auto-included via inference
"I need to set up CI"
CI setup?
ββ GitHub Actions β references/ci/github-actions.m
Pertanyaan umum
Apakah skrip sebaiknya ditaruh di package.json root?
Skill merekomendasikan menaruh skrip tugas di setiap paket, dan hanya menyimpan perintah turbo di package.json root.
Apa fungsi turbo.json?
Berkas itu mencantumkan tugas, urutannya, keluarannya, dan ketergantungannya, sehingga Turborepo tahu apa yang harus dijalankan dan di-cache.
Apakah skill membahas kecepatan CI?
Ya. Skill menyebut optimasi CI, remote cache, dan hanya menjalankan bagian repositori yang terdampak.
Detail
Deskripsi asli dari pembuat
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.
repo: trycompai/crm
Popularitas
- Bintang GitHub
- 12k
- Peringkat
- #11527
- Lisensi
- MIT
- Diperbarui
- 1/11/2026
Komentar
- β¦
Skill lain dari repositori ini
ai-elements
12kMembantu agent Anda membangun antarmuka chat AI dengan komponen siap pakai untuk percakapan, pesan, tampilan alat, dan input prompt.
ai-sdk
12kMembantu agent Anda membangun fitur AI dengan Vercel AI SDK, termasuk pembuatan teks, streaming, pemanggilan alat, dan agent.
better-accessibility
12kMembantu agent Anda membuat antarmuka dapat digunakan dengan keyboard dan pembaca layar, mencakup fokus, label, ARIA, dan formulir.
better-auth-best-practices
12kMembantu agent Anda menyiapkan Better Auth untuk login, sesi, OAuth, dan plugin di aplikasi TypeScript, dengan mengikuti langkah yang didokumentasikan.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.