# choysang/agent-suite architecture

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

- Interactive diagram: https://gitdiagram.com/choysang/agent-suite
- Repository: https://github.com/choysang/agent-suite

## Overview

Agent Suite combines work guidelines, a Markdown knowledge system, and a session-handoff tool. Its main project workflow is: apply the guidelines, retrieve and curate knowledge while working, prepare and seal a handoff when changing sessions, then load it and continue; reusable lessons return to the knowledge base. The graph preserves the documented knowledge feedback and governance capabilities. Handoff internals are shown where the excerpts or source index support them; unsampled implementation details are not inferred.

Main entry points: [`knowledge`](https://github.com/choysang/agent-suite/tree/main/knowledge) (Markdown knowledge), [`handoff/src/ports.ts`](https://github.com/choysang/agent-suite/blob/main/handoff/src/ports.ts) (Sealed handoffs), [`handoff/src/kernel/seal.ts`](https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/seal.ts) (Validate and seal), [`handoff/src/kernel/prepare.ts`](https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/prepare.ts) (Prepare and join)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guides["Work guidelines"]
  node_guide["Agent guidance"]
end

subgraph group_knowledge["Knowledge system"]
  node_capture_skill["Capture skill<br/>[SKILL.md]"]
  node_sink_skill["Sink skill<br/>[SKILL.md]"]
  node_kb_skill["Knowledge skill<br/>[SKILL.md]"]
  node_daily_skill["Daily skill<br/>[SKILL.md]"]
  node_tidy_skill["Tidy skill<br/>[SKILL.md]"]
  node_kb_engine["KB retrieval<br/>[kb.py]"]
  node_knowledge_store[("Markdown knowledge")]
  node_templates["Note templates"]
end

subgraph group_handoff["Session handoff"]
  node_handoff_skill["Handoff skill<br/>[SKILL.md]"]
  node_cli["CLI face<br/>[cli.ts]"]
  node_web["Dashboard<br/>[server.ts]"]
  node_prepare["Prepare and join<br/>[prepare.ts]"]
  node_capture["Transcript capture<br/>[capture.ts]"]
  node_seal["Validate and seal<br/>[seal.ts]"]
  node_load["Load and reconcile<br/>[load.ts]"]
  node_dag["Handoff DAG<br/>[dag.ts]"]
  node_git_adapters["Git workspace and store<br/>[git.ts]"]
  node_transcript_adapters["Transcript adapters"]
  node_handoff_bundle[("Sealed handoffs<br/>[ports.ts]")]
end

subgraph group_feedback["Feedback governance"]
  node_rsi_engine["RSI governance<br/>[kb_rsi.py]"]
  node_rsi_protocol["Feedback protocol<br/>[RSI.md]"]
end

node_user(("Engineer"))
node_next_agent(("Receiving agent"))

node_user -->|"applies"| node_guide
node_guide -->|"guides work"| node_user
node_user -->|"retrieves knowledge"| node_kb_skill
node_user -->|"collects sources"| node_capture_skill
node_user -->|"records lessons"| node_sink_skill
node_user -->|"uses"| node_daily_skill
node_user -->|"curates"| node_tidy_skill
node_kb_skill -.->|"invokes"| node_kb_engine
node_kb_engine -.->|"searches"| node_knowledge_store
node_capture_skill -->|"adds sources"| node_knowledge_store
node_sink_skill -->|"records experience"| node_knowledge_store
node_daily_skill -.->|"records daily notes"| node_knowledge_store
node_tidy_skill -->|"curates entries"| node_knowledge_store
node_templates -.->|"structures notes"| node_knowledge_store
node_user -->|"installs or invokes"| node_handoff_skill
node_handoff_skill -.->|"guides commands"| node_cli
node_cli -->|"calls"| node_prepare
node_cli -->|"calls"| node_seal
node_cli -->|"calls"| node_load
node_web -->|"calls views"| node_prepare
node_prepare -->|"captures transcripts"| node_capture
node_seal -->|"recaptures"| node_capture
node_load -->|"reads bundles"| node_handoff_bundle
node_load -->|"selects open seals"| node_dag
node_prepare -->|"derives parents"| node_dag
node_prepare -->|"reads parents"| node_handoff_bundle
node_seal -->|"writes seal"| node_handoff_bundle
node_seal -->|"claims number"| node_handoff_bundle
node_seal -->|"snapshots worktree"| node_git_adapters
node_load -->|"reconciles worktree"| node_git_adapters
node_capture -->|"reads turns"| node_transcript_adapters
node_seal -->|"stores voice and state"| node_handoff_bundle
node_handoff_bundle -->|"continues task"| node_next_agent
node_user -->|"reviews evidence and feedback"| node_rsi_protocol
node_rsi_protocol -.->|"defines governance"| node_rsi_engine
node_rsi_engine -.->|"records feedback"| node_knowledge_store
node_handoff_bundle -->|"feeds reusable lessons"| node_knowledge_store

click node_guide "https://github.com/choysang/agent-suite/tree/main/guidelines"
click node_capture_skill "https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/capture/SKILL.md"
click node_sink_skill "https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/sink/SKILL.md"
click node_kb_skill "https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/kb/SKILL.md"
click node_daily_skill "https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/daily/SKILL.md"
click node_tidy_skill "https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/tidy/SKILL.md"
click node_kb_engine "https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/kb/scripts/kb.py"
click node_rsi_engine "https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/kb/scripts/kb_rsi.py"
click node_knowledge_store "https://github.com/choysang/agent-suite/tree/main/knowledge"
click node_templates "https://github.com/choysang/agent-suite/tree/main/knowledge/Templates"
click node_rsi_protocol "https://github.com/choysang/agent-suite/blob/main/knowledge/RSI.md"
click node_handoff_skill "https://github.com/choysang/agent-suite/blob/main/handoff/skill/SKILL.md"
click node_cli "https://github.com/choysang/agent-suite/blob/main/handoff/src/faces/cli.ts"
click node_web "https://github.com/choysang/agent-suite/blob/main/handoff/src/faces/server.ts"
click node_prepare "https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/prepare.ts"
click node_capture "https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/capture.ts"
click node_seal "https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/seal.ts"
click node_load "https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/load.ts"
click node_dag "https://github.com/choysang/agent-suite/blob/main/handoff/src/core/dag.ts"
click node_git_adapters "https://github.com/choysang/agent-suite/blob/main/handoff/src/adapters/git.ts"
click node_transcript_adapters "https://github.com/choysang/agent-suite/tree/main/handoff/src/adapters"
click node_handoff_bundle "https://github.com/choysang/agent-suite/blob/main/handoff/src/ports.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_guide toneBlue
class node_capture_skill,node_sink_skill,node_kb_skill,node_daily_skill,node_tidy_skill,node_kb_engine,node_knowledge_store,node_templates toneAmber
class node_handoff_skill,node_cli,node_web,node_prepare,node_capture,node_seal,node_load,node_dag,node_git_adapters,node_transcript_adapters,node_handoff_bundle toneMint
class node_rsi_engine,node_rsi_protocol toneRose
class node_user,node_next_agent toneIndigo
```

## Components

### Work guidelines

- [Agent guidance](https://github.com/choysang/agent-suite/tree/main/guidelines): `guidelines`

### Knowledge system

- [Capture skill](https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/capture/SKILL.md): `knowledge/.agents/skills/capture/SKILL.md`
- [Sink skill](https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/sink/SKILL.md): `knowledge/.agents/skills/sink/SKILL.md`
- [Knowledge skill](https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/kb/SKILL.md): `knowledge/.agents/skills/kb/SKILL.md`
- [Daily skill](https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/daily/SKILL.md): `knowledge/.agents/skills/daily/SKILL.md`
- [Tidy skill](https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/tidy/SKILL.md): `knowledge/.agents/skills/tidy/SKILL.md`
- [KB retrieval](https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/kb/scripts/kb.py): `knowledge/.agents/skills/kb/scripts/kb.py`
- [Markdown knowledge](https://github.com/choysang/agent-suite/tree/main/knowledge): `knowledge`
- [Note templates](https://github.com/choysang/agent-suite/tree/main/knowledge/Templates): `knowledge/Templates`

### Session handoff

- [Handoff skill](https://github.com/choysang/agent-suite/blob/main/handoff/skill/SKILL.md): `handoff/skill/SKILL.md`
- [CLI face](https://github.com/choysang/agent-suite/blob/main/handoff/src/faces/cli.ts): `handoff/src/faces/cli.ts`
- [Dashboard](https://github.com/choysang/agent-suite/blob/main/handoff/src/faces/server.ts): `handoff/src/faces/server.ts`
- [Prepare and join](https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/prepare.ts): `handoff/src/kernel/prepare.ts`
- [Transcript capture](https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/capture.ts): `handoff/src/kernel/capture.ts`
- [Validate and seal](https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/seal.ts): `handoff/src/kernel/seal.ts`
- [Load and reconcile](https://github.com/choysang/agent-suite/blob/main/handoff/src/kernel/load.ts): `handoff/src/kernel/load.ts`
- [Handoff DAG](https://github.com/choysang/agent-suite/blob/main/handoff/src/core/dag.ts): `handoff/src/core/dag.ts`
- [Git workspace and store](https://github.com/choysang/agent-suite/blob/main/handoff/src/adapters/git.ts): `handoff/src/adapters/git.ts`
- [Transcript adapters](https://github.com/choysang/agent-suite/tree/main/handoff/src/adapters): `handoff/src/adapters`
- [Sealed handoffs](https://github.com/choysang/agent-suite/blob/main/handoff/src/ports.ts): `handoff/src/ports.ts`

### Feedback governance

- [RSI governance](https://github.com/choysang/agent-suite/blob/main/knowledge/.agents/skills/kb/scripts/kb_rsi.py): `knowledge/.agents/skills/kb/scripts/kb_rsi.py`
- [Feedback protocol](https://github.com/choysang/agent-suite/blob/main/knowledge/RSI.md): `knowledge/RSI.md`

### Other components

- **Engineer**
- **Receiving agent**

## Connections

- Engineer → Agent guidance: applies (evidence: `README.md`)
- Agent guidance → Engineer: guides work (evidence: `README.md`)
- Engineer → Knowledge skill: retrieves knowledge (evidence: `README.md`)
- Engineer → Capture skill: collects sources (evidence: `README.md`)
- Engineer → Sink skill: records lessons (evidence: `README.md`)
- Engineer → Daily skill: uses (evidence: `README.md`)
- Engineer → Tidy skill: curates (evidence: `README.md`)
- Knowledge skill → KB retrieval: invokes
- KB retrieval → Markdown knowledge: searches
- Capture skill → Markdown knowledge: adds sources (evidence: `README.md`)
- Sink skill → Markdown knowledge: records experience (evidence: `README.md`)
- Daily skill → Markdown knowledge: records daily notes
- Tidy skill → Markdown knowledge: curates entries (evidence: `README.md`)
- Note templates → Markdown knowledge: structures notes
- Engineer → Handoff skill: installs or invokes (evidence: `README.md`)
- Handoff skill → CLI face: guides commands
- CLI face → Prepare and join: calls (evidence: `handoff/src/faces/cli.ts`)
- CLI face → Validate and seal: calls (evidence: `handoff/src/faces/cli.ts`)
- CLI face → Load and reconcile: calls (evidence: `handoff/src/faces/cli.ts`)
- Dashboard → Prepare and join: calls views (evidence: `handoff/src/faces/server.ts`)
- Prepare and join → Transcript capture: captures transcripts (evidence: `handoff/src/kernel/prepare.ts`)
- Validate and seal → Transcript capture: recaptures (evidence: `handoff/src/kernel/seal.ts`)
- Load and reconcile → Sealed handoffs: reads bundles (evidence: `handoff/src/kernel/load.ts`)
- Load and reconcile → Handoff DAG: selects open seals (evidence: `handoff/src/kernel/load.ts`)
- Prepare and join → Handoff DAG: derives parents (evidence: `handoff/src/kernel/prepare.ts`)
- Prepare and join → Sealed handoffs: reads parents (evidence: `handoff/src/kernel/prepare.ts`)
- Validate and seal → Sealed handoffs: writes seal (evidence: `handoff/src/kernel/seal.ts`)
- Validate and seal → Sealed handoffs: claims number (evidence: `handoff/src/kernel/seal.ts`)
- Validate and seal → Git workspace and store: snapshots worktree (evidence: `handoff/src/kernel/seal.ts`)
- Load and reconcile → Git workspace and store: reconciles worktree (evidence: `handoff/src/kernel/load.ts`)
- Transcript capture → Transcript adapters: reads turns (evidence: `handoff/src/kernel/capture.ts`)
- Validate and seal → Sealed handoffs: stores voice and state (evidence: `handoff/src/kernel/seal.ts`)
- Sealed handoffs → Receiving agent: continues task (evidence: `README.md`)
- Engineer → Feedback protocol: reviews evidence and feedback (evidence: `README.md`)
- Feedback protocol → RSI governance: defines governance
- RSI governance → Markdown knowledge: records feedback
- Sealed handoffs → Markdown knowledge: feeds reusable lessons (evidence: `README.md`)
