# conventional-changelog/commitlint architecture

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

- Interactive diagram: https://gitdiagram.com/conventional-changelog/commitlint
- Repository: https://github.com/conventional-changelog/commitlint

## Overview

commitlint is a commit-message linter: users supply a message or select Git history, configuration defines the rules, and linting produces violations and a report. Its CLI is the primary interface; its API exposes reading, loading, and linting, while a separate interactive prompt helps compose convention-compliant messages. The graph also represents shared configurations and the commitizen adapter. Some CLI orchestration and configuration-loading calls are not visible in the excerpts, so those links are omitted or marked unverified rather than inferred.

Main entry points: [`@commitlint/lint/src/lint.ts`](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/lint/src/lint.ts) (Lint engine), [`@commitlint/prompt/src/input.ts`](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt/src/input.ts) (Interactive prompt), [`@commitlint/load/src/load.ts`](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/load/src/load.ts) (Config loader), [`@commitlint/cli/src/cli.ts`](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/cli/src/cli.ts) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_cli["CLI<br/>[cli.ts]"]
  node_reader["Git message reader<br/>[read.ts]"]
  node_api["Programmatic API<br/>[core.ts]"]
end

subgraph group_validation["Linting"]
  node_lint["Lint engine<br/>[lint.ts]"]
  node_parser["Message parser<br/>[index.ts]"]
  node_ignore["Ignore checks<br/>[is-ignored.ts]"]
  node_rules["Rule implementations"]
  node_report["Report formatter<br/>[format.ts]"]
end

subgraph group_configuration["Configuration"]
  node_loader["Config loader<br/>[load.ts]"]
  node_extends["Config inheritance<br/>[index.ts]"]
  node_config["Conventional config<br/>[index.ts]"]
  node_shared["Shared scope configs<br/>[index.js]"]
end

subgraph group_authoring["Message authoring"]
  node_promptcli["Prompt CLI<br/>[cli.js]"]
  node_prompt["Interactive prompt<br/>[input.ts]"]
  node_promptbuilder["Prompt builder<br/>[get-prompt.ts]"]
  node_promptformat["Message formatter<br/>[format.ts]"]
  node_adapter["Commitizen adapter<br/>[index.ts]"]
end

node_user(("Developer"))

node_user -->|"runs"| node_cli
node_cli -->|"reads commits"| node_reader
node_user -->|"calls"| node_api
node_api -.->|"lints messages"| node_lint
node_lint -->|"checks ignores"| node_ignore
node_lint -->|"parses message"| node_parser
node_lint -->|"executes rules"| node_rules
node_user -->|"loads config"| node_loader
node_loader -.->|"resolves extends"| node_extends
node_user -->|"shares config"| node_config
node_user -->|"uses shared config"| node_shared
node_user -->|"starts prompt"| node_promptcli
node_promptcli -.->|"opens prompt"| node_prompt
node_prompt -->|"loads rules"| node_loader
node_prompt -->|"builds questions"| node_promptbuilder
node_prompt -->|"formats result"| node_promptformat
node_user -->|"uses adapter"| node_adapter

click node_cli "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/cli/src/cli.ts"
click node_reader "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/read/src/read.ts"
click node_api "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/core/src/core.ts"
click node_lint "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/lint/src/lint.ts"
click node_parser "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/parse/src/index.ts"
click node_ignore "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/is-ignored/src/is-ignored.ts"
click node_rules "https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/rules/src"
click node_report "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/format/src/format.ts"
click node_loader "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/load/src/load.ts"
click node_extends "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/resolve-extends/src/index.ts"
click node_config "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/src/index.ts"
click node_shared "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-lerna-scopes/index.js"
click node_promptcli "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt-cli/cli.js"
click node_prompt "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt/src/input.ts"
click node_promptbuilder "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt/src/library/get-prompt.ts"
click node_promptformat "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt/src/library/format.ts"
click node_adapter "https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/cz-commitlint/src/index.ts"

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_reader,node_api toneBlue
class node_lint,node_parser,node_ignore,node_rules,node_report toneAmber
class node_loader,node_extends,node_config,node_shared toneMint
class node_promptcli,node_prompt,node_promptbuilder,node_promptformat,node_adapter toneRose
class node_user toneIndigo
```

## Components

### Entry points

- [CLI](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/cli/src/cli.ts): `@commitlint/cli/src/cli.ts`
- [Git message reader](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/read/src/read.ts): `@commitlint/read/src/read.ts`
- [Programmatic API](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/core/src/core.ts): `@commitlint/core/src/core.ts`

### Linting

- [Lint engine](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/lint/src/lint.ts): `@commitlint/lint/src/lint.ts`
- [Message parser](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/parse/src/index.ts): `@commitlint/parse/src/index.ts`
- [Ignore checks](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/is-ignored/src/is-ignored.ts): `@commitlint/is-ignored/src/is-ignored.ts`
- [Rule implementations](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/rules/src): `@commitlint/rules/src`
- [Report formatter](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/format/src/format.ts): `@commitlint/format/src/format.ts`

### Configuration

- [Config loader](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/load/src/load.ts): `@commitlint/load/src/load.ts`
- [Config inheritance](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/resolve-extends/src/index.ts): `@commitlint/resolve-extends/src/index.ts`
- [Conventional config](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/src/index.ts): `@commitlint/config-conventional/src/index.ts`
- [Shared scope configs](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-lerna-scopes/index.js): `@commitlint/config-lerna-scopes/index.js`

### Message authoring

- [Prompt CLI](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt-cli/cli.js): `@commitlint/prompt-cli/cli.js`
- [Interactive prompt](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt/src/input.ts): `@commitlint/prompt/src/input.ts`
- [Prompt builder](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt/src/library/get-prompt.ts): `@commitlint/prompt/src/library/get-prompt.ts`
- [Message formatter](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/prompt/src/library/format.ts): `@commitlint/prompt/src/library/format.ts`
- [Commitizen adapter](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/cz-commitlint/src/index.ts): `@commitlint/cz-commitlint/src/index.ts`

### Other components

- **Developer**

## Connections

- Developer → CLI: runs (evidence: `README.md`)
- CLI → Git message reader: reads commits (evidence: `@commitlint/cli/src/cli.ts`)
- Developer → Programmatic API: calls (evidence: `README.md`)
- Programmatic API → Lint engine: lints messages
- Lint engine → Ignore checks: checks ignores (evidence: `@commitlint/lint/src/lint.ts`)
- Lint engine → Message parser: parses message (evidence: `@commitlint/lint/src/lint.ts`)
- Lint engine → Rule implementations: executes rules (evidence: `@commitlint/lint/src/lint.ts`)
- Developer → Config loader: loads config (evidence: `README.md`)
- Config loader → Config inheritance: resolves extends
- Developer → Conventional config: shares config (evidence: `README.md`)
- Developer → Shared scope configs: uses shared config (evidence: `README.md`)
- Developer → Prompt CLI: starts prompt (evidence: `README.md`)
- Prompt CLI → Interactive prompt: opens prompt
- Interactive prompt → Config loader: loads rules (evidence: `@commitlint/prompt/src/input.ts`)
- Interactive prompt → Prompt builder: builds questions (evidence: `@commitlint/prompt/src/input.ts`)
- Interactive prompt → Message formatter: formats result (evidence: `@commitlint/prompt/src/input.ts`)
- Developer → Commitizen adapter: uses adapter (evidence: `README.md`)
