# eugenekozhun/committle architecture

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

- Interactive diagram: https://gitdiagram.com/eugenekozhun/committle
- Repository: https://github.com/eugenekozhun/committle

## Overview

Committle is a JetBrains IDE plugin for composing consistent commit messages from configurable templates. The documented workflow is to invoke the apply-pattern action, which turns a template into a commit message with variables, whitespace rules, and a caret position. Settings persist per project; the template language also has parsing, highlighting, and completion support. The graph includes the principal services and documented capabilities, but action and UI implementation excerpts were not provided, so their internal call wiring is not asserted.

Main entry points: [`src/main/kotlin/com/kozhun/commitmessagetemplate/service/formatter/impl/CommitMessageFormatterDefaultImpl.kt`](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/formatter/impl/CommitMessageFormatterDefaultImpl.kt) (Message formatter), [`src/main/kotlin/com/kozhun/commitmessagetemplate/action/GenerateCommitMessageAction.kt`](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/action/GenerateCommitMessageAction.kt) (Apply pattern), [`src/main/kotlin/com/kozhun/commitmessagetemplate/language/parser/CMTParserDefinition.kt`](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/parser/CMTParserDefinition.kt) (Parser definition), [`src/main/kotlin/com/kozhun/commitmessagetemplate/ui/page/CMTSettingsPage.kt`](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/ui/page/CMTSettingsPage.kt) (Settings page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Message workflow"]
  node_apply["Apply pattern"]
  node_commit_result["Commit message"]
end

subgraph group_template["Template language"]
  node_template_text["Template file<br/>[CMTFile.kt]"]
  node_parser_def["Parser definition"]
  node_lexer["Lexer adapter<br/>[CMTLexerAdapter.kt]"]
  node_parser["Template parser<br/>[CMTParser.java]"]
  node_completion["Variable completion"]
  node_highlighter["Syntax highlighting"]
end

subgraph group_settings["Settings"]
  node_settings_page["Settings page<br/>[CMTSettingsPage.kt]"]
  node_pattern_editor["Pattern editor"]
  node_settings_storage[("Project settings<br/>[SettingsStorage.kt]")]
  node_settings_state["Settings state<br/>[SettingsState.kt]"]
end

subgraph group_services["Message services"]
  node_branch_service["Current branch"]
  node_replacers["Variable replacers"]
  node_scope_replacer["File scope"]
  node_type_replacer["Branch type"]
  node_formatter["Message formatter"]
  node_whitespace["Whitespace rules"]
  node_caret["Caret placement"]
end

node_user(("IDE user"))
node_branch_source["IDE Git data"]

node_user -->|"invokes"| node_apply
node_parser_def -->|"creates lexer"| node_lexer
node_parser_def -->|"creates parser"| node_parser
node_settings_page -->|"uses editor"| node_pattern_editor
node_settings_page -->|"configures"| node_settings_storage
node_settings_storage -->|"stores"| node_settings_state
node_branch_service -->|"reads branch"| node_branch_source
node_apply -->|"applies pattern"| node_commit_result
node_apply -->|"formats message"| node_formatter
node_formatter -->|"normalizes whitespace"| node_whitespace
node_formatter -->|"sets caret position"| node_caret
node_formatter -->|"resolves variables"| node_replacers
node_formatter -->|"resolves scope"| node_scope_replacer
node_formatter -->|"resolves type"| node_type_replacer
node_replacers -->|"reads branch"| node_branch_service

click node_apply "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/action/GenerateCommitMessageAction.kt"
click node_template_text "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/psi/CMTFile.kt"
click node_parser_def "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/parser/CMTParserDefinition.kt"
click node_lexer "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/lexer/CMTLexerAdapter.kt"
click node_parser "https://github.com/eugenekozhun/committle/blob/main/src/main/gen/com/kozhun/commitmessagetemplate/language/parser/CMTParser.java"
click node_completion "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/completion/CMTCompletionContributor.kt"
click node_highlighter "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/highlighter/CMTSyntaxHighlighter.kt"
click node_settings_page "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/ui/page/CMTSettingsPage.kt"
click node_pattern_editor "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/ui/components/PatternEditorBuilder.kt"
click node_settings_storage "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/storage/SettingsStorage.kt"
click node_settings_state "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/storage/SettingsState.kt"
click node_branch_service "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/git/branch/impl/GitBranchServiceImpl.kt"
click node_replacers "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/BranchTaskIdReplacer.kt"
click node_scope_replacer "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/FilePathScopeReplacer.kt"
click node_type_replacer "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/BranchTypeReplacer.kt"
click node_formatter "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/formatter/impl/CommitMessageFormatterDefaultImpl.kt"
click node_whitespace "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/whitespace/impl/WhitespaceServiceDefaultImpl.kt"
click node_caret "https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/caret/impl/CaretServiceDefaultImpl.kt"

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_apply,node_commit_result,node_user toneBlue
class node_template_text,node_parser_def,node_lexer,node_parser,node_completion,node_highlighter toneAmber
class node_settings_page,node_pattern_editor,node_settings_storage,node_settings_state toneMint
class node_branch_service,node_replacers,node_scope_replacer,node_type_replacer,node_formatter,node_whitespace,node_caret toneRose
class node_branch_source toneIndigo
```

## Components

### Message workflow

- [Apply pattern](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/action/GenerateCommitMessageAction.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/action/GenerateCommitMessageAction.kt`
- **Commit message**

### Template language

- [Template file](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/psi/CMTFile.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/language/psi/CMTFile.kt`
- [Parser definition](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/parser/CMTParserDefinition.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/language/parser/CMTParserDefinition.kt`
- [Lexer adapter](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/lexer/CMTLexerAdapter.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/language/lexer/CMTLexerAdapter.kt`
- [Template parser](https://github.com/eugenekozhun/committle/blob/main/src/main/gen/com/kozhun/commitmessagetemplate/language/parser/CMTParser.java): `src/main/gen/com/kozhun/commitmessagetemplate/language/parser/CMTParser.java`
- [Variable completion](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/completion/CMTCompletionContributor.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/language/completion/CMTCompletionContributor.kt`
- [Syntax highlighting](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/language/highlighter/CMTSyntaxHighlighter.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/language/highlighter/CMTSyntaxHighlighter.kt`

### Settings

- [Settings page](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/ui/page/CMTSettingsPage.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/ui/page/CMTSettingsPage.kt`
- [Pattern editor](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/ui/components/PatternEditorBuilder.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/ui/components/PatternEditorBuilder.kt`
- [Project settings](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/storage/SettingsStorage.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/storage/SettingsStorage.kt`
- [Settings state](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/storage/SettingsState.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/storage/SettingsState.kt`

### Message services

- [Current branch](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/git/branch/impl/GitBranchServiceImpl.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/service/git/branch/impl/GitBranchServiceImpl.kt`
- [Variable replacers](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/BranchTaskIdReplacer.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/BranchTaskIdReplacer.kt`
- [File scope](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/FilePathScopeReplacer.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/FilePathScopeReplacer.kt`
- [Branch type](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/BranchTypeReplacer.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/service/replacer/impl/BranchTypeReplacer.kt`
- [Message formatter](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/formatter/impl/CommitMessageFormatterDefaultImpl.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/service/formatter/impl/CommitMessageFormatterDefaultImpl.kt`
- [Whitespace rules](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/whitespace/impl/WhitespaceServiceDefaultImpl.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/service/whitespace/impl/WhitespaceServiceDefaultImpl.kt`
- [Caret placement](https://github.com/eugenekozhun/committle/blob/main/src/main/kotlin/com/kozhun/commitmessagetemplate/service/caret/impl/CaretServiceDefaultImpl.kt): `src/main/kotlin/com/kozhun/commitmessagetemplate/service/caret/impl/CaretServiceDefaultImpl.kt`

### Other components

- **IDE user**
- **IDE Git data**

## Connections

- IDE user → Apply pattern: invokes
- Parser definition → Lexer adapter: creates lexer
- Parser definition → Template parser: creates parser
- Settings page → Pattern editor: uses editor
- Settings page → Project settings: configures
- Project settings → Settings state: stores
- Current branch → IDE Git data: reads branch
- Apply pattern → Commit message: applies pattern
- Apply pattern → Message formatter: formats message
- Message formatter → Whitespace rules: normalizes whitespace
- Message formatter → Caret placement: sets caret position
- Message formatter → Variable replacers: resolves variables
- Message formatter → File scope: resolves scope
- Message formatter → Branch type: resolves type
- Variable replacers → Current branch: reads branch
