# houseofmvps/codesight architecture

> Architecture diagram of the GitHub repository houseofmvps/codesight, 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/houseofmvps/codesight
- Repository: https://github.com/houseofmvps/codesight

## Overview

Codesight scans a project to build compact structural context for AI coding tools. Its main workflow is project discovery, language/framework-aware extraction and detection, then formatting that context as reports, configuration, or wiki articles; developers can also query it through MCP. Separate capabilities map Markdown knowledge, inspect monorepos, and enrich scans with plugins or opt-in native AST parsers. The README documents these product branches, but sampled excerpts do not show the full detector orchestration or MCP dispatch, so those internal links are not expanded.

Main entry points: [`src/index.ts`](https://github.com/houseofmvps/codesight/blob/main/src/index.ts) (CLI Entry), [`src/core.ts`](https://github.com/houseofmvps/codesight/blob/main/src/core.ts) (Scan Orchestrator), [`src/scanner.ts`](https://github.com/houseofmvps/codesight/blob/main/src/scanner.ts) (File Scanner), [`src/plugins/index.ts`](https://github.com/houseofmvps/codesight/blob/main/src/plugins/index.ts) (Built-in Plugins)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Project Analysis"]
  node_core["Scan Orchestrator<br/>[core.ts]"]
  node_scanner["File Scanner<br/>[scanner.ts]"]
  node_routes["Route Detection<br/>[routes.ts]"]
  node_routeast["Route AST<br/>[extract-routes.ts]"]
  node_schema["Schema Detection<br/>[schema.ts]"]
  node_components["Component Detection<br/>[components.ts]"]
  node_graph["Dependency Graph<br/>[graph.ts]"]
  node_coverage["Test Coverage<br/>[coverage.ts]"]
end

subgraph group_extensions["Analysis Extensions"]
  node_wasm["Native AST Host<br/>[plugin-host.ts]"]
  node_plugins["Built-in Plugins<br/>[index.ts]"]
  node_terraform["Terraform Plugin<br/>[index.ts]"]
end

subgraph group_outputs["Context Outputs"]
  node_formatter["Context Formatter<br/>[formatter.ts]"]
  node_wiki["Wiki Generator<br/>[wiki.ts]"]
  node_html["HTML Report<br/>[html-report.ts]"]
  node_configs["AI Config Generator<br/>[ai-config.ts]"]
  node_monorepo["Monorepo Scan<br/>[orchestrator.ts]"]
end

subgraph group_interfaces["User Interfaces"]
  node_index["CLI Entry<br/>[index.ts]"]
  node_mcp["MCP Server<br/>[mcp-server.ts]"]
end

subgraph group_knowledge["Knowledge Mapping"]
  node_knowledge["Knowledge Detector<br/>[knowledge.ts]"]
end

node_developer(("Developer"))
node_project["Project Files"]
node_ai(("AI Coding Tool"))

node_developer -->|"runs"| node_index
node_project -->|"provides files"| node_scanner
node_index -->|"starts scan"| node_core
node_index -->|"collects notes"| node_scanner
node_index -->|"analyzes notes"| node_knowledge
node_index -->|"writes knowledge map"| node_formatter
node_core -->|"scans files"| node_scanner
node_routes -->|"uses AST extraction"| node_routeast
node_core -.->|"loads native plugins"| node_wasm
node_core -->|"loads extensions"| node_plugins
node_plugins -.->|"exports opt-in"| node_terraform
node_index -->|"generates wiki"| node_wiki
node_index -->|"generates configs"| node_configs
node_index -->|"generates report"| node_html
node_index -->|"starts server"| node_mcp
node_monorepo -->|"scans packages"| node_core
node_formatter -->|"provides context"| node_ai
node_wiki -->|"provides articles"| node_ai
node_configs -->|"provides instructions"| node_ai
node_html -->|"shows report"| node_developer
node_mcp -->|"serves tools"| node_ai

click node_index "https://github.com/houseofmvps/codesight/blob/main/src/index.ts"
click node_core "https://github.com/houseofmvps/codesight/blob/main/src/core.ts"
click node_scanner "https://github.com/houseofmvps/codesight/blob/main/src/scanner.ts"
click node_routes "https://github.com/houseofmvps/codesight/blob/main/src/detectors/routes.ts"
click node_routeast "https://github.com/houseofmvps/codesight/blob/main/src/ast/extract-routes.ts"
click node_schema "https://github.com/houseofmvps/codesight/blob/main/src/detectors/schema.ts"
click node_components "https://github.com/houseofmvps/codesight/blob/main/src/detectors/components.ts"
click node_graph "https://github.com/houseofmvps/codesight/blob/main/src/detectors/graph.ts"
click node_coverage "https://github.com/houseofmvps/codesight/blob/main/src/detectors/coverage.ts"
click node_wasm "https://github.com/houseofmvps/codesight/blob/main/src/wasm/plugin-host.ts"
click node_plugins "https://github.com/houseofmvps/codesight/blob/main/src/plugins/index.ts"
click node_terraform "https://github.com/houseofmvps/codesight/blob/main/src/plugins/terraform/index.ts"
click node_formatter "https://github.com/houseofmvps/codesight/blob/main/src/formatter.ts"
click node_wiki "https://github.com/houseofmvps/codesight/blob/main/src/generators/wiki.ts"
click node_html "https://github.com/houseofmvps/codesight/blob/main/src/generators/html-report.ts"
click node_configs "https://github.com/houseofmvps/codesight/blob/main/src/generators/ai-config.ts"
click node_monorepo "https://github.com/houseofmvps/codesight/blob/main/src/monorepo/orchestrator.ts"
click node_knowledge "https://github.com/houseofmvps/codesight/blob/main/src/detectors/knowledge.ts"
click node_mcp "https://github.com/houseofmvps/codesight/blob/main/src/mcp-server.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_core,node_scanner,node_routes,node_routeast,node_schema,node_components,node_graph,node_coverage toneBlue
class node_wasm,node_plugins,node_terraform toneAmber
class node_formatter,node_wiki,node_html,node_configs,node_monorepo toneMint
class node_index,node_mcp toneRose
class node_knowledge,node_developer,node_project,node_ai toneIndigo
```

## Components

### Project Analysis

- [Scan Orchestrator](https://github.com/houseofmvps/codesight/blob/main/src/core.ts): `src/core.ts`
- [File Scanner](https://github.com/houseofmvps/codesight/blob/main/src/scanner.ts): `src/scanner.ts`
- [Route Detection](https://github.com/houseofmvps/codesight/blob/main/src/detectors/routes.ts): `src/detectors/routes.ts`
- [Route AST](https://github.com/houseofmvps/codesight/blob/main/src/ast/extract-routes.ts): `src/ast/extract-routes.ts`
- [Schema Detection](https://github.com/houseofmvps/codesight/blob/main/src/detectors/schema.ts): `src/detectors/schema.ts`
- [Component Detection](https://github.com/houseofmvps/codesight/blob/main/src/detectors/components.ts): `src/detectors/components.ts`
- [Dependency Graph](https://github.com/houseofmvps/codesight/blob/main/src/detectors/graph.ts): `src/detectors/graph.ts`
- [Test Coverage](https://github.com/houseofmvps/codesight/blob/main/src/detectors/coverage.ts): `src/detectors/coverage.ts`

### Analysis Extensions

- [Native AST Host](https://github.com/houseofmvps/codesight/blob/main/src/wasm/plugin-host.ts): `src/wasm/plugin-host.ts`
- [Built-in Plugins](https://github.com/houseofmvps/codesight/blob/main/src/plugins/index.ts): `src/plugins/index.ts`
- [Terraform Plugin](https://github.com/houseofmvps/codesight/blob/main/src/plugins/terraform/index.ts): `src/plugins/terraform/index.ts`

### Context Outputs

- [Context Formatter](https://github.com/houseofmvps/codesight/blob/main/src/formatter.ts): `src/formatter.ts`
- [Wiki Generator](https://github.com/houseofmvps/codesight/blob/main/src/generators/wiki.ts): `src/generators/wiki.ts`
- [HTML Report](https://github.com/houseofmvps/codesight/blob/main/src/generators/html-report.ts): `src/generators/html-report.ts`
- [AI Config Generator](https://github.com/houseofmvps/codesight/blob/main/src/generators/ai-config.ts): `src/generators/ai-config.ts`
- [Monorepo Scan](https://github.com/houseofmvps/codesight/blob/main/src/monorepo/orchestrator.ts): `src/monorepo/orchestrator.ts`

### User Interfaces

- [CLI Entry](https://github.com/houseofmvps/codesight/blob/main/src/index.ts): `src/index.ts`
- [MCP Server](https://github.com/houseofmvps/codesight/blob/main/src/mcp-server.ts): `src/mcp-server.ts`

### Knowledge Mapping

- [Knowledge Detector](https://github.com/houseofmvps/codesight/blob/main/src/detectors/knowledge.ts): `src/detectors/knowledge.ts`

### Other components

- **Developer**
- **Project Files**
- **AI Coding Tool**

## Connections

- Developer → CLI Entry: runs
- Project Files → File Scanner: provides files
- CLI Entry → Scan Orchestrator: starts scan
- CLI Entry → File Scanner: collects notes
- CLI Entry → Knowledge Detector: analyzes notes
- CLI Entry → Context Formatter: writes knowledge map
- Scan Orchestrator → File Scanner: scans files
- Route Detection → Route AST: uses AST extraction
- Scan Orchestrator → Native AST Host: loads native plugins
- Scan Orchestrator → Built-in Plugins: loads extensions
- Built-in Plugins → Terraform Plugin: exports opt-in
- CLI Entry → Wiki Generator: generates wiki
- CLI Entry → AI Config Generator: generates configs
- CLI Entry → HTML Report: generates report
- CLI Entry → MCP Server: starts server
- Monorepo Scan → Scan Orchestrator: scans packages
- Context Formatter → AI Coding Tool: provides context
- Wiki Generator → AI Coding Tool: provides articles
- AI Config Generator → AI Coding Tool: provides instructions
- HTML Report → Developer: shows report
- MCP Server → AI Coding Tool: serves tools
