A simple, AI-friendly project layout for product monorepos.
One Workspace Convention is a lightweight directory convention for projects that may grow beyond a single app: web, API, docs, mobile, desktop, shared packages, deployment config, and AI assistant guidance.
It is designed to make a repository easier to understand for humans, scripts, and AI coding agents.
repo/
apps/ # runnable applications
services/ # backend services and workers
packages/ # shared libraries and reusable modules
A typical workspace may look like this:
repo/
apps/
web/
docs/
mobile/
services/
api/
worker/
packages/
ui/
config/
sdk/
Many repositories start simple and then slowly become ambiguous.
Where should the API live?
Is web an app or a package?
Should shared code go under libs, shared, common, or packages?
Can an AI assistant safely infer the structure?
This convention gives the workspace a small, predictable shape.
apps/contains things users or operators run directly.services/contains server-side processes.packages/contains reusable code consumed by apps or services.
That is the core idea.
Use apps/ for runnable user-facing or operator-facing applications.
Examples:
apps/web
apps/admin
apps/docs
apps/mobile
apps/desktop
Good fits:
- Next.js apps
- React/Vite SPAs
- Astro or documentation sites
- Expo mobile apps
- Electron desktop apps
Use services/ for backend workloads.
Examples:
services/api
services/billing
services/worker
services/webhook
Good fits:
- HTTP APIs
- background workers
- scheduled jobs
- queue consumers
- backend-for-frontend services
Use packages/ for reusable modules.
Examples:
packages/ui
packages/config
packages/db
packages/sdk
packages/types
Good fits:
- shared UI libraries
- TypeScript packages
- Go libraries
- config packages
- generated clients
- domain schemas
This is not a framework.
It does not require a specific language, package manager, deployment platform, or frontend stack.
It is only a small workspace convention:
apps / services / packages
Everything else should be chosen by the project.
AI coding agents work better when a repository has stable meaning.
This convention helps agents answer simple questions without guessing:
- “Where is the frontend?”
- “Where is the backend?”
- “Where should a shared library go?”
- “Which parts are deployable?”
- “Which parts are imported by other parts?”
For AI-assisted development, predictable structure is not cosmetic. It reduces wrong edits, misplaced files, and fragile assumptions.
A workspace may also include a machine-readable manifest:
one.manifest.json
The manifest records the project map:
{
"version": 1,
"workspace": {
"name": "my-product"
},
"projects": [
{
"name": "web",
"relativeDir": "apps/web",
"type": "app"
},
{
"name": "api",
"relativeDir": "services/api",
"type": "service"
},
{
"name": "ui",
"relativeDir": "packages/ui",
"type": "package"
}
]
}The directory layout is for humans.
The manifest is for tools and agents.
- Put runnable applications in
apps/. - Put backend workloads in
services/. - Put reusable modules in
packages/. - Give every project a clear, short name.
- Avoid creating new top-level folders for product code unless the meaning is truly different.
- Keep generated files separate from source files.
- Document project-specific exceptions in the workspace README.
acme/
apps/
web/
admin/
docs/
services/
api/
jobs/
packages/
ui/
eslint-config/
tsconfig/
database/
one.manifest.json
README.md
In this example:
apps/webis the customer-facing web app.apps/adminis the internal admin console.apps/docsis the documentation site.services/apiis the main backend API.services/jobsruns background tasks.packages/uiis shared bywebandadmin.packages/databasecontains database schema and shared data access helpers.
One CLI uses this convention as its default workspace layout.
When you create or extend a One CLI workspace, new projects are placed according to their role:
frontend -> apps/
backend -> services/
library -> packages/
The convention can also be used without One CLI.
This convention is intentionally small.
The goal is not to standardize every detail of a repository. The goal is to provide a clear default that works well for growing product teams and AI-assisted development.
Small surface area. Stable meaning. Easy to explain.