# gencaykut/github-ai-repo-toolkit architecture

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

- Interactive diagram: https://gitdiagram.com/gencaykut/github-ai-repo-toolkit
- Repository: https://github.com/gencaykut/github-ai-repo-toolkit

## Overview

GitHub AI Repo Toolkit is a Chrome extension that turns the active GitHub repository tab into service links and a localized analysis prompt, all generated locally in the popup. The workflow reads and validates the tab URL, builds links, then lets users copy links or the prompt, or open a selected service. The popup also supports language selection and local repository-history actions. The README documents these capabilities; unsampled source details are represented only where paths and documented behavior support them.

Main entry points: [`popup.js`](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/popup.js) (Popup controller), [`history.js`](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/history.js) (History manager), [`popup.html`](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/popup.html) (Popup interface), [`repo-url.js`](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/repo-url.js) (Repository URL parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_popup["Popup workflow"]
  node_popup_doc["Popup interface<br/>[popup.html]"]
  node_popup_controller["Popup controller<br/>[popup.js]"]
  node_repo_parser["Repository URL parser<br/>[repo-url.js]"]
  node_link_builder["Service link builder<br/>[services.js]"]
end

subgraph group_language["Language support"]
  node_analysis_prompt["Localized prompt<br/>[i18n.js]"]
  node_language_catalog["Language strings<br/>[i18n.js]"]
end

subgraph group_history["Repository history"]
  node_history_manager["History manager<br/>[history.js]"]
end

node_user(("Extension user"))
node_chrome_tabs["Chrome tabs API"]
node_chrome_storage[("Chrome local storage")]
node_clipboard["Browser clipboard"]
node_third_party["Repository link services"]

node_user -->|"opens"| node_popup_doc
node_popup_doc -->|"loads"| node_popup_controller
node_popup_controller -->|"queries active tab"| node_chrome_tabs
node_popup_controller -->|"parses tab URL"| node_repo_parser
node_popup_controller -->|"builds links"| node_link_builder
node_popup_controller -->|"formats prompt"| node_analysis_prompt
node_popup_controller -->|"reads strings"| node_language_catalog
node_popup_controller -->|"manages history"| node_history_manager
node_popup_controller -->|"reads language preference"| node_chrome_storage
node_history_manager -->|"normalizes URLs"| node_repo_parser
node_history_manager -->|"reads and writes history"| node_chrome_storage
node_popup_controller -->|"copies content"| node_clipboard
node_popup_controller -->|"opens generated URL"| node_chrome_tabs
node_chrome_tabs -.->|"navigates on request"| node_third_party

click node_popup_doc "https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/popup.html"
click node_popup_controller "https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/popup.js"
click node_repo_parser "https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/repo-url.js"
click node_link_builder "https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/services.js"
click node_analysis_prompt "https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/i18n.js"
click node_language_catalog "https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/i18n.js"
click node_history_manager "https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/history.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_popup_doc,node_popup_controller,node_repo_parser,node_link_builder,node_user,node_clipboard toneBlue
class node_analysis_prompt,node_language_catalog,node_chrome_storage toneAmber
class node_history_manager,node_chrome_tabs toneMint
class node_third_party toneIndigo
```

## Components

### Popup workflow

- [Popup interface](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/popup.html): `popup.html`
- [Popup controller](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/popup.js): `popup.js`
- [Repository URL parser](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/repo-url.js): `repo-url.js`
- [Service link builder](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/services.js): `services.js`

### Language support

- [Localized prompt](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/i18n.js): `i18n.js`
- [Language strings](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/i18n.js): `i18n.js`

### Repository history

- [History manager](https://github.com/gencaykut/github-ai-repo-toolkit/blob/main/history.js): `history.js`

### Other components

- **Extension user**
- **Chrome tabs API**
- **Chrome local storage**
- **Browser clipboard**
- **Repository link services**

## Connections

- Extension user → Popup interface: opens
- Popup interface → Popup controller: loads
- Popup controller → Chrome tabs API: queries active tab
- Popup controller → Repository URL parser: parses tab URL
- Popup controller → Service link builder: builds links
- Popup controller → Localized prompt: formats prompt
- Popup controller → Language strings: reads strings
- Popup controller → History manager: manages history
- Popup controller → Chrome local storage: reads language preference
- History manager → Repository URL parser: normalizes URLs
- History manager → Chrome local storage: reads and writes history
- Popup controller → Browser clipboard: copies content
- Popup controller → Chrome tabs API: opens generated URL
- Chrome tabs API → Repository link services: navigates on request
