The zer0 monorepo¶
Every project under
packages/,sites/andapps/— the sources the platform is absorbing (ADR 0006) — howworkspace.ymlandbin/zer0manage them as one repository, how they were imported with their history, and what still runs from the originals.
zer0-CMS carries the zer0 stack's content-management half in one repository: the Django + Wagtail platform that is its centre (ADR 0001, ADR 0004), the VS Code extension that is its editor client, plus the image generator, the books app, nine Jekyll sites and the parodynews and aieo apps — the image generator's panel, the books studio and both apps being absorbed into the platform function by function (PLAN Phase G). The zer0-mistakes theme the sites build with is developed in its own repository, bamr87/zer0-mistakes, together with its Rails studio (ADR 0005), and reaches the sites here only through the Jekyll-theme option (ADR 0006 decision 4, PLAN P2): a site's render: setting in workspace.yml pins the theme's tag and the Jekyll server that builds it in Docker (tools/jekyll_theme.py), with no Gemfile — every site, zer0-pages last (PLAN P-D7). Each of those used to live in its own repository and was imported here with its full history, under its own directory. This page explains how the pieces fit, how one repository manages all of them, how the import was done, and what still runs from the original repositories.
Layout¶
| Path | Was | What it is |
|---|---|---|
src/, media/, … (root) |
bamr87/zer0-CMS |
The VS Code extension (cms-extension). |
content/ |
new (2026-10) | The platform (content): Wagtail pages and revisions, the agent harness and its tool registry, suggestions, the graph, the outbox, GraphQL/REST/MCP, and the ops baseline (probes, request ids, the error envelope, logging, OpenAPI). It imports the Jekyll sites below and exports them back byte for byte (content/README.md). |
web/ |
new (2026-10) | The React frontend (web, ADR 0006): the studio — Write, Create, Review and agent runs over the platform's API, served by the platform at /studio/ — and the packages it is built from (the client generated from schemas/openapi/openapi.json, the design tokens, the workspaces), which the extension's webviews render in PLAN G10 (web/README.md). |
packages/zer0-image-generator/ |
bamr87/zer0-image-generator |
The preview-image engine, published as the zer0-image-generator gem, plus its Rails web panel. |
packages/books/ |
bamr87/books |
The book projects (library/<slug>/) and the bookshelf Python app that validates, compiles and edits them, being absorbed: the platform holds the books now (content/books/, PLAN G9) and library/<slug>/ is the file set it generates. |
sites/drsai/ |
bamr87/drsai |
The children's picture-book site and its Python story engine in drsai/. The CMS's ABC wizard exports into it. |
sites/zer0-pages/ |
bamr87/zer0-pages |
The Obsidian-vault + Jekyll site. Its claude-obsidian submodule is declared in the root .gitmodules. |
sites/zer0-pages-remote/ |
bamr87/zer0-pages-remote |
The minimal remote_theme consumer demo. |
sites/zer0-demo-cookbook/ |
bamr87/zer0-demo-cookbook |
A demo site generated by the theme's installer. |
sites/zer0-demo-garden/ |
bamr87/zer0-demo-garden |
A demo site generated by the theme's installer. |
sites/1987/ |
bamr87/1987 |
The self-growing knowledge base about the year 1987: plain-markdown topic pages by category, grown by Claude Code slash commands. |
sites/2005/ |
year-of-ai/2005 |
The year-2005 knowledge base of the year-of-ai lineage, a remote_theme consumer built by sites.yml like the installer demos. |
sites/irony-works/ |
bamr87/irony-works |
The perpetual encyclopedia of irony: an Obsidian vault (vault/) grown by an AI germination engine (engine/), gated by the Alanis and Epimenides rubrics, and transplanted into a Jekyll collection published with the zer0 theme. |
sites/wargames/ |
bamr87/wargames |
OverTheWire security wargames (Bandit, Natas and more) mirrored as a Jekyll study site with spoiler-free study guides, re-synced from upstream by scripts/docs-aggregator/; a remote_theme consumer. |
apps/parodynews/ |
bamr87/barodybroject |
A Django 5.2 + React app that generates parody news with AI, with a Jekyll sidecar (src/pages) and an Azure Container Apps deploy. |
apps/aieo/ |
bamr87/aieo |
AI Engine Optimization: a FastAPI backend (PostgreSQL, Redis, Celery) and a React + Vite frontend that score website content against what AI engines cite and rewrite it, plus a CLI, WordPress REST snippets and a reusable content-scoring workflow. |
packages/ holds libraries and tools, sites/ holds what gets published as a website, and apps/ holds deployed applications; the plan's eventual layout (clients/, frontends/, PLAN §2) is milestone M2 and has not been applied. Each imported directory keeps its own README.md and tooling, most keep an AGENTS.md (with a CLAUDE.md pointer), and its own commands still run from inside it.
How one repository manages all of them¶
The design has five parts. Each one replaces something that used to be repeated, by hand, in every repository.
workspace.yml ──► bin/zer0 ──► list · info · run <task> · affected · check · vendor · doctor
│ │
│ ├─► root CI: one workflow per project, path-filtered to its tree
│ │ + zer0-workspace.yml, the gate that keeps the manifest honest
│ │
│ └─► vendored: copies one project ships of another's file, checked byte-for-byte
│
└─► site: roots ──► the CMS's own `zer0 doctor` over every zer0 site in the repository
1. One registry — workspace.yml. Every project is an entry: its path, kind and toolchain, a one-line summary, where it came from, what it depends on inside the repository, what it publishes, the root workflow that gates it, the Jekyll root of a zer0 site, and its tasks — setup, check (the fast tier), test (the full suite) and build. A command is written once, here, in the same words a contributor would type in the project's directory.
2. One command — bin/zer0. It reads the registry and is Python with PyYAML alone (it was stdlib Ruby until PLAN P5, and keeps that tool's commands and output), so it runs before any project's own dependencies are installed. Where python3 has no PyYAML and refuses a global pip install (Homebrew, Debian), python3 -m venv .venv && .venv/bin/pip install pyyaml once, and bin/zer0 runs on that .venv by itself (tools/workspace/README.md):
bin/zer0 list # every project: path, kind, what it publishes, what gates it
bin/zer0 info drsai # one project: tasks, dependencies, dependents
bin/zer0 run check # the fast tier of every project, each in its own directory
bin/zer0 run test --affected # the full suite of what this branch changed, plus its dependents
bin/zer0 affected --base origin/main
bin/zer0 check # the workspace contract (below)
bin/zer0 vendor [--write] # vendored copies: status, or re-copy from source
bin/zer0 doctor [--strict] # the CMS's zer0 doctor over every zer0 site
"Affected" follows the dependency graph: a change to packages/zer0-image-generator/ affects the gem and the site that builds on it, and a change to a root workflow affects the projects it gates.
3. One CI, split by project. GitHub only runs workflows in the root .github/workflows/, so each project has a root workflow filtered to its own tree — extension.yml, content.yml, zer0-image-generator.yml, books.yml, drsai.yml, zer0-pages.yml, sites.yml (the sites with no workflow of their own, one matrix leg each, through the Jekyll-theme option), irony-works.yml, parodynews.yml and aieo.yml. A pull request pays only for what it touches. CICD.md says what each one runs. zer0-workspace.yml runs on every pull request: the tool's own tests, then bin/zer0 check, which fails when
- a directory under
packages/,sites/orapps/is not registered; - a project's path or claimed glob matches nothing;
- a project's workflow is missing or no longer filters on its path — or, for a site it builds with the Jekyll-theme option, on what the option reads besides the site (
workspace.yml, the workspace tool, the option and its server); - a project says
ci: nonewithout a reason; - a vendored copy has drifted from its source.
It also writes the affected projects and a report-only zer0 doctor of every site to the job summary.
4. Vendored copies are a checked contract. Some files must exist twice. None does today: the Rails CMS's copies went with it (ADR 0008), and the projects that call tools/unwrap-prose.py reach the root's one copy by a project-relative path. workspace.yml lists each copy under vendored: with its single source and the reason the copy exists. bin/zer0 vendor --write re-copies, and bin/zer0 check fails CI on drift. The import found a real case: the CMS's zer0-tokens.css was still kit 1.0.0 while the image generator had shipped 1.0.1 (--maxw 1180px → 1320px). It is re-vendored here.
5. The CMS manages the repository's own sites. Every project with a site: root is a zer0 site, and bin/zer0 doctor runs the platform's zer0 doctor (content/sites/doctor.py, Python since PLAN G4; it needs PyYAML and jsonschema and says so when they are missing) against each, and the studio's Sites area runs the same doctor as a site's job. Docker Compose now mounts this repository as SITES_DIR by default, so docker compose up --build shows the in-repo sites, two levels down (/sites/sites/drsai), with no setup. SITES_DIR=~/github still points it at a wider fleet. The sites build with the Jekyll-theme option, the theme pinned by tag, so a theme release reaches a site only when its render: setting moves to it, with its recording re-made and the reason said.
Today's doctor baseline¶
bin/zer0 doctor is report-only. On 2026-10-22 (PLAN G4) every site reports no error: their warnings are a missing zer0.json and preview_images: block. The step can become --strict once that holds for a while.
How the import was done¶
Every repository's main was rewritten with git filter-repo --to-subdirectory-filter <path> and merged with --allow-unrelated-histories, one merge commit per repository — on the import branches. The pull requests that carried them (#29, #36) were then squash-merged, so main today holds each imported tree as a single commit, and git log and git blame under an imported path stop there. The rewritten histories are intact in refs/pull/29/head and refs/pull/36/head; cutover milestone C0 (plan/PLAN.md) grafts them back by fast-forward, after which git log -- sites/drsai/_config.yml and git blame work as they did in the original repository, with only the commit hashes changed. Merge an import with a merge commit or a fast-forward, never a squash. Bare issue references in the imported commit messages (#123) were rewritten to bamr87/<repo>#123, so they still point at the original repository's issues and pull requests rather than at unrelated zer0-CMS numbers. Tags were not imported: every repository has its own v1.x.y series and they would collide. The original tags and releases stay on the original repositories.
To import one more repository the same way, then register it:
git clone --single-branch --branch main https://github.com/bamr87/<repo> /tmp/<repo> && cd /tmp/<repo>
git tag -l | xargs -r git tag -d
git filter-repo --to-subdirectory-filter sites/<repo> \
--message-callback "import re; return re.sub(rb'(?<![\w/.-])#(\d+)\b', rb'bamr87/<repo>#\1', message)"
cd - && git fetch /tmp/<repo> main:refs/import/<repo> && git merge --allow-unrelated-histories refs/import/<repo>
# then: add the project to workspace.yml, give it a root workflow, and run bin/zer0 check
What changed so the code runs from its new path¶
- Nothing may assume it is the git root. The first case was the theme's
get_repo_root(scripts/lib/common.sh), which usedgit rev-parse --show-topleveland was changed at import to resolve from the script's own location; the theme has since gone back to its own repository (ADR 0005), and the rule stands for every imported project. docker-compose.ymlbuilds theimagegenprofile from./packages/zer0-image-generatorand mounts this repository asSITES_DIRby default.- drsai builds with the Jekyll-theme option (the theme at the tag
workspace.ymlpins, GitHub Pages' own builder); its ABC bookit-alphabetis the deleted Rails wizard's output (plan/rails-cms-spec.md).tools/import_dodge_and_reena.pystill defaults to a sibling../Dodge-and-Reena-Bookcheckout, which was not imported; pass--source. - The
claude-obsidiansubmodule is declared in the root.gitmodules, because git reads it nowhere else. - The vsix excludes
packages/**,sites/**andapps/**;extension.ymlignores them too. - Names.
apps/parodynews/was imported asbamr87/barodybrojectand de-branded by ADR 0003: its Django project package isconfig, its workflow isparodynews.yml, and only theupstream:field and this page still say where it came from. - Nested workflows. Imported
.github/workflows/directories never run here. The ones the root workflows replace completely were removed (30 files across books, the image generator, drsai, zer0-pages, zer0-pages-remote, 1987, 2005, aieo, irony-works and wargames). The ones not ported yet stay as reference: parodynews's 6, the image generator'srelease.yml, drsai'sci.yml(for its PyPI publish job) andpages.yml, zer0-pages'pages.yml, aieo'srelease.yml,aieo-content-reusable.ymlandaieo-it-journey-pilot.yml(with its inertdependabot.yml), irony-works'publish.yml,alanis-gate.ymlandgerminate.yml, and wargames'jekyll-gh-pages.yml.
What still depends on the original repositories¶
The direction is decided (ADR 0002): this repository is the only place work happens on what it holds, and every original is archived once nothing below is left for it to do. The theme is the exception (ADR 0005): bamr87/zer0-mistakes is developed in its own repository again and is not in this table. The cutover milestones C1–C7 in plan/PLAN.md empty this table in order; do not archive an original while it still has a row. Each one still does something this monorepo does not:
| Original repository | Still does | What it takes to move it here |
|---|---|---|
bamr87/zer0-image-generator |
The release-please → RubyGems release of the gem. | A second package in the root release-please-config.json, with a prefixed tag. |
bamr87/zer0-pages |
The GitHub Pages deploy to bamr87.github.io/zer0-pages/. |
Port pages.yml. A repository has one Pages site, so this one would publish under /zer0-CMS/ unless a custom domain is set. |
bamr87/drsai |
The GitHub Pages deploy and the tag-triggered PyPI publish of the story engine. | Port pages.yml, and the publish job with a prefixed tag (drsai-v*). |
bamr87/barodybroject |
The Playwright E2E, container validation and Trivy jobs, the Azure deploy (deploy.yml, azure.yaml, infra/) and its Jekyll Pages site. |
Port them the way parodynews.yml ports the rest of its CI. The deploy needs the Azure credentials as secrets of this repository. |
bamr87/books |
Nothing — its CI is ported (books.yml). |
Archive once the hub entry moves. |
bamr87/zer0-pages-remote, zer0-demo-cookbook, zer0-demo-garden |
Native GitHub Pages builds from each repository's root. | One Pages site per repository is a GitHub limit, so these need one Actions deploy to sub-paths or a mirror each. |
bamr87/aieo |
The tag-triggered GitHub Release of the frontend build, the reusable content-scoring workflow other repositories can call (bamr87/aieo/.github/workflows/aieo-content-reusable.yml) and its it-journey pilot, and Dependabot (18 open update PRs at import). |
A root release.yml component with an aieo-v* tag; the reusable workflow re-homed as a root workflow_call (callers repointed); a root dependabot.yml for apps/aieo/backend and apps/aieo/frontend, or nothing under the fleet's always-latest policy. |
bamr87/irony-works |
The GitHub Pages deploy to bamr87.github.io/irony-works/, the Germinate loop that opens nursery PRs on the original (scheduled Mondays 14:40 UTC, but idle: GERMINATE_ENABLED is unset there, so only a manual dispatch runs it), and the advisory Alanis Gate on vault PRs. |
Port Germinate as a root workflow with its own *_ENABLED kill switch, defaulting off, so the loop can never run in both repositories; port the Alanis Gate filtered to sites/irony-works/vault/**; give the site a pages task (its build task with the route's config, through the Jekyll-theme option) and a route (C4). |
bamr87/wargames |
The GitHub Pages site at bamr87.github.io/wargames/. |
Nothing but C4: it is routed at /wargames/ here already. |
year-of-ai/2005 |
The native GitHub Pages build at year-of-ai.github.io/2005. | year-of-ai.github.io builds sites/2005 from this repository into /2005/ (C4). (bamr87/1987 no longer exists; sites/1987/ is its only home, and its growth commands run here.) |
bamr87/bamr87 (the hub) |
Registers each repository as its own submodule in _data/projects.yml. |
Point the nine entries at this repository and its sub-paths. |
The decisions this table used to wait on are made in ADR 0002, amended by ADR 0005 for the theme: the sites publish under this repository's one Pages site, one sub-path each; releases carry component-prefixed tags here; and every original is archived except the theme, which stays its own repository. Until an original's row is gone, a change made here still does not reach it by itself — and a change merged there must be re-imported (C1), never re-applied by hand. One direction per repository: doing both is how two copies drift apart.