# kc1t/alethe-orchestrate-skill architecture

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

- Interactive diagram: https://gitdiagram.com/kc1t/alethe-orchestrate-skill
- Repository: https://github.com/kc1t/alethe-orchestrate-skill

## Overview

Alethe is an installable agent skill that helps a lead coding agent delegate bounded work to provider CLIs, then integrate results and explain the cost. The main workflow is: a user requests work; the lead chooses and previews a playbook plan; the runner launches workers; the lead reviews and integrates their results; the report records outcomes and cost. Passive hooks, setup and quota checks are additional capabilities. The runner is a large, partially sampled module, so its internal stages are grouped by responsibility; unsampled implementation links are omitted or marked unverified.

Main entry points: [`skills/alethe/scripts/orchestrate.py`](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py) (Worker Runner), [`skills/alethe/SKILL.md`](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/SKILL.md) (Lead Agent), [`skills/alethe/playbooks.yaml`](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/playbooks.yaml) (Playbooks), [`skills/alethe/scripts/hook.py`](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/hook.py) (Passive Hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lead["Lead Workflow"]
  node_lead_agent["Lead Agent<br/>[SKILL.md]"]
  node_playbooks["Playbooks<br/>[playbooks.yaml]"]
  node_briefs["Worker Briefs<br/>[briefs.md]"]
  node_integration["Review And Integration<br/>[SKILL.md]"]
end

subgraph group_runtime["Orchestration Runtime"]
  node_plan["Plan Validation<br/>[orchestrate.py]"]
  node_runner["Worker Runner<br/>[orchestrate.py]"]
  node_safety["Worker Safety<br/>[orchestrate.py]"]
  node_worktrees["Worktrees<br/>[orchestrate.py]"]
  node_policy["User Policy<br/>[orchestrate.py]"]
end

subgraph group_insight["Usage And Reports"]
  node_quota["Quota And Usage<br/>[orchestrate.py]"]
  node_session_state[("Session State<br/>[orchestrate.py]")]
  node_report["Run Reports<br/>[orchestrate.py]"]
end

subgraph group_support["Hooks And Preview"]
  node_hook["Passive Hook<br/>[hook.py]"]
  node_diagram["Plan Diagram<br/>[diagram.py]"]
  node_validator["Playbook Validator<br/>[check_playbooks.py]"]
end

node_user(("User"))
node_worker_cli["Provider CLIs"]
node_claude_session["Claude Session"]

node_user -->|"requests work"| node_lead_agent
node_lead_agent -->|"chooses playbook"| node_playbooks
node_lead_agent -->|"writes briefs"| node_briefs
node_lead_agent -->|"previews plan"| node_plan
node_playbooks -.->|"configures plan"| node_plan
node_plan -->|"starts workers"| node_runner
node_runner -->|"runs workers"| node_worker_cli
node_runner -->|"confines execution"| node_safety
node_runner -->|"isolates work"| node_worktrees
node_runner -->|"returns results"| node_integration
node_integration -->|"integrates results"| node_lead_agent
node_lead_agent -->|"requests report"| node_report
node_runner -.->|"records outcomes"| node_report
node_lead_agent -.->|"configures policy"| node_policy
node_hook -->|"reads state"| node_session_state
node_claude_session -->|"sends events"| node_hook
node_hook -->|"loads full handler"| node_runner
node_runner -.->|"checks quota"| node_quota
node_runner -.->|"stores usage"| node_session_state
node_runner -.->|"writes preview input"| node_diagram
node_playbooks -->|"validates config"| node_validator

click node_lead_agent "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/SKILL.md"
click node_playbooks "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/playbooks.yaml"
click node_briefs "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/references/briefs.md"
click node_plan "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py"
click node_runner "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py"
click node_safety "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py"
click node_worktrees "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py"
click node_integration "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/SKILL.md"
click node_policy "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py"
click node_quota "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py"
click node_session_state "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py"
click node_report "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py"
click node_hook "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/hook.py"
click node_diagram "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/diagram.py"
click node_validator "https://github.com/kc1t/alethe-orchestrate-skill/blob/main/tools/check_playbooks.py"

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_lead_agent,node_playbooks,node_briefs,node_integration,node_user toneBlue
class node_plan,node_runner,node_safety,node_worktrees,node_policy toneAmber
class node_quota,node_session_state,node_report toneMint
class node_hook,node_diagram,node_validator toneRose
class node_worker_cli,node_claude_session toneIndigo
```

## Components

### Lead Workflow

- [Lead Agent](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/SKILL.md): `skills/alethe/SKILL.md`
- [Playbooks](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/playbooks.yaml): `skills/alethe/playbooks.yaml`
- [Worker Briefs](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/references/briefs.md): `skills/alethe/references/briefs.md`
- [Review And Integration](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/SKILL.md): `skills/alethe/SKILL.md`

### Orchestration Runtime

- [Plan Validation](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py): `skills/alethe/scripts/orchestrate.py`
- [Worker Runner](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py): `skills/alethe/scripts/orchestrate.py`
- [Worker Safety](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py): `skills/alethe/scripts/orchestrate.py`
- [Worktrees](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py): `skills/alethe/scripts/orchestrate.py`
- [User Policy](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py): `skills/alethe/scripts/orchestrate.py`

### Usage And Reports

- [Quota And Usage](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py): `skills/alethe/scripts/orchestrate.py`
- [Session State](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py): `skills/alethe/scripts/orchestrate.py`
- [Run Reports](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/orchestrate.py): `skills/alethe/scripts/orchestrate.py`

### Hooks And Preview

- [Passive Hook](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/hook.py): `skills/alethe/scripts/hook.py`
- [Plan Diagram](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/skills/alethe/scripts/diagram.py): `skills/alethe/scripts/diagram.py`
- [Playbook Validator](https://github.com/kc1t/alethe-orchestrate-skill/blob/main/tools/check_playbooks.py): `tools/check_playbooks.py`

### Other components

- **User**
- **Provider CLIs**
- **Claude Session**

## Connections

- User → Lead Agent: requests work (evidence: `README.md`)
- Lead Agent → Playbooks: chooses playbook (evidence: `README.md`)
- Lead Agent → Worker Briefs: writes briefs (evidence: `README.md`)
- Lead Agent → Plan Validation: previews plan (evidence: `README.md`)
- Playbooks → Plan Validation: configures plan
- Plan Validation → Worker Runner: starts workers (evidence: `README.md`)
- Worker Runner → Provider CLIs: runs workers (evidence: `README.md`)
- Worker Runner → Worker Safety: confines execution (evidence: `README.md`)
- Worker Runner → Worktrees: isolates work (evidence: `README.md`)
- Worker Runner → Review And Integration: returns results (evidence: `README.md`)
- Review And Integration → Lead Agent: integrates results (evidence: `README.md`)
- Lead Agent → Run Reports: requests report (evidence: `README.md`)
- Worker Runner → Run Reports: records outcomes (evidence: `skills/alethe/scripts/orchestrate.py`)
- Lead Agent → User Policy: configures policy
- Passive Hook → Session State: reads state (evidence: `skills/alethe/scripts/hook.py`)
- Claude Session → Passive Hook: sends events (evidence: `README.md`)
- Passive Hook → Worker Runner: loads full handler (evidence: `skills/alethe/scripts/hook.py`)
- Worker Runner → Quota And Usage: checks quota (evidence: `skills/alethe/scripts/orchestrate.py`)
- Worker Runner → Session State: stores usage (evidence: `skills/alethe/scripts/orchestrate.py`)
- Worker Runner → Plan Diagram: writes preview input
- Playbooks → Playbook Validator: validates config (evidence: `tools/check_playbooks.py`)
