# franciscoh017/baton-os architecture

> Architecture diagram of the GitHub repository franciscoh017/baton-os, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/franciscoh017/baton-os
- Repository: https://github.com/franciscoh017/baton-os

## Overview

BatonOS is a filesystem-first Kanban framework for coordinating specialized agents through a Scrum Master. A request is turned into a card, refined and routed, handed to a worker in a delegation packet, returned with execution evidence, and held for human acceptance before closure. The CLI exposes workflow operations; the core manages board artifacts, while a local UI presents snapshots and live updates. README-described agent, skill, assessment, and adapter capabilities are included; unsampled internals are represented at their known directories.

Main entry points: [`kanban_framework/cli.py`](https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/cli.py) (Kanban CLI), [`kanban_framework/core.py`](https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/core.py) (Board and Workflow Core), [`kanban_framework/live_board.py`](https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/live_board.py) (Live Board Server), [`kanban/templates/delegation-packet.md`](https://github.com/franciscoh017/baton-os/blob/main/kanban/templates/delegation-packet.md) (Delegation Packets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Card Workflow"]
  node_core["Board and Workflow Core<br/>[core.py]"]
  node_boardfiles[("Markdown Board State")]
  node_contracts["Role Contracts"]
  node_packets["Delegation Packets"]
  node_returns["Execution Returns"]
end

subgraph group_runtime["CLI Runtime"]
  node_cli["Kanban CLI<br/>[cli.py]"]
end

subgraph group_boardview["Board Visibility"]
  node_live["Live Board Server<br/>[live_board.py]"]
  node_snapshot["Board Snapshot<br/>[core.py]"]
  node_ui["Board UI<br/>[app.js]"]
end

subgraph group_agenttools["Agent Support"]
  node_adapter["External Runtime Adapter<br/>[cli_adapter.py]"]
  node_skills["Skill Resolution"]
  node_assessment["Workspace Assessment<br/>[core.py]"]
end

node_user(("Requester"))
node_scrum(("Scrum Master"))
node_worker(("Specialist Worker"))
node_reviewer(("Human Reviewer"))
node_external{{"Agent Harness"}}

node_user -->|"submits request"| node_scrum
node_scrum -->|"creates card"| node_cli
node_cli -->|"dispatches commands"| node_core
node_core -->|"writes board state"| node_boardfiles
node_scrum -->|"selects role"| node_contracts
node_scrum -->|"builds handoff"| node_packets
node_core -->|"writes packet"| node_packets
node_packets -->|"guides execution"| node_worker
node_scrum -->|"invokes runtime"| node_adapter
node_adapter -->|"launches command"| node_external
node_external -->|"runs delegated work"| node_worker
node_worker -->|"records evidence"| node_returns
node_cli -->|"records return"| node_core
node_core -->|"writes return"| node_returns
node_reviewer -->|"validates acceptance"| node_scrum
node_scrum -->|"closes card"| node_cli
node_cli -->|"resolves skills"| node_skills
node_scrum -->|"requests assessment"| node_assessment
node_cli -->|"runs assessment"| node_assessment
node_cli -->|"starts server"| node_live
node_live -->|"loads snapshot"| node_snapshot
node_snapshot -->|"reads board state"| node_boardfiles
node_ui -->|"fetches and subscribes"| node_live
node_live -->|"serves events"| node_ui

click node_cli "https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/cli.py"
click node_core "https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/core.py"
click node_boardfiles "https://github.com/franciscoh017/baton-os/tree/main/kanban"
click node_contracts "https://github.com/franciscoh017/baton-os/tree/main/agents"
click node_packets "https://github.com/franciscoh017/baton-os/blob/main/kanban/templates/delegation-packet.md"
click node_returns "https://github.com/franciscoh017/baton-os/tree/main/kanban/refs/notes/returns"
click node_adapter "https://github.com/franciscoh017/baton-os/blob/main/scripts/cli_adapter.py"
click node_skills "https://github.com/franciscoh017/baton-os/tree/main/skills"
click node_assessment "https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/core.py"
click node_live "https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/live_board.py"
click node_snapshot "https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/core.py"
click node_ui "https://github.com/franciscoh017/baton-os/blob/main/ui/app.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_core,node_boardfiles,node_contracts,node_packets,node_returns,node_reviewer toneBlue
class node_cli toneAmber
class node_live,node_snapshot,node_ui,node_user toneMint
class node_adapter,node_skills,node_assessment,node_worker toneRose
class node_scrum,node_external toneIndigo
```

## Components

### Card Workflow

- [Board and Workflow Core](https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/core.py): `kanban_framework/core.py`
- [Markdown Board State](https://github.com/franciscoh017/baton-os/tree/main/kanban): `kanban`
- [Role Contracts](https://github.com/franciscoh017/baton-os/tree/main/agents): `agents`
- [Delegation Packets](https://github.com/franciscoh017/baton-os/blob/main/kanban/templates/delegation-packet.md): `kanban/templates/delegation-packet.md`
- [Execution Returns](https://github.com/franciscoh017/baton-os/tree/main/kanban/refs/notes/returns): `kanban/refs/notes/returns`

### CLI Runtime

- [Kanban CLI](https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/cli.py): `kanban_framework/cli.py`

### Board Visibility

- [Live Board Server](https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/live_board.py): `kanban_framework/live_board.py`
- [Board Snapshot](https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/core.py): `kanban_framework/core.py`
- [Board UI](https://github.com/franciscoh017/baton-os/blob/main/ui/app.js): `ui/app.js`

### Agent Support

- [External Runtime Adapter](https://github.com/franciscoh017/baton-os/blob/main/scripts/cli_adapter.py): `scripts/cli_adapter.py`
- [Skill Resolution](https://github.com/franciscoh017/baton-os/tree/main/skills): `skills`
- [Workspace Assessment](https://github.com/franciscoh017/baton-os/blob/main/kanban_framework/core.py): `kanban_framework/core.py`

### Other components

- **Requester**
- **Scrum Master**
- **Specialist Worker**
- **Human Reviewer**
- **Agent Harness**

## Connections

- Requester → Scrum Master: submits request (evidence: `README.md`)
- Scrum Master → Kanban CLI: creates card (evidence: `README.md`)
- Kanban CLI → Board and Workflow Core: dispatches commands (evidence: `kanban_framework/cli.py`)
- Board and Workflow Core → Markdown Board State: writes board state (evidence: `README.md`)
- Scrum Master → Role Contracts: selects role (evidence: `README.md`)
- Scrum Master → Delegation Packets: builds handoff (evidence: `README.md`)
- Board and Workflow Core → Delegation Packets: writes packet (evidence: `README.md`)
- Delegation Packets → Specialist Worker: guides execution (evidence: `README.md`)
- Scrum Master → External Runtime Adapter: invokes runtime (evidence: `README.md`)
- External Runtime Adapter → Agent Harness: launches command (evidence: `README.md`)
- Agent Harness → Specialist Worker: runs delegated work (evidence: `README.md`)
- Specialist Worker → Execution Returns: records evidence (evidence: `README.md`)
- Kanban CLI → Board and Workflow Core: records return (evidence: `kanban_framework/cli.py`)
- Board and Workflow Core → Execution Returns: writes return (evidence: `README.md`)
- Human Reviewer → Scrum Master: validates acceptance (evidence: `README.md`)
- Scrum Master → Kanban CLI: closes card (evidence: `README.md`)
- Kanban CLI → Skill Resolution: resolves skills (evidence: `README.md`)
- Scrum Master → Workspace Assessment: requests assessment (evidence: `README.md`)
- Kanban CLI → Workspace Assessment: runs assessment (evidence: `kanban_framework/cli.py`)
- Kanban CLI → Live Board Server: starts server (evidence: `kanban_framework/cli.py`)
- Live Board Server → Board Snapshot: loads snapshot (evidence: `kanban_framework/live_board.py`)
- Board Snapshot → Markdown Board State: reads board state (evidence: `README.md`)
- Board UI → Live Board Server: fetches and subscribes (evidence: `ui/app.js`)
- Live Board Server → Board UI: serves events (evidence: `kanban_framework/live_board.py`)
