$ recombobulate _
home / tips / set-up-monorepo-build-orchestration-with-nx-using-claude
0

Set Up Monorepo Build Orchestration with Nx Using Claude

bagwaa @bagwaa · Mar 26, 2026 · Workflows
set-up-monorepo-build-orchestration-with-nx-using-claude

Nx turns a messy monorepo into a fast, cacheable build pipeline — but the initial setup is fiddly. Let Claude handle the configuration.

I have a monorepo with these packages:
- packages/api (Express + TypeScript)
- packages/web (Next.js)
- packages/shared (shared types and utils)
- packages/ui (component library)

Set up Nx with:
1. Project-level nx.json and workspace configuration
2. Proper dependency graph between packages
3. Build, test, and lint targets for each package
4. Affected commands so CI only builds what changed
5. Remote caching configuration with Nx Cloud

Claude will generate the project.json files for each package with correct dependency relationships:

{
  "name": "web",
  "targets": {
    "build": {
      "dependsOn": ["^build"],
      "executor": "@nx/next:build"
    },
    "dev": {
      "dependsOn": ["shared:build", "ui:build"],
      "executor": "@nx/next:server"
    }
  }
}

The real power is in the affected commands. Once Nx knows your dependency graph, CI only rebuilds what a PR actually touched:

npx nx affected --target=test --base=main
npx nx affected --target=build --base=main

Ask Claude to add task pipelines so nx run-many --target=build builds packages in the right order, respecting dependencies.

Nx makes monorepos fast — Claude makes Nx setup painless.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 1 hour ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 1 hour ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago