Skip to main content
Monorepos and multi-package workspaces need extra care in blueprints because different subdirectories may use different languages, package managers, or dependency sets. Devin supports two approaches:

Native workspaces (recommended)

Create a separate blueprint for each subdirectory. Each workspace gets its own initialize, maintenance, and knowledge sections with the working directory automatically set to the subdirectory.

Subshells

Run commands in subdirectories within a single blueprint using (cd dir && command). Simpler for small monorepos with only a few packages.

Native workspaces

Recommended for most monorepos. Native workspaces give each subdirectory its own blueprint with isolated setup, knowledge, and working directory. This is cleaner and easier to maintain than subshells as the number of packages grows.
With native workspaces, each subdirectory gets a dedicated blueprint. Commands in that blueprint run with the working directory already set to the subdirectory — no cd or subshells needed.

The root blueprint

Every repo using native workspaces is expected to have a root blueprint. The root blueprint runs from the repository root and executes before any workspace-scoped blueprints. Use it for shared setup that applies across the entire repo — installing runtimes, global tools, or running root-level dependency installs.
Workspace blueprints then handle package-specific setup and run after the root blueprint completes.

Creating a workspace

  1. Go to Settings > Environment > Blueprints
  2. Click on the repository
  3. Open the Workspaces tab and click Add blueprint
  4. Enter the subdirectory path (e.g., packages/frontend)
  5. Write the blueprint for that workspace
The workspace path must correspond to a real directory inside the repository. Devin checks the path after the root blueprint’s initialize steps have run, so directories created during root setup (for example, package-manager workspace links or generated code) count. If the path still does not exist, that workspace’s setup is marked failed and the build finishes as Partial: the other repositories and workspaces remain usable, but the missing workspace is skipped. Double-check that the path matches your repo structure exactly (e.g., packages/frontend, not pkg/frontend).

Example

A monorepo with a React frontend and a Python backend. The root blueprint installs shared tools, then each workspace handles its own dependencies:
Each workspace’s knowledge entries are scoped to that subdirectory. When Devin works in packages/frontend, it sees the frontend lint/test/dev commands — not the backend ones.

When to use native workspaces

  • Subdirectories have different languages or package managers
  • Each package needs its own knowledge entries (lint, test, build commands)
  • You want isolated setup — a broken blueprint for one workspace doesn’t block the others
  • The number of packages is growing and a single blueprint is getting unwieldy

Subshells

For simpler monorepos, you can manage everything in a single blueprint by changing into each subdirectory inside the step that needs it:
During a build, every step starts in the blueprint’s working directory (the repo root for a root blueprint), so a cd lasts only until the end of its step. The parentheses (cd ... && ...) create a subshell, which also resets the working directory for the remaining lines of the same step.

Why subshells matter

A bare cd carries over to the following lines of the same run, so use subshells when one step changes directory more than once:
Without the parentheses, the second line would look for packages/backend inside packages/frontend and fail.

When to use subshells

  • The monorepo has a few packages with straightforward setup
  • All packages share the same language and package manager
  • You don’t need per-package knowledge entries

Knowledge entries for monorepos

Whether you use native workspaces or subshells, well-structured knowledge entries help Devin navigate the codebase:
A structure knowledge entry that maps each directory to its language and toolchain helps Devin navigate the repo quickly. With native workspaces, each workspace has its own knowledge entries, so the structure entry is most useful in the root blueprint or for subshell-based setups.

Examples

Turborepo / Nx workspace

For workspaces managed by a monorepo build tool like Turborepo or Nx, install dependencies at the root and let the tool handle per-package orchestration:

Multiple JDK versions

A Java monorepo where different services require different JDK versions:

Org blueprint for shared tools

When multiple monorepo packages share the same tools, install them once in the org-wide blueprint. Go to Settings > Environment > Blueprints and click Edit on the Organization blueprint row in the Configuration section:
Then each repo blueprint only needs project-specific commands:

Best practices

When each subdirectory has its own language, package manager, or build process, native workspaces keep each blueprint focused and independent. Reserve subshells for simple cases with a few packages.
During a build, each step starts in the blueprint’s working directory, so a cd never carries into the next step. Within one step, wrap cd commands in parentheses: (cd dir && command). This prevents one line’s directory change from affecting the lines after it.
Language runtimes and package managers used across multiple repos belong in the org-wide blueprint. This avoids duplication and keeps repo blueprints focused on project-specific setup.
If package A depends on package B being built first, list B’s build step before A’s install step in maintenance. Blueprint steps run sequentially in the order listed.
A knowledge entry named structure that maps directories to their languages and tools helps Devin navigate the codebase. Include which package manager each subdirectory uses and any cross-package dependencies.
Instead of one large knowledge entry, create separate entries for each package (e.g., frontend, backend, ml-pipeline). With native workspaces, each workspace has its own knowledge section built in.
Use pnpm install (not pnpm install --force) and uv sync (not rm -rf .venv && uv sync). Incremental commands are faster during periodic rebuilds.