Expand description
Projects: work that keeps its tasks next to its code, in one or more repositories. Each repository
has its own .brain/ (its own tasks, numbered from 1) and belongs to a project; several services
of one project are several repositories with the same project name. init registers each in
the central brain’s projects.md, so the kanban app can show every project and filter by one,
or by one of its repositories.
What every repository of a project shares is its card, projects/<name>.md in the central brain:
the application’s horizontal context (what it is, its services and how they connect, conventions
they share). A repository adds its role among them (what it owns, exposes and consumes) in its
.brain/project.md, whose title also says which project it belongs to. How to work on one
repository’s code (build, test, style) is its CLAUDE.md / AGENTS.md’s, which agents already
read, so none of it is repeated here.
Entries outside any project live in the central brain: $KANBRAIN_DIR, else the platform
data folder.
Structs§
- Project
Info - A repository’s view of its project: the shared card, and its own notes.
- Repo
- A registered repository of a project.
- Repo
Card - What a repository’s
.brain/project.mdsays about it, travelling with its code (and its git):
Constants§
- CENTRAL
- What the central brain is called where projects are listed; no project can take the name.
- PROJECT_
FILE - In a repository’s
.brain/: the project it belongs to (the#title) and notes about it. - REGISTRY_
FILE - In the central brain: every registered repository,
- project: path of its .brain.
Functions§
- cards_
dir - The folder of the projects’ shared cards in the central brain.
- central_
dir - The central brain’s folder:
$KANBRAIN_DIR, else the platform data folder. - check_
name - Names are written as
- name: pathlines and typed after--project, where/separates the repository, so they’re one line without:or/, and not the central brain’s name. - check_
repo_ name - Repository names are typed after
--project NAME/and written in links asREPO#ID, which a space,,or#would split, so they’re one word without those or:and/. - ensure_
description - Creates the project’s shared card with a placeholder if it has none yet; returns whether it did.
- find
- The repository
labelnames (shop, orshop/apiwhen the project has several), in any case when that names only one; the error lists the labels there are. - info
- What the repository in
dirknows of its project:Noneoutside a project. Withoutcentral, only what its own card says. - load
- The registered repositories, in the order they were registered. No registry means none yet.
- read_
description - The project’s shared description; empty if it has no card, or only the placeholder
initwrote, so nobody reads the placeholder as a description (an agent pays for it in everycontext). - read_
repo_ card - A
.brain/folder’s card;Noneif it has none (not a project’s repository). - register
- Registers the repository in
diras part ofproject, moving it if it was registered under another project. Two live repositories with the same name in one project are refused, since--projectand the app’s filter tell them apart by name; a registration whose folder is gone gives way. - remove_
description - Deletes the project’s shared card; returns whether there was one. Only its own: one a name slugging alike wrote over it before 0.4.0 is that project’s.
- rename
- Renames project
oldtonewin the registry and its shared card (the file and its title). Its repositories’ own cards are the caller’s: their folders may be elsewhere, or gone. - repo_
name - The name the repository whose
.brain/isdirtakes inproject:wantedif given, refused when another of the project’s repositories has it; else the one its card gives if it stays in that project, else its folder’s. When another repository has that one (two folders namedappin different places), the folder above goes before it (backend-app), then a number: two repositories of a project can’t share a name, as--projectand links (app#3) tell them apart by it. - same_
dir - Whether two paths are the same folder, however they’re written: a registered path may go through a
symlink (
/varis/private/varon macOS) or be typed by hand, and still name the folder opened. - unregister
- Takes the repository whose
.brain/isdirout of the registry, and returns it;Noneif it wasn’t registered. Its folder may be gone: a deleted repository can still be taken out. - write_
description - Writes the project’s shared card. Another project’s card where it goes, one whose name slugs alike from before 0.4.0, moves to its own place first rather than be overwritten; the project’s own card from then goes.
- write_
repo_ card - Writes a
.brain/folder’s card.