# uaoa/claude-commit architecture

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

- Interactive diagram: https://gitdiagram.com/uaoa/claude-commit
- Repository: https://github.com/uaoa/claude-commit

## Overview

AI Commit Generator turns staged Git changes into a Conventional Commit message, lets the user confirm or refine it, then creates the commit. The CLI entry point orchestrates staged-change collection, API/CLI generation with API-to-CLI fallback, interactive editing, and commit execution. The README documents English/Ukrainian support and both generation methods; source excerpts show the main orchestration and module calls. External services and the Git repository are modeled separately from repository code.

Main entry points: [`generate-commit.mjs`](https://github.com/uaoa/claude-commit/blob/main/generate-commit.mjs) (Commit orchestrator), [`git-utils.mjs`](https://github.com/uaoa/claude-commit/blob/main/git-utils.mjs) (Staged changes and commit), [`ai-generator.mjs`](https://github.com/uaoa/claude-commit/blob/main/ai-generator.mjs) (API generation and refinement), [`ui.mjs`](https://github.com/uaoa/claude-commit/blob/main/ui.mjs) (Prompts and console UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Commit workflow"]
  node_entry["Commit orchestrator"]
end

subgraph group_git["Git access"]
  node_gitutils["Staged changes and commit<br/>[git-utils.mjs]"]
end

subgraph group_ai["AI generation"]
  node_generator["API generation and refinement<br/>[ai-generator.mjs]"]
  node_cligeneration["CLI generation and refinement<br/>[ai-generator.mjs]"]
end

subgraph group_interaction["User interaction"]
  node_ui["Prompts and console UI<br/>[ui.mjs]"]
  node_localization["English and Ukrainian messages<br/>[i18n.mjs]"]
end

node_user(("User"))
node_gitrepo[("Git repository")]
node_claudeapi["Anthropic API"]
node_claudecli["Claude Code CLI"]

node_user -->|"runs"| node_entry
node_entry -->|"reads staged changes"| node_gitutils
node_gitutils -->|"reads status and diff"| node_gitrepo
node_entry -->|"generates or refines"| node_generator
node_generator -->|"requests completion"| node_claudeapi
node_entry -->|"fallback or generate"| node_cligeneration
node_cligeneration -->|"runs prompt"| node_claudecli
node_entry -->|"asks and displays"| node_ui
node_ui -->|"collects response"| node_user
node_entry -->|"gets translations"| node_localization
node_entry -->|"creates commit"| node_gitutils
node_gitutils -->|"writes commit"| node_gitrepo

click node_entry "https://github.com/uaoa/claude-commit/blob/main/generate-commit.mjs"
click node_gitutils "https://github.com/uaoa/claude-commit/blob/main/git-utils.mjs"
click node_generator "https://github.com/uaoa/claude-commit/blob/main/ai-generator.mjs"
click node_cligeneration "https://github.com/uaoa/claude-commit/blob/main/ai-generator.mjs"
click node_ui "https://github.com/uaoa/claude-commit/blob/main/ui.mjs"
click node_localization "https://github.com/uaoa/claude-commit/blob/main/i18n.mjs"

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_entry,node_user toneBlue
class node_gitutils,node_gitrepo toneAmber
class node_generator,node_cligeneration,node_claudeapi toneMint
class node_ui,node_localization toneRose
class node_claudecli toneIndigo
```

## Components

### Commit workflow

- [Commit orchestrator](https://github.com/uaoa/claude-commit/blob/main/generate-commit.mjs): `generate-commit.mjs`

### Git access

- [Staged changes and commit](https://github.com/uaoa/claude-commit/blob/main/git-utils.mjs): `git-utils.mjs`

### AI generation

- [API generation and refinement](https://github.com/uaoa/claude-commit/blob/main/ai-generator.mjs): `ai-generator.mjs`
- [CLI generation and refinement](https://github.com/uaoa/claude-commit/blob/main/ai-generator.mjs): `ai-generator.mjs`

### User interaction

- [Prompts and console UI](https://github.com/uaoa/claude-commit/blob/main/ui.mjs): `ui.mjs`
- [English and Ukrainian messages](https://github.com/uaoa/claude-commit/blob/main/i18n.mjs): `i18n.mjs`

### Other components

- **User**
- **Git repository**
- **Anthropic API**
- **Claude Code CLI**

## Connections

- User → Commit orchestrator: runs (evidence: `README.md`)
- Commit orchestrator → Staged changes and commit: reads staged changes (evidence: `generate-commit.mjs`)
- Staged changes and commit → Git repository: reads status and diff (evidence: `git-utils.mjs`)
- Commit orchestrator → API generation and refinement: generates or refines (evidence: `generate-commit.mjs`)
- API generation and refinement → Anthropic API: requests completion (evidence: `ai-generator.mjs`)
- Commit orchestrator → CLI generation and refinement: fallback or generate (evidence: `generate-commit.mjs`)
- CLI generation and refinement → Claude Code CLI: runs prompt (evidence: `ai-generator.mjs`)
- Commit orchestrator → Prompts and console UI: asks and displays (evidence: `generate-commit.mjs`)
- Prompts and console UI → User: collects response (evidence: `ui.mjs`)
- Commit orchestrator → English and Ukrainian messages: gets translations (evidence: `generate-commit.mjs`)
- Commit orchestrator → Staged changes and commit: creates commit (evidence: `generate-commit.mjs`)
- Staged changes and commit → Git repository: writes commit (evidence: `git-utils.mjs`)
