Skip to content

Architecture ​

This page explains dotbrain's design: Brainspaces, the split between the Brain and execution, skills, and the public/private boundary.

The Big Picture ​

Three parts, three owners:

  • The tool is public and the same for everyone.
  • The dotbrain home is yours and private. It holds every project's Brainspace and is versioned as one Git repository.
  • The code repo stays the code repo. It gains ignored local wiring and generated runtime assets.

Brainspaces ​

A Brainspace is one directory per project that holds everything an agent needs that is not the code itself:

  • .brain/ is the project's knowledge.
  • .beads/ is the execution store: issues, dependencies, and plans.

The code repo reaches its Brainspace through the gitignored .brain and .beads symlinks. Its .claude and .codex workspaces are real directories. Codex and Antigravity share <checkout>/.agents/skills/. Dotbrain reconciles its links once per checkout and gives each link an exact entry in .git/info/exclude. Unwiring removes the managed links and their excludes. It preserves other entries and the .agents directory. Dotbrain also adds individually ignored Claude agent links and marked Codex agent files. Wiring covers the details.

The Brain ​

Each element of a Brain has one purpose:

ElementHoldsChanges when
CONTEXT.mdDomain vocabulary: the names issues, plans, and code useA concept is named or sharpened
adr/Short Architecture Decision Records, one per qualifying decisionAn adopted choice has consequential rationale that needs independent preservation
designs/Design docs, one initiative per fileAn initiative is planned, built, or closed
DOTBRAIN.mdThe shared convention, owned by dotbraindotbrain refresh updates it
project.yamlRuntime, tracker, skill, and subagent selectionYou change what the project uses
docs/Maintained findings, references, and explanationsThe understanding changes; never authoritative
scratch/Run output: trails, plans, briefs, reports, evidence, prototypes; git-ignoredEvery run; delete any time

An ADR earns its cost when a future reader with the code and current docs could still make a consequential mistake without the rationale: repeat a failed approach, violate an external commitment, or remove a deliberate constraint. Code-change difficulty alone is not the test. Routine choices stay in their existing explanation; unresolved options stay explicitly tentative in a design or findings record. maintain-brain provides the selection and writing guidance.

An active design is the living initiative record and can still contain unresolved choices. Once shipped, abandoned, or superseded, it freezes as history. Extract only adopted decisions that meet the ADR criteria and need independent discovery; link existing ADRs instead of duplicating rationale. Lasting vocabulary belongs in CONTEXT.md. Before applying a decision, check its status, scope, and amendments. Code shows current behavior; adopted decisions describe intended constraints. Surface conflicts rather than silently treating either as revoking the other. The workflow describes record ownership.

The chosen engineering workflow owns planning, task selection, delegation, verification, recovery and delivery procedures. Core record operations preserve evidence, authority and lifecycle meaning without prescribing an execution chain. Beads holds durable execution state; temporary procedural checklists may support steps inside a task. A closed task or open PR alone does not establish shipment.

Private files have their own Git history through home sync; Beads has its own backend storage and backup requirements. Public AGENTS.md routes contributors to adopted requirements in RULES.md, maintained through repo-rules. Initialization is explicit and proposals remain distinguishable from adoption. Existing notebooks remain private historical content; no retrospective retrieval, curation or writing ceremony is required. Startup delivers the shared workspace contract and, when selected, a bounded mode discovery pointer.

Fresh Brains have no private AGENTS.md or CLAUDE.md instruction layer. Wiring and refresh preserve legacy files and existing pointers without requiring or recreating them. Migrate useful content to its existing owner before removing legacy files: public RULES.md holds repository requirements, while private vocabulary, decisions, designs, and references stay in the Brain. Personal preferences do not automatically become public requirements.

Execution Lives in the Tracker ​

Durable task state lives in an execution store, by default Beads, a dependency-aware issue tracker. Multi-step work is an epic with blocks dependencies, so "what is ready" is a query:

The design says where to go; the tracker says where you are. The store is machine-local runtime state synced from configuration, so the same project can run embedded on one machine or against a shared server. See Beads backend.

Skills ​

Skills are reusable agent capabilities owned by the tool, not by a project. The plugin ships five workflow-independent core skills; Dotbrain also delivers operator-selected resources, including the skills of your engineering workflow. See workflow selection.

Linking is idempotent: dotbrain creates and prunes only the links it owns. It never deletes a real file or a link it did not create, which lets bundled skills coexist with private ones on the same machine. See Skills.

Session Start ​

A one-time dotbrain bootstrap prepares global skills and subagents. After that, every agent session in a wired repo starts with the dotbrain convention injected by the plugin's hook, so the agent already knows where the Brain is and how to use it. See Session context.

The Public/Private Boundary ​

The decision that shapes everything: the tool is public; your data is private.

  • This repository is the tool: CLI, plugin, skills, templates.
  • Your Brainspaces live in a separate data root the installed tool operates on.
  • The tool never contains project data, and a Brain is never mirrored into a code repo.
  • When something needs to be public, you derive a fresh document for that audience instead of exposing the private source.

That boundary is what lets the same open-source tool serve entirely private work.

Released under the MIT License.