Workspace

Clay is a pnpm Turborepo. The workspace contract lives in pnpm-workspace.yaml and turbo.json at the repository root.

Layout

.
├── apps/
│   ├── backend/   @clay/backend
│   ├── landing/   @clay/landing
│   ├── mobile/    @clay/mobile
│   └── specs/     @clay/specs
├── packages/
│   └── client/    @clay/client
├── docs/          ADRs and vendor documentation snapshots
└── AGENTS.md      agent instructions
apps/specs is the Mintlify app. The repository-level docs/ folder is not a workspace package; it owns ADRs and vendor snapshots only.

Turbo tasks

turbo.json defines eight tasks and pins a per-package override for every backend, client, and deploy task that needs caching inputs. The defaults at the root level wire the workspace together; the per-package overrides (see the trimmed excerpts below) declare the exact inputs that should invalidate each cache entry.
{
  "tasks": {
    "build": {
      "dependsOn": ["^build", "^generate"],
      "inputs": ["$TURBO_DEFAULT$", ".env*"],
      "outputs": [
        "dist/**",
        ".next/**",
        "out/**",
        "!.next/cache/**",
        ".mintlify-export/**"
      ]
    },
    "generate": { "dependsOn": ["^generate"], "cache": true },
    "dev": { "cache": false, "persistent": true },
    "lint": { "dependsOn": ["^build", "^generate"], "outputs": [] },
    "typecheck": { "dependsOn": ["^build", "^generate"], "outputs": [] },
    "format": { "cache": false },
    "clean": { "cache": false },
    "deploy": { "cache": false, "dependsOn": ["^build"], "outputs": [] }
  }
}
Per-package overrides declare the exact inputs that invalidate each task’s cache. When you add a new file that affects a cached task (a new route handler, a new Fern input, a new design asset), extend the matching inputs array so the cache invalidates correctly.

Per-package scripts

@clay/backend

dev, generate, build, deploy, lint, typecheck, format, clean, types:wrangler

@clay/landing

dev, build, cf:deploy, deploy, lint, typecheck, format, format:check, clean

@clay/specs

dev, build, cf:deploy, deploy, validate, lint, broken-links, a11y, format, format:check, clean

@clay/mobile

start, dev, ios, typecheck, format

@clay/client

generate, check, build, typecheck, format, format:check, clean
See Architecture for the high-level layout and Deploy for the publishable surfaces.

Architecture

The backend, landing, mobile, and specs surface boundaries.

Deploy

The Cloudflare deploy commands for each publishable surface.