Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture overview

Goals & principles

  • YAML/markdown files only — no database; human-readable and version-controllable.
  • The CLI is the single writer — it edits the local data folder directly (store + dispatch + git). There is no server in the write path, no login, no accounts.
  • The view is a read-only, localhost monitor — kanbanr serve serves the read API + live SSE + the SPA over the same folder. No auth (expose beyond localhost only behind a reverse proxy). The viewer is pluggable: the React monitor, and a VS Code extension that frames it and drives the CLI.
  • Git is the sharing/centralization boundary — the data folder is a git repo; every write is a commit by the configured identity (kanbanr identity); optional remotes are pulled + pushed after each commit. Merge conflicts are left for normal git resolution — kanbanr never auto-resolves.
  • One runtime, no Docker required — a single kanbanr binary is both the writer and (via kanbanr serve) the view daemon. Docker is just one optional packaging.
  • On-disk layout mirrors the board — feature items live in a folder named after their status.
  • Multi-project — one data dir with a folder per project.

Components

flowchart LR
  subgraph dev["Developer in VS Code"]
    Claude["Claude + kanbanr skill"]
  end
  CLI["kanbanr (CLI)<br/>local writer + 'serve'"]
  Core["kanbanr-core<br/>store · dispatch · git · activity · export"]
  FS[("the board — its own git repo<br/>YAML + markdown")]
  Daemon["kanbanr serve<br/>view daemon (read API + SSE + SPA)"]
  Browser["React monitor (view-only)"]

  Claude -->|"runs commands"| CLI
  CLI --> Core
  Core <-->|"read/write (the writer)"| FS
  CLI -->|"commit + pull/push"| Remote[("git remote<br/>(sharing)")]
  Daemon --> Core
  FS -. "file change events" .-> Daemon
  Daemon -->|"JSON + SSE /api/*"| Browser
  Daemon -->|"serves built SPA"| Browser

kanbanr-core is the engine (models, store, validation, git, the activity changelog, and a dispatch router that maps (method, path, body) onto store calls — the single source of truth for data operations). The CLI links it to write the folder directly; the view daemon (kanbanr-server, a library run by kanbanr serve) links it to read. Both go through dispatch, so they agree by construction. It’s all one binary.

Core decides, the front ends act (FEAT-176). Every rule about the board lives in kanbanr-core’s public API, as functions over plain inputs, so the CLI and the daemon call the same code:

ConcernIn core
The write recipe (lock, dispatch, activity, events, commit, push)write::apply
Code-repository gitcoderepo
Commit and branch policyscm::{commit_verdict, message_verdict, branch_verdict, validate_trailers} over RepoFacts
Moving through the workflowflow::{plan_start, plan_finish}, ProjectConfig::{first_active_status, path_between, finish_target}
Test evidenceevidence::{parse_results, plan_capture, plan_stale_tests, plan_sources}
The process librarylibrary::{resolve, list, behind}, Store::process_drift, WorkflowFile::{to_request, to_yaml}
Issue-tracker mirrormirror::{enable, status, sync, link, pull} over an IssueTracker trait
checkreadiness::{check_board, check_definition_text}
Mermaid diagrams (FEAT-200)diagrams::{guard, item_findings, ItemDiagrams}, over the standalone mermaid-lint crate
Errors as HTTP statusesCoreError::status()

The front ends keep argument parsing and output, process concerns (install, self-update, the skill, the editor extension, Claude Code hooks), the gh adapter, the commit guard’s shell-line parsing, and collecting facts from outside the board — the code repository’s state, a test run’s output, git grep — which they hand to core to decide on. A test, architecture::front_ends_are_thin, fails naming the file and the rule when a front end parses board YAML, depends on git2, serde-saphyr or ears-classifier, builds a domain value by hand, or calls dispatch outside its one entry point. Every board file is read and written through kanbanr_core::yaml, which sets the YAML library’s options in one place (FEAT-187).

