# sherwinvishesh/clara architecture

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

- Interactive diagram: https://gitdiagram.com/sherwinvishesh/clara
- Repository: https://github.com/sherwinvishesh/clara

## Overview

Clara is repository-local project management for teams using coding agents. People and agents plan tickets, claim ready work, work in isolated git worktrees, ask and answer questions, then submit changes for human review and approval. The board and its history live as Markdown and logs in `.clara/`; the same operations are exposed through CLI, web, MCP, REST, and a TypeScript library. A linked project brain supplies context and retains handoff notes. Workflow and storage links are supported by the README and sampled engine/load excerpts; unsampled UI and integration details are not expanded.

Main entry points: [`library/ops/engine.ts`](https://github.com/sherwinvishesh/clara/blob/main/library/ops/engine.ts) (Operation engine), [`library/conductor/dispatch.ts`](https://github.com/sherwinvishesh/clara/blob/main/library/conductor/dispatch.ts) (Agent work loop), [`cli/commands.ts`](https://github.com/sherwinvishesh/clara/blob/main/cli/commands.ts) (CLI), [`web/views/board/board.tsx`](https://github.com/sherwinvishesh/clara/blob/main/web/views/board/board.tsx) (Web board)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_cli["CLI<br/>[commands.ts]"]
  node_web["Web board<br/>[board.tsx]"]
  node_rest["REST app<br/>[app.ts]"]
  node_mcp["MCP server<br/>[server.ts]"]
  node_library["TypeScript API<br/>[index.ts]"]
end

subgraph group_workflow["Work lifecycle"]
  node_engine["Operation engine<br/>[engine.ts]"]
  node_planner["Plan tickets<br/>[plan.ts]"]
  node_work["Agent work loop<br/>[dispatch.ts]"]
  node_routing["Agent routing<br/>[route.ts]"]
  node_review["Review and approval<br/>[review.ts]"]
end

subgraph group_board["Board and memory"]
  node_model["Board model<br/>[types.ts]"]
  node_loader["Board loading<br/>[load.ts]"]
  node_storage[("Markdown storage<br/>[fs.ts]")]
  node_history[("Event history<br/>[log.ts]")]
  node_brain["Project brain<br/>[brain.ts]"]
  node_context["Ticket context<br/>[context.ts]"]
end

subgraph group_integrations["Agent integrations"]
  node_adapters["Agent adapters<br/>[index.ts]"]
  node_git["Git worktrees<br/>[worktree.ts]"]
end

subgraph group_insight["Planning and insight"]
  node_imports["Board importers<br/>[index.ts]"]
  node_insights["Project insights<br/>[work.ts]"]
end

node_people(("People"))
node_agents(("Coding agents"))

node_people -->|"use commands"| node_cli
node_people -->|"use board"| node_web
node_agents -->|"use tools"| node_mcp
node_agents -->|"claim and work"| node_work
node_cli -->|"invoke operations"| node_engine
node_rest -->|"dispatch operations"| node_engine
node_mcp -->|"invoke operations"| node_engine
node_web -.->|"send requests"| node_rest
node_library -.->|"expose operations"| node_engine
node_engine -->|"load board"| node_loader
node_loader -->|"read files"| node_storage
node_engine -.->|"record changes"| node_history
node_engine -->|"validate changes"| node_model
node_people -->|"propose plan"| node_planner
node_work -->|"select agent"| node_routing
node_work -->|"launch agent"| node_adapters
node_work -->|"work in isolation"| node_git
node_work -->|"read ticket context"| node_context
node_context -->|"gather related notes"| node_brain
node_people -->|"approve or return"| node_review
node_review -->|"merge work"| node_git
node_people -->|"import existing work"| node_imports
node_people -.->|"inspect progress"| node_insights

click node_cli "https://github.com/sherwinvishesh/clara/blob/main/cli/commands.ts"
click node_web "https://github.com/sherwinvishesh/clara/blob/main/web/views/board/board.tsx"
click node_rest "https://github.com/sherwinvishesh/clara/blob/main/server/app.ts"
click node_mcp "https://github.com/sherwinvishesh/clara/blob/main/mcp/server.ts"
click node_library "https://github.com/sherwinvishesh/clara/blob/main/library/index.ts"
click node_engine "https://github.com/sherwinvishesh/clara/blob/main/library/ops/engine.ts"
click node_planner "https://github.com/sherwinvishesh/clara/blob/main/library/ops/plan.ts"
click node_work "https://github.com/sherwinvishesh/clara/blob/main/library/conductor/dispatch.ts"
click node_routing "https://github.com/sherwinvishesh/clara/blob/main/library/conductor/route.ts"
click node_review "https://github.com/sherwinvishesh/clara/blob/main/library/conductor/review.ts"
click node_model "https://github.com/sherwinvishesh/clara/blob/main/library/model/types.ts"
click node_loader "https://github.com/sherwinvishesh/clara/blob/main/library/ops/load.ts"
click node_storage "https://github.com/sherwinvishesh/clara/blob/main/library/storage/fs.ts"
click node_history "https://github.com/sherwinvishesh/clara/blob/main/library/log/log.ts"
click node_brain "https://github.com/sherwinvishesh/clara/blob/main/library/ops/brain.ts"
click node_context "https://github.com/sherwinvishesh/clara/blob/main/library/ops/context.ts"
click node_adapters "https://github.com/sherwinvishesh/clara/blob/main/library/conductor/adapters/index.ts"
click node_git "https://github.com/sherwinvishesh/clara/blob/main/library/git/worktree.ts"
click node_imports "https://github.com/sherwinvishesh/clara/blob/main/library/import/index.ts"
click node_insights "https://github.com/sherwinvishesh/clara/blob/main/library/insights/work.ts"

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_cli,node_web,node_rest,node_mcp,node_library toneBlue
class node_engine,node_planner,node_work,node_routing,node_review toneAmber
class node_model,node_loader,node_storage,node_history,node_brain,node_context toneMint
class node_adapters,node_git toneRose
class node_imports,node_insights,node_people,node_agents toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/sherwinvishesh/clara/blob/main/cli/commands.ts): `cli/commands.ts`
- [Web board](https://github.com/sherwinvishesh/clara/blob/main/web/views/board/board.tsx): `web/views/board/board.tsx`
- [REST app](https://github.com/sherwinvishesh/clara/blob/main/server/app.ts): `server/app.ts`
- [MCP server](https://github.com/sherwinvishesh/clara/blob/main/mcp/server.ts): `mcp/server.ts`
- [TypeScript API](https://github.com/sherwinvishesh/clara/blob/main/library/index.ts): `library/index.ts`

### Work lifecycle

- [Operation engine](https://github.com/sherwinvishesh/clara/blob/main/library/ops/engine.ts): `library/ops/engine.ts`
- [Plan tickets](https://github.com/sherwinvishesh/clara/blob/main/library/ops/plan.ts): `library/ops/plan.ts`
- [Agent work loop](https://github.com/sherwinvishesh/clara/blob/main/library/conductor/dispatch.ts): `library/conductor/dispatch.ts`
- [Agent routing](https://github.com/sherwinvishesh/clara/blob/main/library/conductor/route.ts): `library/conductor/route.ts`
- [Review and approval](https://github.com/sherwinvishesh/clara/blob/main/library/conductor/review.ts): `library/conductor/review.ts`

### Board and memory

- [Board model](https://github.com/sherwinvishesh/clara/blob/main/library/model/types.ts): `library/model/types.ts`
- [Board loading](https://github.com/sherwinvishesh/clara/blob/main/library/ops/load.ts): `library/ops/load.ts`
- [Markdown storage](https://github.com/sherwinvishesh/clara/blob/main/library/storage/fs.ts): `library/storage/fs.ts`
- [Event history](https://github.com/sherwinvishesh/clara/blob/main/library/log/log.ts): `library/log/log.ts`
- [Project brain](https://github.com/sherwinvishesh/clara/blob/main/library/ops/brain.ts): `library/ops/brain.ts`
- [Ticket context](https://github.com/sherwinvishesh/clara/blob/main/library/ops/context.ts): `library/ops/context.ts`

### Agent integrations

- [Agent adapters](https://github.com/sherwinvishesh/clara/blob/main/library/conductor/adapters/index.ts): `library/conductor/adapters/index.ts`
- [Git worktrees](https://github.com/sherwinvishesh/clara/blob/main/library/git/worktree.ts): `library/git/worktree.ts`

### Planning and insight

- [Board importers](https://github.com/sherwinvishesh/clara/blob/main/library/import/index.ts): `library/import/index.ts`
- [Project insights](https://github.com/sherwinvishesh/clara/blob/main/library/insights/work.ts): `library/insights/work.ts`

### Other components

- **People**
- **Coding agents**

## Connections

- People → CLI: use commands (evidence: `README.md`)
- People → Web board: use board (evidence: `README.md`)
- Coding agents → MCP server: use tools (evidence: `README.md`)
- Coding agents → Agent work loop: claim and work (evidence: `README.md`)
- CLI → Operation engine: invoke operations (evidence: `cli/run.ts`)
- REST app → Operation engine: dispatch operations (evidence: `server/app.ts`)
- MCP server → Operation engine: invoke operations (evidence: `mcp/server.ts`)
- Web board → REST app: send requests
- TypeScript API → Operation engine: expose operations (evidence: `library/index.ts`)
- Operation engine → Board loading: load board (evidence: `library/ops/engine.ts`)
- Board loading → Markdown storage: read files (evidence: `library/ops/load.ts`)
- Operation engine → Event history: record changes
- Operation engine → Board model: validate changes (evidence: `library/ops/engine.ts`)
- People → Plan tickets: propose plan (evidence: `README.md`)
- Agent work loop → Agent routing: select agent (evidence: `library/conductor/route.ts`)
- Agent work loop → Agent adapters: launch agent (evidence: `README.md`)
- Agent work loop → Git worktrees: work in isolation (evidence: `README.md`)
- Agent work loop → Ticket context: read ticket context (evidence: `library/ops/context.ts`)
- Ticket context → Project brain: gather related notes (evidence: `library/ops/context.ts`)
- People → Review and approval: approve or return (evidence: `README.md`)
- Review and approval → Git worktrees: merge work (evidence: `README.md`)
- People → Board importers: import existing work (evidence: `README.md`)
- People → Project insights: inspect progress
