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:Documentation Index
Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
Use this file to discover all available pages before exploring further.
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.
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.Creating a workspace
- Go to Settings > Environment > Blueprints
- Click on the repository
- Click Add workspace
- Enter the subdirectory path (e.g.,
packages/frontend) - Write the blueprint for that workspace
Example
A monorepo with a React frontend and a Python backend. The root blueprint installs shared tools, then each workspace handles its own dependencies:- Root
- packages/frontend
- packages/backend
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 using subshells. Wrap commands in parentheses to run them in a subdirectory without affecting subsequent steps:(cd ... && ...) create a subshell. When the subshell exits, the working directory resets to the repo root for the next step.
Why subshells matter
Compare these two approaches:- Correct (subshells)
- Incorrect (no subshells)
packages/ subdirectory.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: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:Best practices
Prefer native workspaces for complex monorepos
Prefer native workspaces for complex monorepos
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.
Always use subshells for directory changes
Always use subshells for directory changes
When using the subshell approach, wrap
cd commands in parentheses: (cd dir && command). This prevents one step’s directory change from affecting the next step.Put shared tools in the org blueprint
Put shared tools in the org blueprint
Order maintenance steps by dependency
Order maintenance steps by dependency
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.Add a structure knowledge entry
Add a structure knowledge entry
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.Use per-package knowledge entries
Use per-package knowledge entries
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.Keep maintenance incremental
Keep maintenance incremental
Use
pnpm install (not pnpm install --force) and uv sync (not rm -rf .venv && uv sync). Incremental commands are faster during periodic rebuilds.Related pages
- Declarative environment configuration
- Blueprint reference
- Template library — includes ready-to-use monorepo templates
