Monorepos
On this page
This guide covers Flow setup inside a monorepo. In this guide, you will learn:
- Why Flow configures the harness inside your app
- The Flow commands for npm, pnpm, Yarn and Bun
- What to do when the monorepo has more than one AdonisJS app
The examples use an app in apps/backend. Flow does not decide where your app lives, so use your app's folder in its place.
Why Flow lives in the app
Section titled "Why Flow lives in the app"Flow configures the harness inside each AdonisJS app of a monorepo, not at the workspace root, because its guidance is specific to one AdonisJS project and the stack you chose for it.
When you start your coding agent at the workspace root, it does not load any of the Flow skills or docs. That is fine, because your agent needs them only when it works inside the AdonisJS codebase.
This setup relies on one thing: a pointer to your AdonisJS app in the CLAUDE.md or AGENTS.md at the workspace root.
<!-- FLOW-APPS-START -->
Use the right CLAUDE.md for the area you're working in:
- **AdonisJS backend app** (`apps/backend/**`) → `apps/backend/CLAUDE.md`
<!-- FLOW-APPS-END -->Flow writes the pointer when you run flow install with the --workspace flag. It leaves the rest of the file as you wrote it. Commit the file.
Commands
Section titled "Commands"Run the commands on this page from the workspace root. Your package manager runs each one inside your app. Bun cannot do this for a package's commands, so with Bun you move into your app's folder first.
Installing the package
Section titled "Installing the package"Install @adonisplus/flow as a dev dependency of your app. Your monorepo must point at the Plus registry first, as Installation and setup shows.
npm i -D @adonisplus/flow -w apps/backendpnpm --filter ./apps/backend add -D @adonisplus/flowyarn workspace backend add -D @adonisplus/flowcd apps/backend
bun add -d @adonisplus/flowWith Yarn, backend is the name in your app's package.json, not its folder.
flow install
Section titled "flow install"Configures the harness inside your app. It asks the same questions as in a project with one app.
npm exec -w apps/backend -- flow install --workspacepnpm --filter ./apps/backend exec flow install --workspaceyarn workspace backend flow install --workspacecd apps/backend
bunx flow install --workspaceThe --workspace flag also writes the pointer at the workspace root. You need it only the first time, because you commit the pointer. After an upgrade or a new clone, run flow install without it.
Flow finds the workspace root from a pnpm-workspace.yaml, or from the workspaces field of a package.json. If your monorepo has neither, pass the root as a path from your app's folder, for example --workspace=../...
flow review
Section titled "flow review"Reviews your branch against the default branch. The code review is a skill you start yourself, and it does not load at the workspace root. This command starts your coding agent inside your app, with the skill.
npm exec -w apps/backend -- flow reviewpnpm --filter ./apps/backend exec flow reviewyarn workspace backend flow reviewcd apps/backend
bunx flow reviewflow apply
Section titled "flow apply"Applies a feature pack to your app. It starts your coding agent inside your app, the same way as flow review.
npm exec -w apps/backend -- flow apply --pack=two-factorpnpm --filter ./apps/backend exec flow apply --pack=two-factoryarn workspace backend flow apply --pack=two-factorcd apps/backend
bunx flow apply --pack=two-factorflow uninstall
Section titled "flow uninstall"Removes Flow from your app. With the --workspace flag, it also removes the pointer from the workspace root.
npm exec -w apps/backend -- flow uninstall --workspacepnpm --filter ./apps/backend exec flow uninstall --workspaceyarn workspace backend flow uninstall --workspacecd apps/backend
bunx flow uninstall --workspaceMultiple apps
Section titled "Multiple apps"A monorepo can hold more than one AdonisJS app, for example an API and an admin panel. Install the package and run flow install --workspace once for each app.
Each app gets its own harness: the docs for its packages, the skills for its stack, and its own flow.lock. The apps share nothing, so they can use different stacks and different versions of a package.
At the workspace root, each install adds its own pointer and keeps the pointers of the other apps.
<!-- FLOW-APPS-START -->
Use the right CLAUDE.md for the area you're working in:
- **AdonisJS admin app** (`apps/admin/**`) → `apps/admin/CLAUDE.md`
- **AdonisJS backend app** (`apps/backend/**`) → `apps/backend/CLAUDE.md`
<!-- FLOW-APPS-END -->Every command works on one app, the one you name in the command. flow uninstall --workspace in one app removes only that app's pointer.