# scanaislop/aislop architecture

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

- Interactive diagram: https://gitdiagram.com/scanaislop/aislop
- Repository: https://github.com/scanaislop/aislop

## Overview

aislop is a deterministic, multi-language code-quality scanner and repair CLI. Its main workflow selects project files, runs enabled analysis engines, scores findings, and reports them; the documented fix command applies mechanical changes. Other product surfaces include coding-agent repair, editor hooks, MCP tools, configuration, and editor integration. The sampled source confirms engine orchestration, scoring, configuration, and fix-step behavior; links for unsampled command and integration internals are limited to relationships supported by the README and module layout.

Main entry points: [`src/commands/scan.ts`](https://github.com/scanaislop/aislop/blob/main/src/commands/scan.ts) (Scan Command), [`src/cli.ts`](https://github.com/scanaislop/aislop/blob/main/src/cli.ts) (CLI Dispatcher), [`src/commands/scan-engine-runner.ts`](https://github.com/scanaislop/aislop/blob/main/src/commands/scan-engine-runner.ts) (Engine Runner), [`src/engines/orchestrator.ts`](https://github.com/scanaislop/aislop/blob/main/src/engines/orchestrator.ts) (Engine Orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and Config"]
  node_cli["CLI Dispatcher<br/>[cli.ts]"]
  node_config["Config Loader<br/>[index.ts]"]
end

subgraph group_analysis["Scan and Analysis"]
  node_scan["Scan Command<br/>[scan.ts]"]
  node_discovery["Project Discovery<br/>[discover.ts]"]
  node_coverage["Language Coverage"]
  node_selection["Source Selection"]
  node_scanrunner["Engine Runner"]
  node_orchestrator["Engine Orchestrator<br/>[orchestrator.ts]"]
  node_engines["Analysis Engines"]
end

subgraph group_repair["Automated Repair"]
  node_fix["Fix Command<br/>[fix.ts]"]
  node_fixpipeline["Fix Pipeline<br/>[fix-pipeline.ts]"]
  node_formatpipeline["Formatting Steps"]
end

subgraph group_integrations["Agent Integrations"]
  node_agent["Agent Repair<br/>[agent.ts]"]
  node_agentsession["Agent Sessions<br/>[session.ts]"]
  node_hooks["Editor Hooks"]
  node_mcp["MCP Server<br/>[mcp.ts]"]
  node_vscode["VS Code Extension<br/>[extension.ts]"]
end

subgraph group_reporting["Results and State"]
  node_scoring["Score Calculator<br/>[index.ts]"]
  node_output["Scan Report Formats"]
  node_telemetry["Telemetry<br/>[client.ts]"]
end

node_user(("Developer"))

node_user -->|"runs command"| node_cli
node_cli -->|"loads settings"| node_config
node_cli -->|"dispatches scan"| node_scan
node_cli -->|"dispatches fix"| node_fix
node_scan -->|"discovers project"| node_discovery
node_scan -->|"checks coverage"| node_coverage
node_scan -->|"selects files"| node_selection
node_scan -->|"runs analysis"| node_scanrunner
node_scanrunner -->|"runs engines"| node_orchestrator
node_orchestrator -->|"dispatches checks"| node_engines
node_scan -->|"scores findings"| node_scoring
node_scan -->|"renders results"| node_output
node_fix -->|"runs fix steps"| node_fixpipeline
node_fixpipeline -->|"runs formatting"| node_formatpipeline
node_cli -->|"dispatches agent"| node_agent
node_agent -->|"manages sessions"| node_agentsession
node_cli -->|"dispatches hooks"| node_hooks
node_cli -->|"starts server"| node_mcp
node_user -.->|"uses editor"| node_vscode
node_scan -.->|"reports events"| node_telemetry

click node_cli "https://github.com/scanaislop/aislop/blob/main/src/cli.ts"
click node_config "https://github.com/scanaislop/aislop/blob/main/src/config/index.ts"
click node_scan "https://github.com/scanaislop/aislop/blob/main/src/commands/scan.ts"
click node_discovery "https://github.com/scanaislop/aislop/blob/main/src/utils/discover.ts"
click node_coverage "https://github.com/scanaislop/aislop/blob/main/src/utils/discovery-coverage.ts"
click node_selection "https://github.com/scanaislop/aislop/blob/main/src/utils/source-file-selection.ts"
click node_scanrunner "https://github.com/scanaislop/aislop/blob/main/src/commands/scan-engine-runner.ts"
click node_orchestrator "https://github.com/scanaislop/aislop/blob/main/src/engines/orchestrator.ts"
click node_engines "https://github.com/scanaislop/aislop/tree/main/src/engines"
click node_scoring "https://github.com/scanaislop/aislop/blob/main/src/scoring/index.ts"
click node_output "https://github.com/scanaislop/aislop/tree/main/src/output"
click node_fix "https://github.com/scanaislop/aislop/blob/main/src/commands/fix.ts"
click node_fixpipeline "https://github.com/scanaislop/aislop/blob/main/src/commands/fix-pipeline.ts"
click node_formatpipeline "https://github.com/scanaislop/aislop/blob/main/src/commands/fix-formatting-pipeline.ts"
click node_agent "https://github.com/scanaislop/aislop/blob/main/src/commands/agent.ts"
click node_agentsession "https://github.com/scanaislop/aislop/blob/main/src/agents/session.ts"
click node_hooks "https://github.com/scanaislop/aislop/tree/main/src/hooks"
click node_mcp "https://github.com/scanaislop/aislop/blob/main/src/mcp.ts"
click node_vscode "https://github.com/scanaislop/aislop/blob/main/editors/vscode/src/extension.ts"
click node_telemetry "https://github.com/scanaislop/aislop/blob/main/src/telemetry/client.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_cli,node_config toneBlue
class node_scan,node_discovery,node_coverage,node_selection,node_scanrunner,node_orchestrator,node_engines toneAmber
class node_fix,node_fixpipeline,node_formatpipeline toneMint
class node_agent,node_agentsession,node_hooks,node_mcp,node_vscode toneRose
class node_scoring,node_output,node_telemetry,node_user toneIndigo
```

## Components

### CLI and Config

- [CLI Dispatcher](https://github.com/scanaislop/aislop/blob/main/src/cli.ts): `src/cli.ts`
- [Config Loader](https://github.com/scanaislop/aislop/blob/main/src/config/index.ts): `src/config/index.ts`

### Scan and Analysis

- [Scan Command](https://github.com/scanaislop/aislop/blob/main/src/commands/scan.ts): `src/commands/scan.ts`
- [Project Discovery](https://github.com/scanaislop/aislop/blob/main/src/utils/discover.ts): `src/utils/discover.ts`
- [Language Coverage](https://github.com/scanaislop/aislop/blob/main/src/utils/discovery-coverage.ts): `src/utils/discovery-coverage.ts`
- [Source Selection](https://github.com/scanaislop/aislop/blob/main/src/utils/source-file-selection.ts): `src/utils/source-file-selection.ts`
- [Engine Runner](https://github.com/scanaislop/aislop/blob/main/src/commands/scan-engine-runner.ts): `src/commands/scan-engine-runner.ts`
- [Engine Orchestrator](https://github.com/scanaislop/aislop/blob/main/src/engines/orchestrator.ts): `src/engines/orchestrator.ts`
- [Analysis Engines](https://github.com/scanaislop/aislop/tree/main/src/engines): `src/engines`

### Automated Repair

- [Fix Command](https://github.com/scanaislop/aislop/blob/main/src/commands/fix.ts): `src/commands/fix.ts`
- [Fix Pipeline](https://github.com/scanaislop/aislop/blob/main/src/commands/fix-pipeline.ts): `src/commands/fix-pipeline.ts`
- [Formatting Steps](https://github.com/scanaislop/aislop/blob/main/src/commands/fix-formatting-pipeline.ts): `src/commands/fix-formatting-pipeline.ts`

### Agent Integrations

- [Agent Repair](https://github.com/scanaislop/aislop/blob/main/src/commands/agent.ts): `src/commands/agent.ts`
- [Agent Sessions](https://github.com/scanaislop/aislop/blob/main/src/agents/session.ts): `src/agents/session.ts`
- [Editor Hooks](https://github.com/scanaislop/aislop/tree/main/src/hooks): `src/hooks`
- [MCP Server](https://github.com/scanaislop/aislop/blob/main/src/mcp.ts): `src/mcp.ts`
- [VS Code Extension](https://github.com/scanaislop/aislop/blob/main/editors/vscode/src/extension.ts): `editors/vscode/src/extension.ts`

### Results and State

- [Score Calculator](https://github.com/scanaislop/aislop/blob/main/src/scoring/index.ts): `src/scoring/index.ts`
- [Scan Report Formats](https://github.com/scanaislop/aislop/tree/main/src/output): `src/output`
- [Telemetry](https://github.com/scanaislop/aislop/blob/main/src/telemetry/client.ts): `src/telemetry/client.ts`

### Other components

- **Developer**

## Connections

- Developer → CLI Dispatcher: runs command
- CLI Dispatcher → Config Loader: loads settings
- CLI Dispatcher → Scan Command: dispatches scan
- CLI Dispatcher → Fix Command: dispatches fix
- Scan Command → Project Discovery: discovers project
- Scan Command → Language Coverage: checks coverage
- Scan Command → Source Selection: selects files
- Scan Command → Engine Runner: runs analysis
- Engine Runner → Engine Orchestrator: runs engines
- Engine Orchestrator → Analysis Engines: dispatches checks
- Scan Command → Score Calculator: scores findings
- Scan Command → Scan Report Formats: renders results
- Fix Command → Fix Pipeline: runs fix steps
- Fix Pipeline → Formatting Steps: runs formatting
- CLI Dispatcher → Agent Repair: dispatches agent
- Agent Repair → Agent Sessions: manages sessions
- CLI Dispatcher → Editor Hooks: dispatches hooks
- CLI Dispatcher → MCP Server: starts server
- Developer → VS Code Extension: uses editor
- Scan Command → Telemetry: reports events
