Skip to content

avibebuilder/claude-prime / .claude/starter-skills/monorepo

monorepo

Verified

MUST use for ANY query mentioning packages, monorepo, workspace, catalog, turbo, turborepo, or pnpm in a multi-package context. MUST use when sharing config (ESLint, tsconfig, prettier) across packages, fixing build order between packages, adding new packages, scoping CI installs/caching to changed packages, or debugging pnpm catalog version resolution. This skill OWNS all cross-package coordination problems — even when they look like build, CI, config, or dependency issues. If two or more packages interact in the query, this skill applies. Takes priority over other skills when the problem spans package boundaries.

FileKindSize
SKILL.mdskill md4.6 KB
references/caching.mdmarkdown4.3 KB
references/pnpm-workspace.mdmarkdown3.4 KB
references/structure.mdmarkdown5.7 KB
references/tailwind-v4.mdmarkdown4.0 KB
references/turborepo.mdmarkdown4.4 KB

references/turborepo.md

View on GitHub
# Turborepo Configuration

## turbo.json Basics

Located at repository root. Supports `.json` or `.jsonc`.

**Minimal Configuration:**
```json
{
  "$schema": "https://turborepo.com/schema.json",
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**"]
    }
  }
}
```

**Full Configuration:**
```json
{
  "$schema": "https://turborepo.com/schema.json",
  "globalDependencies": ["**/.env.*local"],
  "globalEnv": ["CI", "NODE_ENV"],
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**", "!.next/cache/**"],
      "env": ["MY_API_URL"]
    },
    "test": {
      "dependsOn": ["build"],
      "outputs": ["coverage/**"]
    },
    "lint": {
      "dependsOn": []
    },
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}
```

## Task Configuration

### dependsOn

Defines task execution order.

| Type | Syntax | Description |
|------|--------|-------------|
| Topological | `"^build"` | Run in dependencies first |
| Same-package | `"lint"` | Run another task first |
| Arbitrary | `"web#build"` | Run specific package's task |

**Examples:**
```json
{
  "tasks": {
    "build": {
      "dependsOn": ["^build"]        // Build deps first
    },
    "test": {
      "dependsOn": ["build"]         // Build same package first
    },
    "deploy": {
      "dependsOn": ["web#build"]     // Specific package task first
    },
    "lint": {
      "dependsOn": []                // No dependencies
    }
  }
}
```

### outputs

Files/directories to cache. **Required for caching.**

```json
{
  "build": {
    "outputs": [
      "dist/**",
      ".next/**",
      "!.next/cache/**"   // Exclude patterns
    ]
  }
}
```

### inputs

Override default inputs for cache hash calculation.

```json
{
  "build": {
    "inputs": [
      "$TURBO_DEFAULT$",  // Standard inputs
      "!README.md",       // Exclude files
      "!**/*.test.ts"
    ]
  }
}
```

### env

Environment variables affecting task hash.

```json
{
  "build": {
    "env": [
      "MY_API_URL",
      "MY_API_*"          // Wildcards supported
    ]
  }
}
```

### passThroughEnv

Environment variables passed at runtime (not affecting hash).

```json
{
  "dev": {
    "passThroughEnv": ["AWS_SECRET_KEY"]
  }
}
```

### cache

Disable caching for a task.

```json
{
  "dev": {
    "cache": false
  }
}
```

### persistent

Mark long-running tasks (dev servers).

```json
{
  "dev": {
    "persistent": true,
    "cache": false
  }
}
```

## Global Configuration

```json
{
  "globalDependencies": [
    ".env",
    "**/.env.*local",
    "tsconfig.json"
  ],
  "globalEnv": [
    "CI",
    "NODE_ENV",
    "VERCEL_ENV"
  ],
  "globalPassThroughEnv": [
    "AWS_SECRET_KEY"
  ]
}
```

## Package Configurations

Individual packages can extend root config.

**packages/ui/turbo.json:**
```json
{
  "extends": ["//"],
  "tasks": {
    "build": {
      "outputs": ["dist/**", "types/**"]
    }
  }
}
```

## Running Tasks

**Basic:**
```bash
turbo run build
turbo build              # Shorthand
turbo build lint test    # Multiple tasks
```

**Filtering:**
```bash
turbo build --filter=web
turbo build --filter=web...       # With dependents
turbo build --filter=...web       # With dependencies
turbo build --filter="[main]"     # Changed since main
```

**Package-Specific:**
```bash
turbo run web#build
```

**Options:**
```bash
turbo build --dry-run            # Preview without executing
turbo build --summarize          # Generate run summary
turbo build --continue           # Continue on errors
turbo build --concurrency=4      # Limit parallel tasks
turbo build --force              # Bypass cache
```

## Common Patterns

**Next.js App:**
```json
{
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": [".next/**", "!.next/cache/**"],
      "env": ["NEXT_PUBLIC_*"]
    }
  }
}
```

**TypeScript Library:**
```json
{
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", "*.d.ts"]
    },
    "typecheck": {
      "dependsOn": ["^typecheck"]
    }
  }
}
```

**Test with Coverage:**
```json
{
  "tasks": {
    "test": {
      "dependsOn": ["build"],
      "outputs": ["coverage/**"],
      "env": ["CI"]
    }
  }
}
```

## Resources

- [Turborepo Configuration](https://turborepo.com/docs/reference/configuration)
- [Configuring Tasks](https://turborepo.com/docs/crafting-your-repository/configuring-tasks)
- [Running Tasks](https://turborepo.com/docs/crafting-your-repository/running-tasks)
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexUnverifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall