# szarkans/multi architecture

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

- Interactive diagram: https://gitdiagram.com/szarkans/multi
- Repository: https://github.com/szarkans/multi

## Overview

multi is an AI-agent plugin and shell/Python runtime that fans a task out to configured model backends, then presents their independent opinions. Its principal workflow is code review: select a profile, capture an immutable code snapshot, run reviewers in parallel (with a separate overengineering lens), and consolidate corroborated, disputed, checked, or dropped findings. The README also documents question answering, completion checks, and ADHD planning. Source excerpts are limited, so some runtime relationships below reflect README statements rather than inspected implementations.

Main entry points: [`scripts/ask.sh`](https://github.com/szarkans/multi/blob/main/scripts/ask.sh) (Task dispatch), [`scripts/providers.sh`](https://github.com/szarkans/multi/blob/main/scripts/providers.sh) (Backend runners), [`scripts/_vendor/tomli/_parser.py`](https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/_parser.py) (TOML parser), [`skills/code-review/SKILL.md`](https://github.com/szarkans/multi/blob/main/skills/code-review/SKILL.md) (Code review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Agent entrypoints"]
  node_review_skill["Code review<br/>[SKILL.md]"]
  node_ask_skill["Ask<br/>[SKILL.md]"]
  node_done_skill["Completion check<br/>[SKILL.md]"]
  node_adhd_skill["ADHD planning<br/>[SKILL.md]"]
  node_setup_skill["Setup guidance<br/>[SKILL.md]"]
end

subgraph group_runtime["Task runtime"]
  node_multi_runtime["Task dispatch<br/>[ask.sh]"]
  node_snapshot["Code snapshot<br/>[snapshot.sh]"]
  node_review_prompt["Review prompts<br/>[review-prompt.sh]"]
  node_backend_runner["Backend runners<br/>[providers.sh]"]
  node_opencode_report["OpenCode report<br/>[opencode-report.py]"]
  node_branch_parser["Idea parsing<br/>[parse-branch.py]"]
  node_run_storage["Run artifacts<br/>[run-dir.sh]"]
end

subgraph group_config["Backend configuration"]
  node_config_resolve["Profile resolution<br/>[config.py]"]
end

subgraph group_parsing["TOML support"]
  node_tomli_api["TOML API<br/>[__init__.py]"]
  node_toml_parser["TOML parser<br/>[_parser.py]"]
  node_toml_regex["Value parsing<br/>[_re.py]"]
  node_toml_types["Parser types<br/>[_types.py]"]
end

node_user(("Developer"))
node_model_services{{"AI backends"}}
node_ponytail{{"Overengineering lens"}}

node_user -->|"requests review"| node_review_skill
node_user -->|"asks question"| node_ask_skill
node_user -->|"checks completion"| node_done_skill
node_user -->|"requests planning"| node_adhd_skill
node_review_skill -.->|"invokes task"| node_multi_runtime
node_ask_skill -.->|"invokes task"| node_multi_runtime
node_done_skill -.->|"invokes task"| node_multi_runtime
node_adhd_skill -.->|"invokes task"| node_multi_runtime
node_multi_runtime -->|"resolves profile"| node_config_resolve
node_config_resolve -->|"parses config"| node_tomli_api
node_tomli_api -->|"exports parser"| node_toml_parser
node_toml_parser -->|"uses patterns"| node_toml_regex
node_toml_parser -->|"uses types"| node_toml_types
node_toml_regex -->|"uses types"| node_toml_types
node_multi_runtime -->|"captures snapshot"| node_snapshot
node_multi_runtime -.->|"prepares review"| node_review_prompt
node_multi_runtime -->|"runs in parallel"| node_backend_runner
node_backend_runner -->|"queries models"| node_model_services
node_multi_runtime -->|"runs separate lens"| node_ponytail
node_backend_runner -.->|"formats output"| node_opencode_report
node_multi_runtime -.->|"parses planning output"| node_branch_parser
node_multi_runtime -.->|"stores run artifacts"| node_run_storage

click node_review_skill "https://github.com/szarkans/multi/blob/main/skills/code-review/SKILL.md"
click node_ask_skill "https://github.com/szarkans/multi/blob/main/skills/ask/SKILL.md"
click node_done_skill "https://github.com/szarkans/multi/blob/main/skills/check-if-done/SKILL.md"
click node_adhd_skill "https://github.com/szarkans/multi/blob/main/skills/adhd/SKILL.md"
click node_setup_skill "https://github.com/szarkans/multi/blob/main/skills/setup/SKILL.md"
click node_multi_runtime "https://github.com/szarkans/multi/blob/main/scripts/ask.sh"
click node_config_resolve "https://github.com/szarkans/multi/blob/main/scripts/config.py"
click node_snapshot "https://github.com/szarkans/multi/blob/main/scripts/snapshot.sh"
click node_review_prompt "https://github.com/szarkans/multi/blob/main/scripts/review-prompt.sh"
click node_backend_runner "https://github.com/szarkans/multi/blob/main/scripts/providers.sh"
click node_opencode_report "https://github.com/szarkans/multi/blob/main/scripts/opencode-report.py"
click node_branch_parser "https://github.com/szarkans/multi/blob/main/scripts/parse-branch.py"
click node_run_storage "https://github.com/szarkans/multi/blob/main/scripts/run-dir.sh"
click node_tomli_api "https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/__init__.py"
click node_toml_parser "https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/_parser.py"
click node_toml_regex "https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/_re.py"
click node_toml_types "https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/_types.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_review_skill,node_ask_skill,node_done_skill,node_adhd_skill,node_setup_skill toneBlue
class node_multi_runtime,node_snapshot,node_review_prompt,node_backend_runner,node_opencode_report,node_branch_parser,node_run_storage toneAmber
class node_config_resolve toneMint
class node_tomli_api,node_toml_parser,node_toml_regex,node_toml_types toneRose
class node_user,node_model_services,node_ponytail toneIndigo
```

## Components

### Agent entrypoints

- [Code review](https://github.com/szarkans/multi/blob/main/skills/code-review/SKILL.md): `skills/code-review/SKILL.md`
- [Ask](https://github.com/szarkans/multi/blob/main/skills/ask/SKILL.md): `skills/ask/SKILL.md`
- [Completion check](https://github.com/szarkans/multi/blob/main/skills/check-if-done/SKILL.md): `skills/check-if-done/SKILL.md`
- [ADHD planning](https://github.com/szarkans/multi/blob/main/skills/adhd/SKILL.md): `skills/adhd/SKILL.md`
- [Setup guidance](https://github.com/szarkans/multi/blob/main/skills/setup/SKILL.md): `skills/setup/SKILL.md`

### Task runtime

- [Task dispatch](https://github.com/szarkans/multi/blob/main/scripts/ask.sh): `scripts/ask.sh`
- [Code snapshot](https://github.com/szarkans/multi/blob/main/scripts/snapshot.sh): `scripts/snapshot.sh`
- [Review prompts](https://github.com/szarkans/multi/blob/main/scripts/review-prompt.sh): `scripts/review-prompt.sh`
- [Backend runners](https://github.com/szarkans/multi/blob/main/scripts/providers.sh): `scripts/providers.sh`
- [OpenCode report](https://github.com/szarkans/multi/blob/main/scripts/opencode-report.py): `scripts/opencode-report.py`
- [Idea parsing](https://github.com/szarkans/multi/blob/main/scripts/parse-branch.py): `scripts/parse-branch.py`
- [Run artifacts](https://github.com/szarkans/multi/blob/main/scripts/run-dir.sh): `scripts/run-dir.sh`

### Backend configuration

- [Profile resolution](https://github.com/szarkans/multi/blob/main/scripts/config.py): `scripts/config.py`

### TOML support

- [TOML API](https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/__init__.py): `scripts/_vendor/tomli/__init__.py`
- [TOML parser](https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/_parser.py): `scripts/_vendor/tomli/_parser.py`
- [Value parsing](https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/_re.py): `scripts/_vendor/tomli/_re.py`
- [Parser types](https://github.com/szarkans/multi/blob/main/scripts/_vendor/tomli/_types.py): `scripts/_vendor/tomli/_types.py`

### Other components

- **Developer**
- **AI backends**
- **Overengineering lens**

## Connections

- Developer → Code review: requests review (evidence: `README.md`)
- Developer → Ask: asks question (evidence: `README.md`)
- Developer → Completion check: checks completion (evidence: `README.md`)
- Developer → ADHD planning: requests planning (evidence: `README.md`)
- Code review → Task dispatch: invokes task
- Ask → Task dispatch: invokes task
- Completion check → Task dispatch: invokes task
- ADHD planning → Task dispatch: invokes task
- Task dispatch → Profile resolution: resolves profile (evidence: `scripts/config.py`)
- Profile resolution → TOML API: parses config (evidence: `scripts/config.py`)
- TOML API → TOML parser: exports parser (evidence: `scripts/_vendor/tomli/__init__.py`)
- TOML parser → Value parsing: uses patterns (evidence: `scripts/_vendor/tomli/_parser.py`)
- TOML parser → Parser types: uses types (evidence: `scripts/_vendor/tomli/_parser.py`)
- Value parsing → Parser types: uses types (evidence: `scripts/_vendor/tomli/_re.py`)
- Task dispatch → Code snapshot: captures snapshot (evidence: `README.md`)
- Task dispatch → Review prompts: prepares review
- Task dispatch → Backend runners: runs in parallel (evidence: `README.md`)
- Backend runners → AI backends: queries models (evidence: `README.md`)
- Task dispatch → Overengineering lens: runs separate lens (evidence: `README.md`)
- Backend runners → OpenCode report: formats output
- Task dispatch → Idea parsing: parses planning output
- Task dispatch → Run artifacts: stores run artifacts
