title: Monorepo Decomposition Plan
tags: [plan, architecture, infrastructure, monorepo]
created: 2026-05-20
updated: 2026-05-27
status: active
related:
Monorepo Decomposition Plan
Objective
Dissolve the monorepo (lemna-dev) into fully independent floating repositories. Zero submodules. Zero super-repos. Each repo is sovereign.
Repos After Decomposition (34 total, 0 submodules)
New repos (3)
| Repo | Contains | Origin |
|---|
lemna-knowledge | knowledge/ (cookbook, inventory, journal, templates) | monorepo root |
lemna-opencode | .opencode/ (skills, commands, tools, opencode.json) + AGENTS.md | monorepo root |
data-scraping | data-scraping/ (plans, sources, paper_collection.json) | monorepo root |
Freed existing repos (31)
| Repo | Current submodule path |
|---|
kitchenware | src/kitchenware |
pantry | src/pantry |
lemna-sdk | pipeline/backend/lemna-sdk |
database | pipeline/backend/database |
secrets | pipeline/backend/secrets |
bucket | pipeline/backend/bucket |
pesto | models/pesto |
pesto-screen | models/pesto-screen |
pomodoro | models/pomodoro |
oracle | models/oracle |
backmap | models/backmap |
carbonara | models/carbonara |
carbonara-binders | models/carbonara-binders |
carbonara-clip | models/carbonara-clip |
novodish | models/novodish |
structures | datasets/structures |
binders | datasets/binders |
endpoint-pesto | pipeline/services/endpoint-pesto |
endpoint-pesto-screen | pipeline/services/endpoint-pesto-screen |
endpoint-carbonara | pipeline/services/endpoint-carbonara |
endpoint-carbonara-binders | pipeline/services/endpoint-carbonara-binders |
endpoint-boltz | pipeline/services/endpoint-boltz |
endpoint-boltzgen | pipeline/services/endpoint-boltzgen |
endpoint-cpmp | pipeline/services/endpoint-cpmp |
endpoint-openmm | pipeline/services/endpoint-openmm |
endpoint-rfdiffusion | pipeline/services/endpoint-rfdiffusion |
workflow-binder-design | pipeline/workflows/binder-design |
workflow-debug | pipeline/workflows/debug |
workspace-backmap | pipeline/workspace/backmap |
workspace-binders-design-pipeline | pipeline/workspace/binders-design-pipeline |
project-pesto | pipeline/projects/pesto |
project-carbonara | pipeline/projects/carbonara |
website | website/website |
molstar-bfactor | website/packages/molstar-bfactor |
dashboard | tools/dashboard |
molstar-viewer | tools/molstar-viewer |
File Disposition
Move to new repos
| File/directory | Destination |
|---|
knowledge/ (entire directory) | lemna-knowledge/ |
.opencode/ (entire directory) | lemna-opencode/ |
AGENTS.md | lemna-opencode/AGENTS.md |
data-scraping/ (entire directory) | data-scraping/ |
Fold into knowledge (historical docs)
| File/directory | Destination |
|---|
pipeline/backend/refactor/MIGRATION-PLAN.md | lemna-knowledge/journal/sessions/done/ |
pipeline/backend/refactor/recover_pssm.sh | lemna-knowledge/journal/sessions/done/ |
pipeline/PLAN-decouple-backend.md | lemna-knowledge/journal/sessions/done/ |
Resolved
| File/directory | Decision |
|---|
pipeline/backend/tests/ | Deleted — SDK integration tests overlap with lemna-sdk’s own tests; endpoint tests are in each endpoint repo |
Move into existing repos
| File | Destination | Note |
|---|
export.json | pantry/ repo config | Pantry owns namespace resolution; update pantry code to self-resolve |
scripts/pty-push-all.sh | pantry/scripts/ | If still used; otherwise delete |
Split and redistribute
File (root justfile) | Destination | Commands |
|---|
sync / format / check / test | kitchenware/justfile | Already has its own; merge root versions in |
marimo util | Repo that uses it (e.g. novodish) | |
tensorboard util | Model repos that use it | |
molstar util | molstar-viewer repo | |
Delete
| File/directory | Reason |
|---|
.hermes/ | Not needed |
pipeline/backend/docker-compose.yml | Super compose being removed |
pipeline/backend/Caddyfile | Part of super compose |
scripts/git-all.sh | Walked submodules; no submodules exist |
scripts/apply-all.sh | Same |
.gitmodules | No monorepo |
.gitignore (root) | Each repo owns its own |
Already independent — just remove the pointer
All 36 .gitmodules entries. Each is already its own repo with its own git history. The monorepo only tracked which commit they sat on.
What You Lose and Replacements
| Capability | Replacement |
|---|
| lazygit across all repos | Per-repo lazygit. Or alias to open lazygit in 2-3 active repos |
git-all cross-repo git commands | Gone. Push per-repo |
apply-all batch endpoint commands | Each endpoint repo runs its own justfile |
| Submodule commit sync | Pin deps in pyproject.toml via git URLs + tags |
Single .gitignore / conventions | Each repo owns its own (mostly already do) |
| Super docker-compose for backend | Each backend service runs its own compose independently |
Dependency Updates
Replace workspace path dependencies in pyproject.toml with git URLs:
# Before
kitchenware = { path = "../../src/kitchenware" }
# After
kitchenware = { git = "https://github.com/lemnabio/kitchenware", tag = "v0.4.1" }
Notable files to update:
- Any endpoint
pyproject.toml referencing kitchenware or SDK via path
Pantry Namespace Resolution (design needed)
Currently export.json maps namespace names to monorepo paths:
{
"pesto": "models/pesto",
"carbonara": "models/carbonara",
...
}
Options for replacement:
- Local config (
~/.config/lemna/namespaces.toml) — maps namespace → repo URL or local path
- Self-declaration — each repo has a
.pantry.toml declaring its namespace; pantry discovers siblings
- Remote resolution — pantry queries GitHub org to find repos by convention
Not a blocker for decomposition. Can be addressed as a pantry-internal refactor after.
Migration Steps (ordered)
- Create
lemna-knowledge, copy knowledge/ + fold in historical docs, push
- Create
lemna-opencode, copy .opencode/ + AGENTS.md, update skill paths that reference monorepo-relative locations, push
- Create
data-scraping, copy data-scraping/, push
Decide destination for pipeline/backend/tests/, move it Resolved: deleted
- Move
export.json into pantry/, update pantry namespace resolution
- Move
pty-push-all.sh into pantry/scripts/ or delete
- Split root
justfile into per-repo justfiles, delete root
- Delete:
.hermes/, super compose files, scripts/, .gitmodules, root .gitignore
- Update all
pyproject.toml path deps to git URLs
- Tag monorepo as
last-monorepo, push, stop using it
Open Questions