# manojvkumar/code-reviewer architecture

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

- Interactive diagram: https://gitdiagram.com/manojvkumar/code-reviewer
- Repository: https://github.com/manojvkumar/code-reviewer

## Overview

AI Code Reviewer accepts local files, directories, or diffs through its CLI, or a pull-request diff through its GitHub bot. It parses and identifies supported code, runs selected review categories concurrently, combines and severity-sorts findings, then filters and renders reports; the bot instead posts a Markdown PR comment. The seven review categories are distinct domain stages, backed by a shared structured-output agent layer. The README documents the full feature set; sampled source confirms key routes, while unsampled category implementations are represented by their tree paths.

Main entry points: [`src/code_reviewer/pipeline.py`](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/pipeline.py) (Review pipeline), [`src/code_reviewer/agents/base.py`](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/base.py) (Structured agent calls), [`src/code_reviewer/github_bot.py`](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/github_bot.py) (PR review bot), [`src/code_reviewer/cli.py`](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/cli.py) (CLI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Code intake"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_parser["Code parser<br/>[code_parser.py]"]
  node_github_bot["PR review bot<br/>[github_bot.py]"]
end

subgraph group_review["Review orchestration"]
  node_pipeline["Review pipeline<br/>[pipeline.py]"]
  node_finding["Finding model<br/>[models.py]"]
end

subgraph group_analysis["Review agents"]
  node_bugs["Bug review<br/>[bug_detector.py]"]
  node_security["Security review"]
  node_style["Style review<br/>[style_checker.py]"]
  node_performance["Performance review"]
  node_best_practices["Best-practices review<br/>[best_practices.py]"]
  node_tests_review["Test coverage review<br/>[test_coverage.py]"]
  node_docs_review["Docs review<br/>[doc_reviewer.py]"]
  node_agent_base["Structured agent calls<br/>[base.py]"]
end

subgraph group_outputs["Report delivery"]
  node_report["Report renderers<br/>[report.py]"]
end

subgraph group_integrations["External services"]
  node_openai["OpenAI GPT-4o"]
  node_github["GitHub API"]
end

node_user(("Local reviewer"))

node_user -->|"invokes"| node_cli
node_cli -->|"reads and parses"| node_parser
node_cli -->|"runs reviews"| node_pipeline
node_cli -->|"renders reports"| node_report
node_github_bot -->|"fetches diff"| node_github
node_github_bot -->|"parses diff"| node_parser
node_github_bot -->|"runs reviews"| node_pipeline
node_github_bot -->|"renders comment"| node_report
node_github_bot -->|"posts comment"| node_github
node_pipeline -->|"dispatches"| node_bugs
node_pipeline -->|"dispatches"| node_security
node_pipeline -->|"dispatches"| node_style
node_pipeline -->|"dispatches"| node_performance
node_pipeline -->|"dispatches"| node_best_practices
node_pipeline -->|"dispatches"| node_tests_review
node_pipeline -->|"dispatches"| node_docs_review
node_bugs -->|"delegates"| node_agent_base
node_security -->|"delegates"| node_agent_base
node_style -->|"delegates"| node_agent_base
node_performance -->|"delegates"| node_agent_base
node_best_practices -->|"delegates"| node_agent_base
node_docs_review -->|"delegates"| node_agent_base
node_agent_base -->|"requests findings"| node_openai
node_agent_base -->|"creates"| node_finding
node_pipeline -->|"sorts findings"| node_finding

click node_cli "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/cli.py"
click node_parser "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/code_parser.py"
click node_github_bot "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/github_bot.py"
click node_pipeline "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/pipeline.py"
click node_finding "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/models.py"
click node_bugs "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/bug_detector.py"
click node_security "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/security_reviewer.py"
click node_style "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/style_checker.py"
click node_performance "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/performance_analyzer.py"
click node_best_practices "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/best_practices.py"
click node_tests_review "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/test_coverage.py"
click node_docs_review "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/doc_reviewer.py"
click node_agent_base "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/base.py"
click node_report "https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/report.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_cli,node_parser,node_github_bot,node_user toneBlue
class node_pipeline,node_finding toneAmber
class node_bugs,node_security,node_style,node_performance,node_best_practices,node_tests_review,node_docs_review,node_agent_base toneMint
class node_report toneRose
class node_openai,node_github toneIndigo
```

## Components

### Code intake

- [CLI commands](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/cli.py): `src/code_reviewer/cli.py`
- [Code parser](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/code_parser.py): `src/code_reviewer/code_parser.py`
- [PR review bot](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/github_bot.py): `src/code_reviewer/github_bot.py`

### Review orchestration

- [Review pipeline](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/pipeline.py): `src/code_reviewer/pipeline.py`
- [Finding model](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/models.py): `src/code_reviewer/models.py`

### Review agents

- [Bug review](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/bug_detector.py): `src/code_reviewer/agents/bug_detector.py`
- [Security review](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/security_reviewer.py): `src/code_reviewer/agents/security_reviewer.py`
- [Style review](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/style_checker.py): `src/code_reviewer/agents/style_checker.py`
- [Performance review](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/performance_analyzer.py): `src/code_reviewer/agents/performance_analyzer.py`
- [Best-practices review](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/best_practices.py): `src/code_reviewer/agents/best_practices.py`
- [Test coverage review](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/test_coverage.py): `src/code_reviewer/agents/test_coverage.py`
- [Docs review](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/doc_reviewer.py): `src/code_reviewer/agents/doc_reviewer.py`
- [Structured agent calls](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/agents/base.py): `src/code_reviewer/agents/base.py`

### Report delivery

- [Report renderers](https://github.com/manojvkumar/code-reviewer/blob/main/src/code_reviewer/report.py): `src/code_reviewer/report.py`

### External services

- **OpenAI GPT-4o**
- **GitHub API**

### Other components

- **Local reviewer**

## Connections

- Local reviewer → CLI commands: invokes (evidence: `README.md`)
- CLI commands → Code parser: reads and parses (evidence: `src/code_reviewer/cli.py`)
- CLI commands → Review pipeline: runs reviews (evidence: `src/code_reviewer/cli.py`)
- CLI commands → Report renderers: renders reports (evidence: `src/code_reviewer/cli.py`)
- PR review bot → GitHub API: fetches diff (evidence: `src/code_reviewer/github_bot.py`)
- PR review bot → Code parser: parses diff (evidence: `src/code_reviewer/github_bot.py`)
- PR review bot → Review pipeline: runs reviews (evidence: `src/code_reviewer/github_bot.py`)
- PR review bot → Report renderers: renders comment (evidence: `src/code_reviewer/github_bot.py`)
- PR review bot → GitHub API: posts comment (evidence: `src/code_reviewer/github_bot.py`)
- Review pipeline → Bug review: dispatches (evidence: `src/code_reviewer/pipeline.py`)
- Review pipeline → Security review: dispatches (evidence: `src/code_reviewer/pipeline.py`)
- Review pipeline → Style review: dispatches (evidence: `src/code_reviewer/pipeline.py`)
- Review pipeline → Performance review: dispatches (evidence: `src/code_reviewer/pipeline.py`)
- Review pipeline → Best-practices review: dispatches (evidence: `src/code_reviewer/pipeline.py`)
- Review pipeline → Test coverage review: dispatches (evidence: `src/code_reviewer/pipeline.py`)
- Review pipeline → Docs review: dispatches (evidence: `src/code_reviewer/pipeline.py`)
- Bug review → Structured agent calls: delegates (evidence: `src/code_reviewer/agents/bug_detector.py`)
- Security review → Structured agent calls: delegates (evidence: `src/code_reviewer/agents/security_reviewer.py`)
- Style review → Structured agent calls: delegates (evidence: `src/code_reviewer/agents/style_checker.py`)
- Performance review → Structured agent calls: delegates (evidence: `src/code_reviewer/agents/performance_analyzer.py`)
- Best-practices review → Structured agent calls: delegates (evidence: `src/code_reviewer/agents/best_practices.py`)
- Docs review → Structured agent calls: delegates (evidence: `src/code_reviewer/agents/doc_reviewer.py`)
- Structured agent calls → OpenAI GPT-4o: requests findings (evidence: `src/code_reviewer/agents/base.py`)
- Structured agent calls → Finding model: creates (evidence: `src/code_reviewer/agents/base.py`)
- Review pipeline → Finding model: sorts findings (evidence: `src/code_reviewer/pipeline.py`)
