# zizamele03/github-pr-reviewer architecture

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

- Interactive diagram: https://gitdiagram.com/zizamele03/github-pr-reviewer
- Repository: https://github.com/zizamele03/github-pr-reviewer

## Overview

This is a command-line GitHub pull-request reviewer. A user selects one PR or all open PRs; the orchestrator obtains PR metadata and diffs, requests an LLM review (with documented statistical fallback), and saves a Markdown report. GitHub retrieval and review generation are separate domain stages; configuration is the key internal support layer. The README documents fallback behavior and output details beyond the sampled implementation excerpts.

Main entry points: [`src/main.py`](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/main.py) (PR orchestrator), [`src/github_client.py`](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/github_client.py) (Open PR listing), [`src/llm_reviewer.py`](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/llm_reviewer.py) (Review generation), [`src/config.py`](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/config.py) (Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Review orchestration"]
  node_orchestrator["PR orchestrator<br/>[main.py]"]
  node_configuration["Configuration<br/>[config.py]"]
end

subgraph group_github["GitHub retrieval"]
  node_pr_listing["Open PR listing<br/>[github_client.py]"]
  node_pr_details["PR details<br/>[github_client.py]"]
  node_diff_retrieval["Diff retrieval<br/>[github_client.py]"]
  node_github_api{{"GitHub API"}}
end

subgraph group_review["Review and output"]
  node_review_generation["Review generation<br/>[llm_reviewer.py]"]
  node_huggingface{{"HuggingFace inference"}}
  node_markdown_output["Markdown report<br/>[main.py]"]
end

node_user(("CLI user"))

node_user -->|"selects PRs"| node_orchestrator
node_orchestrator -->|"reads settings"| node_configuration
node_orchestrator -->|"lists open PRs"| node_pr_listing
node_orchestrator -->|"fetches details"| node_pr_details
node_orchestrator -->|"requests diff"| node_diff_retrieval
node_pr_listing -->|"requests PRs"| node_github_api
node_pr_details -->|"requests details"| node_github_api
node_diff_retrieval -->|"requests diff"| node_github_api
node_orchestrator -->|"submits PR context"| node_review_generation
node_review_generation -->|"requests inference"| node_huggingface
node_orchestrator -->|"writes report"| node_markdown_output

click node_orchestrator "https://github.com/zizamele03/github-pr-reviewer/blob/main/src/main.py"
click node_configuration "https://github.com/zizamele03/github-pr-reviewer/blob/main/src/config.py"
click node_pr_listing "https://github.com/zizamele03/github-pr-reviewer/blob/main/src/github_client.py"
click node_pr_details "https://github.com/zizamele03/github-pr-reviewer/blob/main/src/github_client.py"
click node_diff_retrieval "https://github.com/zizamele03/github-pr-reviewer/blob/main/src/github_client.py"
click node_review_generation "https://github.com/zizamele03/github-pr-reviewer/blob/main/src/llm_reviewer.py"
click node_markdown_output "https://github.com/zizamele03/github-pr-reviewer/blob/main/src/main.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_orchestrator,node_configuration,node_user toneBlue
class node_pr_listing,node_pr_details,node_diff_retrieval,node_github_api toneAmber
class node_review_generation,node_huggingface,node_markdown_output toneMint
```

## Components

### Review orchestration

- [PR orchestrator](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/main.py): `src/main.py`
- [Configuration](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/config.py): `src/config.py`

### GitHub retrieval

- [Open PR listing](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/github_client.py): `src/github_client.py`
- [PR details](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/github_client.py): `src/github_client.py`
- [Diff retrieval](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/github_client.py): `src/github_client.py`
- **GitHub API**

### Review and output

- [Review generation](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/llm_reviewer.py): `src/llm_reviewer.py`
- **HuggingFace inference**
- [Markdown report](https://github.com/zizamele03/github-pr-reviewer/blob/main/src/main.py): `src/main.py`

### Other components

- **CLI user**

## Connections

- CLI user → PR orchestrator: selects PRs (evidence: `README.md`)
- PR orchestrator → Configuration: reads settings (evidence: `src/main.py`)
- PR orchestrator → Open PR listing: lists open PRs (evidence: `src/main.py`)
- PR orchestrator → PR details: fetches details (evidence: `src/main.py`)
- PR orchestrator → Diff retrieval: requests diff (evidence: `README.md`)
- Open PR listing → GitHub API: requests PRs (evidence: `README.md`)
- PR details → GitHub API: requests details (evidence: `src/github_client.py`)
- Diff retrieval → GitHub API: requests diff (evidence: `README.md`)
- PR orchestrator → Review generation: submits PR context (evidence: `src/main.py`)
- Review generation → HuggingFace inference: requests inference (evidence: `README.md`)
- PR orchestrator → Markdown report: writes report (evidence: `src/main.py`)
