# watchandytw/multi-model-team architecture

> Architecture diagram of the GitHub repository watchandytw/multi-model-team, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/watchandytw/multi-model-team
- Repository: https://github.com/watchandytw/multi-model-team

## Overview

multi-model-team is a Claude Code plugin for routing work to local model CLIs, coordinating staffed teams, and combining parallel model answers. Its principal workflow routes a task, invokes a selected backend with fallback to native Claude, then returns the result; the team and reasoning workflows add decomposition/review and panel/judge/synthesis stages. The graph reflects documented capabilities as well as sampled code; some workflow-to-tool wiring is documented but not fully visible in the excerpts.

Main entry points: [`workflows/team.mjs`](https://github.com/watchandytw/multi-model-team/blob/main/workflows/team.mjs) (Team Workflow), [`src/bin/run.mjs`](https://github.com/watchandytw/multi-model-team/blob/main/src/bin/run.mjs) (Run CLI), [`workflows/reasoning.mjs`](https://github.com/watchandytw/multi-model-team/blob/main/workflows/reasoning.mjs) (Reasoning Workflow), [`src/lib/config.mjs`](https://github.com/watchandytw/multi-model-team/blob/main/src/lib/config.mjs) (Roster Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Claude Plugin"]
  node_commands["Slash Commands"]
  node_agents["Backend Agents"]
end

subgraph group_routing["Routing &amp; Config"]
  node_route_cli["Route CLI<br/>[route.mjs]"]
  node_router["Decision Engine<br/>[router.mjs]"]
  node_score["Task Scoring<br/>[score.mjs]"]
  node_config["Roster Config<br/>[config.mjs]"]
  node_roster["Roster &amp; Tags<br/>[roster.json]"]
end

subgraph group_execution["Backend Execution"]
  node_run_cli["Run CLI<br/>[run.mjs]"]
  node_backends["CLI Invokers<br/>[backends.mjs]"]
end

subgraph group_workflows["Multi-Model Workflows"]
  node_team_spec["Staffing Parser<br/>[team-spec.mjs]"]
  node_team_plan["Team Planning<br/>[team-plan.mjs]"]
  node_team_workflow["Team Workflow<br/>[team.mjs]"]
  node_team_cli["Team Dispatcher<br/>[team.mjs]"]
  node_reason_workflow["Reasoning Workflow<br/>[reasoning.mjs]"]
  node_reason_cli["Panel Dispatcher<br/>[reason.mjs]"]
end

subgraph group_hud["Status HUD"]
  node_state["HUD State<br/>[state.mjs]"]
  node_statusline["Statusline HUD<br/>[statusline.mjs]"]
end

node_user(("User"))
node_claude(("Claude Code"))
node_external_cli{{"Local CLI Backends"}}
node_native{{"Native Claude"}}

node_user -->|"submits task"| node_claude
node_claude -->|"invokes command"| node_commands
node_commands -->|"starts team"| node_team_workflow
node_commands -->|"starts reasoning"| node_reason_workflow
node_claude -->|"requests route"| node_route_cli
node_route_cli -->|"loads roster"| node_config
node_config -->|"reads"| node_roster
node_route_cli -->|"decides route"| node_router
node_router -->|"scores task"| node_score
node_router -->|"reads routing rules"| node_config
node_claude -->|"runs decision"| node_run_cli
node_run_cli -->|"loads settings"| node_config
node_run_cli -->|"checks and invokes"| node_backends
node_backends -->|"runs backend"| node_external_cli
node_run_cli -->|"hands off on fallback"| node_native
node_run_cli -->|"writes HUD state"| node_state
node_statusline -->|"reads HUD state"| node_state
node_team_workflow -->|"resolves staffing"| node_team_spec
node_team_workflow -->|"builds task plan"| node_team_plan
node_team_workflow -->|"dispatches subtasks"| node_team_cli
node_team_cli -->|"relays CLI tasks"| node_run_cli
node_team_workflow -->|"assigns workers"| node_agents
node_team_workflow -->|"uses native workers"| node_native
node_team_workflow -->|"requests review and synthesis"| node_claude
node_reason_workflow -->|"fans out panel"| node_reason_cli
node_reason_cli -->|"relays CLI panelists"| node_run_cli
node_reason_workflow -->|"dispatches panelists"| node_agents
node_reason_workflow -->|"judges and synthesizes"| node_claude

click node_commands "https://github.com/watchandytw/multi-model-team/tree/main/commands"
click node_agents "https://github.com/watchandytw/multi-model-team/tree/main/agents"
click node_route_cli "https://github.com/watchandytw/multi-model-team/blob/main/src/bin/route.mjs"
click node_router "https://github.com/watchandytw/multi-model-team/blob/main/src/lib/router.mjs"
click node_score "https://github.com/watchandytw/multi-model-team/blob/main/src/lib/score.mjs"
click node_config "https://github.com/watchandytw/multi-model-team/blob/main/src/lib/config.mjs"
click node_roster "https://github.com/watchandytw/multi-model-team/blob/main/config/roster.json"
click node_run_cli "https://github.com/watchandytw/multi-model-team/blob/main/src/bin/run.mjs"
click node_backends "https://github.com/watchandytw/multi-model-team/blob/main/src/lib/backends.mjs"
click node_team_spec "https://github.com/watchandytw/multi-model-team/blob/main/src/lib/team-spec.mjs"
click node_team_plan "https://github.com/watchandytw/multi-model-team/blob/main/src/lib/team-plan.mjs"
click node_team_workflow "https://github.com/watchandytw/multi-model-team/blob/main/workflows/team.mjs"
click node_team_cli "https://github.com/watchandytw/multi-model-team/blob/main/src/bin/team.mjs"
click node_reason_workflow "https://github.com/watchandytw/multi-model-team/blob/main/workflows/reasoning.mjs"
click node_reason_cli "https://github.com/watchandytw/multi-model-team/blob/main/src/bin/reason.mjs"
click node_state "https://github.com/watchandytw/multi-model-team/blob/main/src/lib/state.mjs"
click node_statusline "https://github.com/watchandytw/multi-model-team/blob/main/statusline/statusline.mjs"

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_commands,node_agents,node_user toneBlue
class node_route_cli,node_router,node_score,node_config,node_roster toneAmber
class node_run_cli,node_backends toneMint
class node_team_spec,node_team_plan,node_team_workflow,node_team_cli,node_reason_workflow,node_reason_cli toneRose
class node_state,node_statusline,node_claude,node_external_cli,node_native toneIndigo
```

## Components

### Claude Plugin

- [Slash Commands](https://github.com/watchandytw/multi-model-team/tree/main/commands): `commands`
- [Backend Agents](https://github.com/watchandytw/multi-model-team/tree/main/agents): `agents`

### Routing & Config

- [Route CLI](https://github.com/watchandytw/multi-model-team/blob/main/src/bin/route.mjs): `src/bin/route.mjs`
- [Decision Engine](https://github.com/watchandytw/multi-model-team/blob/main/src/lib/router.mjs): `src/lib/router.mjs`
- [Task Scoring](https://github.com/watchandytw/multi-model-team/blob/main/src/lib/score.mjs): `src/lib/score.mjs`
- [Roster Config](https://github.com/watchandytw/multi-model-team/blob/main/src/lib/config.mjs): `src/lib/config.mjs`
- [Roster & Tags](https://github.com/watchandytw/multi-model-team/blob/main/config/roster.json): `config/roster.json`

### Backend Execution

- [Run CLI](https://github.com/watchandytw/multi-model-team/blob/main/src/bin/run.mjs): `src/bin/run.mjs`
- [CLI Invokers](https://github.com/watchandytw/multi-model-team/blob/main/src/lib/backends.mjs): `src/lib/backends.mjs`

### Multi-Model Workflows

- [Staffing Parser](https://github.com/watchandytw/multi-model-team/blob/main/src/lib/team-spec.mjs): `src/lib/team-spec.mjs`
- [Team Planning](https://github.com/watchandytw/multi-model-team/blob/main/src/lib/team-plan.mjs): `src/lib/team-plan.mjs`
- [Team Workflow](https://github.com/watchandytw/multi-model-team/blob/main/workflows/team.mjs): `workflows/team.mjs`
- [Team Dispatcher](https://github.com/watchandytw/multi-model-team/blob/main/src/bin/team.mjs): `src/bin/team.mjs`
- [Reasoning Workflow](https://github.com/watchandytw/multi-model-team/blob/main/workflows/reasoning.mjs): `workflows/reasoning.mjs`
- [Panel Dispatcher](https://github.com/watchandytw/multi-model-team/blob/main/src/bin/reason.mjs): `src/bin/reason.mjs`

### Status HUD

- [HUD State](https://github.com/watchandytw/multi-model-team/blob/main/src/lib/state.mjs): `src/lib/state.mjs`
- [Statusline HUD](https://github.com/watchandytw/multi-model-team/blob/main/statusline/statusline.mjs): `statusline/statusline.mjs`

### Other components

- **User**
- **Claude Code**
- **Local CLI Backends**
- **Native Claude**

## Connections

- User → Claude Code: submits task
- Claude Code → Slash Commands: invokes command
- Slash Commands → Team Workflow: starts team
- Slash Commands → Reasoning Workflow: starts reasoning
- Claude Code → Route CLI: requests route
- Route CLI → Roster Config: loads roster
- Roster Config → Roster & Tags: reads
- Route CLI → Decision Engine: decides route
- Decision Engine → Task Scoring: scores task
- Decision Engine → Roster Config: reads routing rules
- Claude Code → Run CLI: runs decision
- Run CLI → Roster Config: loads settings
- Run CLI → CLI Invokers: checks and invokes
- CLI Invokers → Local CLI Backends: runs backend
- Run CLI → Native Claude: hands off on fallback
- Run CLI → HUD State: writes HUD state
- Statusline HUD → HUD State: reads HUD state
- Team Workflow → Staffing Parser: resolves staffing
- Team Workflow → Team Planning: builds task plan
- Team Workflow → Team Dispatcher: dispatches subtasks
- Team Dispatcher → Run CLI: relays CLI tasks
- Team Workflow → Backend Agents: assigns workers
- Team Workflow → Native Claude: uses native workers
- Team Workflow → Claude Code: requests review and synthesis
- Reasoning Workflow → Panel Dispatcher: fans out panel
- Panel Dispatcher → Run CLI: relays CLI panelists
- Reasoning Workflow → Backend Agents: dispatches panelists
- Reasoning Workflow → Claude Code: judges and synthesizes
