Turbo.json configuration template and validation logic for Turborepo tasks. Use when creating or auditing turbo.json files to ensure correct task configuration, caching strategy, and the 7 required MetaSaver standards (schema, globalEnv, globalDependencies, required tasks by repo type, build requirements, persistent task cache, clean task cache).
Provides turbo.json template and validation logic for Turborepo task configuration. Use when creating or auditing turbo.json files to ensure correct task configuration, caching strategy, and the 7 required MetaSaver standards (schema, globalEnv, globalDependencies, required tasks by repo type, build requirements, persistent task cache, clean task cache).
/plugin marketplace add metasaver/metasaver-marketplace/plugin install core-claude-plugin@metasaver-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
templates/turbo.template.jsonProvides turbo.json template and validation logic for Turborepo task configuration.
Manage turbo.json configuration to:
The standard Turbo.json template is located at:
templates/turbo.template.json
Must include Turborepo schema for IDE support:
{
"$schema": "https://turbo.build/schema.json"
}
Must declare environment variables available to all tasks:
{
"globalEnv": ["NODE_ENV", "CI"]
}
Must declare files that invalidate all task caches:
{
"globalDependencies": ["**/.env.*local", ".env"]
}
Consumer Repos (apps like metasaver-com, rugby-crm, resume-builder) require 15 tasks:
build, cleandevlint, lint:fix, lint:tscprettier, prettier:fixtest:unit, test:coverage, test:watchdb:generate, db:migrate, db:seed, db:studioLibrary Repos (producers like multi-mono) require 11 tasks:
build, cleandevlint, lint:fix, lint:tscprettier, prettier:fixtest:unit, test:coverage, test:watchLibrary repos do NOT require db:* tasks.
The build task must have:
{
"build": {
"dependsOn": ["^build"],
"env": ["NODE_ENV"],
"outputs": ["dist/**", "build/**", ".next/**"]
}
}
Development and studio tasks must disable cache:
{
"dev": {
"cache": false,
"persistent": true
},
"db:studio": {
"cache": false,
"persistent": true
}
}
The clean task must not cache:
{
"clean": {
"cache": false
}
}
To validate a turbo.json file:
// Rule 1: Check schema
if (!config.$schema || !config.$schema.includes("turbo.build")) {
errors.push("Rule 1: Missing or incorrect $schema reference");
}
// Rule 2: Check globalEnv
const requiredEnv = ["NODE_ENV", "CI"];
const missingEnv = requiredEnv.filter((e) => !config.globalEnv?.includes(e));
if (missingEnv.length > 0) {
errors.push(`Rule 2: globalEnv missing: ${missingEnv.join(", ")}`);
}
// Rule 3: Check globalDependencies
const requiredDeps = [".env"];
const missingDeps = requiredDeps.filter(
(d) => !config.globalDependencies?.some((dep) => dep.includes(d)),
);
// Rule 4: Check required tasks (Turborepo v2 uses "tasks" not "pipeline")
const baseTasks = [
"build",
"clean",
"dev",
"lint",
"lint:fix",
"lint:tsc",
"prettier",
"prettier:fix",
"test:unit",
"test:coverage",
"test:watch",
];
const dbTasks = ["db:generate", "db:migrate", "db:seed", "db:studio"];
// Library repos: 11 tasks (baseTasks only)
// Consumer repos: 15 tasks (baseTasks + dbTasks)
const requiredTasks = isLibraryRepo ? baseTasks : [...baseTasks, ...dbTasks];
const missingTasks = requiredTasks.filter((t) => !config.tasks?.[t]);
if (missingTasks.length > 0) {
errors.push(`Rule 4: Missing required tasks: ${missingTasks.join(", ")}`);
}
// Rule 5: Check build task requirements
const buildTask = config.tasks?.build;
if (!buildTask?.dependsOn?.includes("^build")) {
errors.push("Rule 5: build must depend on ^build");
}
if (!buildTask?.outputs || buildTask.outputs.length === 0) {
errors.push("Rule 5: build must have outputs defined");
}
// Rule 6: Check persistent tasks
const persistentTasks = isLibraryRepo ? ["dev"] : ["dev", "db:studio"];
persistentTasks.forEach((task) => {
const taskConfig = config.tasks?.[task];
if (taskConfig?.cache !== false) {
errors.push(`Rule 6: ${task} must have cache: false`);
}
if (taskConfig?.persistent !== true) {
errors.push(`Rule 6: ${task} must have persistent: true`);
}
});
// Rule 7: Check clean task
if (config.tasks?.clean?.cache !== false) {
errors.push("Rule 7: clean must have cache: false");
}
| Repo Type | Examples | Required Tasks | db:* Tasks |
|---|---|---|---|
| Consumer | metasaver-com, rugby-crm, resume-builder | 15 | Required |
| Library | multi-mono | 11 | Not required |
Determining repo type:
/skill scope-check to identify repository typetasks property (Turborepo v2), not pipeline (v1 deprecated)This skill integrates with:
scope parameter. If not provided, use /skill scope-check/skill audit-workflow - Bi-directional comparison workflow/skill remediation-options - Conform/Update/Ignore choicespackage-scripts-agent - Ensure npm scripts match turbo tasks