# iliaim/aivv architecture

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

- Interactive diagram: https://gitdiagram.com/iliaim/aivv
- Repository: https://github.com/iliaim/aivv

## Overview

AIVV is an agent plugin for independent, read-only review of code and other artifacts, followed by gated investigation and remediation. Users invoke a review, which assembles a cold prompt and dispatches independent reviewers; findings can then be investigated, validated before changes, and recorded. Separate capabilities support calibration, viewing records, and incident lifecycle/GitHub sync. The main workflow is documented in the README; internal edges below are limited to relationships visible in the supplied excerpts or SOURCE INDEX, so unsampled skill behavior is represented without speculative call chains.

Main entry points: [`plugin/tools/aivv-prompt-bundle.mjs`](https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-prompt-bundle.mjs) (Prompt assembly), [`plugin/skills/aivv-fix/SKILL.md`](https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-fix/SKILL.md) (Fix command), [`plugin/tools/incident-state.mjs`](https://github.com/iliaim/aivv/blob/main/plugin/tools/incident-state.mjs) (Incident state), [`plugin/tools/storage-paths.mjs`](https://github.com/iliaim/aivv/blob/main/plugin/tools/storage-paths.mjs) (Storage paths)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_review["Review workflow"]
  node_review_skill["Review command<br/>[SKILL.md]"]
  node_prompt_bundle["Prompt assembly"]
  node_dispatch["Reviewer dispatch<br/>[dispatch.mjs]"]
end

subgraph group_remediation["Fix and safety"]
  node_fix_skill["Fix command<br/>[SKILL.md]"]
  node_investigation["Finding investigation"]
  node_fix_records["Fix record generation"]
  node_write_gate["Pre-write validation"]
  node_runtime_evidence["Runtime evidence"]
  node_action_inbox["Action inbox"]
end

subgraph group_state["Records and state"]
  node_state[("Incident state<br/>[incident-state.mjs]")]
  node_storage["Storage paths<br/>[storage-paths.mjs]"]
  node_state_import["State import<br/>[state-import.mjs]"]
  node_lifecycle["Lifecycle routing"]
  node_github_sync["GitHub issue sync"]
  node_view_skill["View command<br/>[SKILL.md]"]
  node_view_storage["Record storage<br/>[storage.mjs]"]
  node_view_report["Report rendering<br/>[report.js]"]
end

subgraph group_support["Configuration and standards"]
  node_provider_catalog["Provider registry"]
  node_model_selection["Model selection"]
  node_provider_trust["Provider trust<br/>[provider-trust.mjs]"]
  node_calibrate["Calibration<br/>[aivv-calibrate.mjs]"]
  node_standards["Standards lookup"]
end

node_user(("Developer"))
node_reviewers(("Reviewer agents"))

node_user -->|"invokes review"| node_review_skill
node_review_skill -.->|"assembles request"| node_prompt_bundle
node_prompt_bundle -->|"supplies prompt"| node_dispatch
node_dispatch -->|"dispatches review"| node_reviewers
node_dispatch -->|"writes trust memory"| node_provider_trust
node_prompt_bundle -->|"gets provider"| node_provider_catalog
node_prompt_bundle -->|"resolves model"| node_model_selection
node_user -->|"invokes remediation"| node_fix_skill
node_fix_skill -->|"investigates findings"| node_investigation
node_fix_skill -->|"produces records"| node_fix_records
node_fix_skill -->|"gates changes"| node_write_gate
node_write_gate -->|"validates evidence"| node_runtime_evidence
node_fix_records -->|"prepares write intent"| node_write_gate
node_action_inbox -->|"uses storage paths"| node_storage
node_action_inbox -->|"checks imports"| node_state_import
node_state -->|"resolves storage"| node_storage
node_state -->|"checks visibility"| node_state_import
node_lifecycle -->|"routes lifecycle"| node_state
node_github_sync -->|"validates issues"| node_state
node_github_sync -->|"locks storage"| node_storage
node_github_sync -->|"checks visibility"| node_state_import
node_user -->|"calibrates project"| node_calibrate
node_calibrate -->|"reads storage"| node_storage
node_calibrate -->|"checks import status"| node_state_import
node_user -->|"views records"| node_view_skill
node_view_skill -.->|"loads records"| node_view_storage
node_view_skill -.->|"renders report"| node_view_report

click node_review_skill "https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv/SKILL.md"
click node_prompt_bundle "https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-prompt-bundle.mjs"
click node_dispatch "https://github.com/iliaim/aivv/blob/main/plugin/tools/dispatch.mjs"
click node_provider_catalog "https://github.com/iliaim/aivv/blob/main/plugin/tools/provider-registry.mjs"
click node_model_selection "https://github.com/iliaim/aivv/blob/main/plugin/tools/model-selection.mjs"
click node_provider_trust "https://github.com/iliaim/aivv/blob/main/plugin/tools/provider-trust.mjs"
click node_calibrate "https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-calibrate.mjs"
click node_standards "https://github.com/iliaim/aivv/blob/main/plugin/tools/standards-lookup.mjs"
click node_fix_skill "https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-fix/SKILL.md"
click node_investigation "https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-fix/references/investigation-dispatch.md"
click node_fix_records "https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-fix-records.mjs"
click node_write_gate "https://github.com/iliaim/aivv/blob/main/plugin/tools/pre-write-validator.mjs"
click node_runtime_evidence "https://github.com/iliaim/aivv/blob/main/plugin/tools/runtime-evidence.mjs"
click node_action_inbox "https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-action-inbox.mjs"
click node_state "https://github.com/iliaim/aivv/blob/main/plugin/tools/incident-state.mjs"
click node_storage "https://github.com/iliaim/aivv/blob/main/plugin/tools/storage-paths.mjs"
click node_state_import "https://github.com/iliaim/aivv/blob/main/plugin/tools/state-import.mjs"
click node_lifecycle "https://github.com/iliaim/aivv/blob/main/plugin/tools/incident-lifecycle-route.mjs"
click node_github_sync "https://github.com/iliaim/aivv/blob/main/plugin/tools/incident-github-sync.mjs"
click node_view_skill "https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-view/SKILL.md"
click node_view_storage "https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-view/scripts/storage.mjs"
click node_view_report "https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-view/templates/report.js"

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_prompt_bundle,node_dispatch,node_reviewers toneBlue
class node_fix_skill,node_investigation,node_fix_records,node_write_gate,node_runtime_evidence,node_action_inbox toneAmber
class node_state,node_storage,node_state_import,node_lifecycle,node_github_sync,node_view_skill,node_view_storage,node_view_report toneMint
class node_provider_catalog,node_model_selection,node_provider_trust,node_calibrate,node_standards toneRose
class node_user toneIndigo
```

## Components

### Review workflow

- [Review command](https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv/SKILL.md): `plugin/skills/aivv/SKILL.md`
- [Prompt assembly](https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-prompt-bundle.mjs): `plugin/tools/aivv-prompt-bundle.mjs`
- [Reviewer dispatch](https://github.com/iliaim/aivv/blob/main/plugin/tools/dispatch.mjs): `plugin/tools/dispatch.mjs`

### Fix and safety

- [Fix command](https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-fix/SKILL.md): `plugin/skills/aivv-fix/SKILL.md`
- [Finding investigation](https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-fix/references/investigation-dispatch.md): `plugin/skills/aivv-fix/references/investigation-dispatch.md`
- [Fix record generation](https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-fix-records.mjs): `plugin/tools/aivv-fix-records.mjs`
- [Pre-write validation](https://github.com/iliaim/aivv/blob/main/plugin/tools/pre-write-validator.mjs): `plugin/tools/pre-write-validator.mjs`
- [Runtime evidence](https://github.com/iliaim/aivv/blob/main/plugin/tools/runtime-evidence.mjs): `plugin/tools/runtime-evidence.mjs`
- [Action inbox](https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-action-inbox.mjs): `plugin/tools/aivv-action-inbox.mjs`

### Records and state

- [Incident state](https://github.com/iliaim/aivv/blob/main/plugin/tools/incident-state.mjs): `plugin/tools/incident-state.mjs`
- [Storage paths](https://github.com/iliaim/aivv/blob/main/plugin/tools/storage-paths.mjs): `plugin/tools/storage-paths.mjs`
- [State import](https://github.com/iliaim/aivv/blob/main/plugin/tools/state-import.mjs): `plugin/tools/state-import.mjs`
- [Lifecycle routing](https://github.com/iliaim/aivv/blob/main/plugin/tools/incident-lifecycle-route.mjs): `plugin/tools/incident-lifecycle-route.mjs`
- [GitHub issue sync](https://github.com/iliaim/aivv/blob/main/plugin/tools/incident-github-sync.mjs): `plugin/tools/incident-github-sync.mjs`
- [View command](https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-view/SKILL.md): `plugin/skills/aivv-view/SKILL.md`
- [Record storage](https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-view/scripts/storage.mjs): `plugin/skills/aivv-view/scripts/storage.mjs`
- [Report rendering](https://github.com/iliaim/aivv/blob/main/plugin/skills/aivv-view/templates/report.js): `plugin/skills/aivv-view/templates/report.js`

### Configuration and standards

- [Provider registry](https://github.com/iliaim/aivv/blob/main/plugin/tools/provider-registry.mjs): `plugin/tools/provider-registry.mjs`
- [Model selection](https://github.com/iliaim/aivv/blob/main/plugin/tools/model-selection.mjs): `plugin/tools/model-selection.mjs`
- [Provider trust](https://github.com/iliaim/aivv/blob/main/plugin/tools/provider-trust.mjs): `plugin/tools/provider-trust.mjs`
- [Calibration](https://github.com/iliaim/aivv/blob/main/plugin/tools/aivv-calibrate.mjs): `plugin/tools/aivv-calibrate.mjs`
- [Standards lookup](https://github.com/iliaim/aivv/blob/main/plugin/tools/standards-lookup.mjs): `plugin/tools/standards-lookup.mjs`

### Other components

- **Developer**
- **Reviewer agents**

## Connections

- Developer → Review command: invokes review (evidence: `README.md`)
- Review command → Prompt assembly: assembles request
- Prompt assembly → Reviewer dispatch: supplies prompt (evidence: `README.md`)
- Reviewer dispatch → Reviewer agents: dispatches review (evidence: `README.md`)
- Reviewer dispatch → Provider trust: writes trust memory (evidence: `plugin/tools/dispatch.mjs`)
- Prompt assembly → Provider registry: gets provider (evidence: `plugin/tools/aivv-prompt-bundle.mjs`)
- Prompt assembly → Model selection: resolves model (evidence: `plugin/tools/aivv-prompt-bundle.mjs`)
- Developer → Fix command: invokes remediation (evidence: `README.md`)
- Fix command → Finding investigation: investigates findings (evidence: `README.md`)
- Fix command → Fix record generation: produces records (evidence: `plugin/tools/aivv-fix-records.mjs`)
- Fix command → Pre-write validation: gates changes (evidence: `README.md`)
- Pre-write validation → Runtime evidence: validates evidence (evidence: `plugin/tools/pre-write-validator.mjs`)
- Fix record generation → Pre-write validation: prepares write intent (evidence: `plugin/tools/aivv-fix-records.mjs`)
- Action inbox → Storage paths: uses storage paths (evidence: `plugin/tools/aivv-action-inbox.mjs`)
- Action inbox → State import: checks imports (evidence: `plugin/tools/aivv-action-inbox.mjs`)
- Incident state → Storage paths: resolves storage (evidence: `plugin/tools/incident-state.mjs`)
- Incident state → State import: checks visibility (evidence: `plugin/tools/incident-state.mjs`)
- Lifecycle routing → Incident state: routes lifecycle (evidence: `plugin/tools/incident-lifecycle-route.mjs`)
- GitHub issue sync → Incident state: validates issues (evidence: `plugin/tools/incident-github-sync.mjs`)
- GitHub issue sync → Storage paths: locks storage (evidence: `plugin/tools/incident-github-sync.mjs`)
- GitHub issue sync → State import: checks visibility (evidence: `plugin/tools/incident-github-sync.mjs`)
- Developer → Calibration: calibrates project (evidence: `README.md`)
- Calibration → Storage paths: reads storage (evidence: `plugin/tools/aivv-calibrate.mjs`)
- Calibration → State import: checks import status (evidence: `plugin/tools/aivv-calibrate.mjs`)
- Developer → View command: views records (evidence: `README.md`)
- View command → Record storage: loads records
- View command → Report rendering: renders report
