MONOREPO

Yes, Alfred works on a monorepo.

Drake files tasks that each name one package, Lucius works on its own copy of the whole monorepo, and Bane runs the tests for just the package that changed.

THREE LAYOUTS, SAME APPROACH

Each run gets its own copy of the whole repo.

Every run opens a fresh copy of the entire monorepo. The task says which package to change, and the test command says which package to test.

Nx + pnpm

Each task names one package to change. Lucius runs the tests for just that package with pnpm --filter @org/api test.

monorepo/
├── apps/
│   ├── api/
│   ├── web/
│   └── docs/
├── packages/
│   ├── ui/
│   ├── auth/
│   └── db/
├── nx.json
├── pnpm-workspace.yaml
└── package.json

Turborepo

Bane runs tests only for the packages that changed, using turbo run test --filter=...HEAD~1.

monorepo/
├── apps/
│   ├── marketing/
│   └── dashboard/
├── packages/
│   ├── design-system/
│   ├── eslint-config/
│   └── tsconfig/
├── turbo.json
└── pnpm-workspace.yaml

Cargo workspaces

Lucius makes its copy of the repo at the workspace root and tests one crate with cargo test -p service-auth.

workspace/
├── crates/
│   ├── service-auth/
│   ├── service-billing/
│   └── shared-types/
├── Cargo.toml
└── Cargo.lock
THE TRADEOFFS

What works well, and what to watch.

A monorepo makes some things easier (one repo to work in) and some things harder (knowing what to test, and lockfiles that change a lot).

Works well

  • Tasks that name one package and a single goal.
  • Bane tests only the package that changed, not everything.
  • Batman plans land in one repo, so there is less to coordinate.
  • Costs stay predictable when each task tests just one package.

Watch out for

  • Lockfiles that change across packages. Let only two or three tasks run at once.
  • Changes that span packages. Mark them agent:large-feature so Batman plans them, not Lucius.
  • Slow tests at the repo root. Tell each task to test only its own package.
  • Edits to a shared design system reach every package. Review those closely.
WHAT A TASK LOOKS LIKE

One task, one package.

monorepo#412 (agent:implement) copy
Target package: packages/auth
Goal: rotate the session cookie name to alfred_session.
Keep backward compatibility for one release.
Test gate:
pnpm --filter @org/auth test
Done when:
PR open, scoped tests green, no other package touched.