Two pieces have no kanbanr in them and live in standalone crates beside the engine: ears-classifier (EARS patterns and the ISO 25010 vocabulary) and mermaid-lint (FEAT-200), a dependency-free line scanner that finds the Mermaid mistakes Pele rejects — it flags only what Pele’s parse rejects, held there by a fixture checked from both sides. Core adds what is kanbanr’s: board file names, the project’s strict setting, an item’s spec and affects_docs.

The daemon’s public read routes are a versioned contract, v1 (FEAT-177). Their response types live in kanbanr-core and derive a JSON Schema behind the crate’s schema feature, which the shipped binary does not enable; kanbanr_core::openapi lists the public routes and builds an OpenAPI 3.1 document from those schemas. The document is generated into docs/src/reference/openapi.json, committed, and served as those bytes at /api/openapi.json. A contract test runs a daemon on a fixture board and validates every public route against it, and fails when the committed document and the code disagree; the monitor’s TypeScript types are checked against the same document. Every other read route is internal. See HTTP API.

Positions and views

A position names what a repository holds: a commit plus a hash of the uncommitted changes (position.rs; the text and the hash are chain decisions CD-2 of katalogr FEAT-043, and kanbanr and katalogr compute them byte for byte against one shared file, fixtures/contract/position-v1.json). It is read with git plumbing and raw blob ids, never git status: the tree, the untracked and the staged-new paths are listed by git, and the raw bytes are hashed in-process. A view (views.rs) is a function of its position, the board and the project’s facts alone, so two exact answers to one question are byte-identical; only an exact answer carries an ID (v1- and 32 hex digits, CD-3), whose facts part is the SHA-256 of the board’s HEAD commit and the project’s facts revision. The binary’s version takes no part. --at answers a clean commit from the repository’s objects with nothing checked out, and a dirty position only while the checkout is still at it; any other position is exit 6 (HTTP 409). If a file changes while a view is read, the position is read once more, and failing that the answer is not exact, has no ID, and says so in a warning.

Two facts shape what a position can see. A submodule’s own state does not move the position (its gitlink is skipped, as katalogr’s code skips it; committing a new submodule pointer does move it). Each working file is compared in its repository form, after git’s to-git conversion (core.autocrlf, core.eol, the text, eol, crlf and ident attributes), so a checkout whose line endings git converts reads clean, as katalogr reads it. Driver filters such as LFS are never run, and working-tree-encoding is not applied. Measured in a release build: one read of a clean checkout of 10,000 tracked files takes 110.7 ms (median of three, machine load about 7; SPK-001 measured 141.8 ms on a busier machine), against a budget of 200 ms; a view ID takes about 6 µs against a budget of 100 µs. A debug build is slower (224 ms) and its test prints the figure and asserts nothing.

Runtime: one writer, a read-only view, git

sequenceDiagram
  participant C as Claude (skill)
  participant K as kanbanr (CLI, writer)
  participant R as board repo (sibling)
  participant D as kanbanr serve (view)
  participant B as Browser (monitor)

  B->>D: GET /api/projects/:p   (no auth)
  B->>D: open SSE /api/projects/:p/events
  C->>K: edit (add feature / move / task …)
  K->>R: dispatch → write YAML/md, append today's activity file, git commit
  K->>R: pull + push remotes — best-effort, conflicts left for normal git
  R-->>D: file change event (notify)
  D-->>B: SSE changed event → refetch live
  • No accounts, no JWT. The writer is you on your machine; the view is a localhost read-only window onto your files. Access control for sharing is the git remote’s job (e.g. GitHub decides who can pull/push the data repo).
  • Identity for commits comes from the data repo’s git config (kanbanr identity --name --email), else the user’s own git identity, the same in every write — the first commit included. With neither, kanbanr refuses the write rather than commit as a placeholder.
  • Git uses git2/libgit2, statically linked — no external git binary. Sync is best-effort and never blocks a write; a conflict aborts the merge cleanly and is resolved with normal git in the folder.
  • Exposure. kanbanr serve binds 127.0.0.1 by default and has no TLS/auth by design. To reach it from another machine, leave the bind alone and put it behind a reverse proxy that terminates TLS and adds auth (Caddy/nginx examples in the monitor chapter).

Agent scopes on the write path

Every board write, from the CLI and the writes-enabled daemon alike, goes through write::apply, which first resolves the agent scope of the folder the process runs in (FEAT-214): the main checkout and a board with no scopes are unscoped and behave as before; an agent’s worktree with a valid scope bound to it is scoped; an agent’s worktree without one is refused. Under the write lock and before dispatch, a scoped write must be one of the scope’s operations, on its item, on a board with no changes made outside kanbanr; a task change holds the item’s auto-advance. After dispatch it is recorded as the person, by the agent: on the activity entry, the events and the board commit’s Agent-Scope: trailer, and the board is not pushed.

The same scope is checked where writes do not go through write::apply: the CLI’s command gate classifies every command (an exhaustive match) and refuses, in an agent’s worktree, those that change kanbanr itself or write outside the board’s write path; the commit-msg and pre-commit hooks and the Claude Code guard hold commits to the scope’s branch and item; the pre-push hook, the guard and the board sync refuse every push. A board that holds scopes is always governed, wherever it is; only a board in the system temporary directory that holds none is exempt, so the test suite runs in an agent’s worktree as anywhere else, and pointing TMPDIR at the real board does not lift its scopes.

The rules: one engine for what is missing

Whether an item may move, what kanbanr check reports, what doctor warns about, what check --file holds a pull request to, what query --gap finds and what the monitor’s chips say are all one question: what does this item lack against a list of conditions? readiness.rs answers it, once, for every surface — they used to carry five copies of the rule, and the copies had drifted apart.

  • Checks are a closed vocabulary kanbanr can evaluate from the board alone: definition, statement, goals, zachman (optionally named dimensions), requirements, ears, tests_named, tests_green, approved, estimated, in_sprint, in_release, and named sign-offs. No process semantics are hard-coded and no user code runs (ADR-0010).
  • Gates (config.yaml → gates) say which checks a stage asks of an item entering it, whether a gap blocks or only warns, which sign-offs it needs, whether it makes the branch, and whether reaching it counts as done for the sprint. A board with no gates gets the old rule synthesised — approval to start, the readiness list to finish — so it behaves exactly as before, and is stamped schema 3 only once it declares any, so an older binary refuses it instead of ignoring its gates.
  • Agreement is pinned to content. An approval or a sign-off records the definition’s revision; changing or removing approved text lapses it, and adding to the definition keeps it until the next decision. A move made past a gate with --override records why, and ratify agrees to it afterwards.
flowchart LR
  G["gates (config.yaml)"] --> E["readiness engine"]
  F["item: definition, tests, sign-offs, sprint, release"] --> E
  E --> M["move / start / finish"]
  E --> CK["check · doctor · check --file · query --gap"]
  E --> UI["monitor chips · review queue"]

Cadence: sprints, releases and the burndown

Sprints and releases are off unless a project switches them on (config cadence). Sprints live in sprints.yaml and releases in releases.yaml, beside the project; an item records the sprint and release it is planned into. Nothing about progress is stored: the burndown is derived from the moves items recorded — each day’s remaining is the sprint’s scope less what had reached a stage counting as done (an end status, or one whose gate says done, like Scrum’s Done) — and velocity from the sprints that closed. release cut ships what is finished, writes the notes as a board document, and carries the rest to the next release, recording that it did.

A release also has a stage (cadence.release_stages, by default candidate → test → staging → production) and the history of its moves, each with who and when. release promote moves it (releases::promote). The first and last stages act on the project’s code repository through coderepo, which shells out to the developer’s own git: the first makes release/<VERSION>, the last is the cut. The cut checks everything it can first — no uncommitted changes, the branch present, the tag absent, main an ancestor of the release — then tags the release tip and fast-forwards main to it, then cuts the board; if the board step fails, the tag is deleted and main put back. The CLI passes the repository it runs in, the daemon the one it was started in when that folder’s marker names the project; without one, those two stages are refused. Nothing is pushed.