# rubenselander/reposcribe architecture

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

- Interactive diagram: https://gitdiagram.com/rubenselander/reposcribe
- Repository: https://github.com/rubenselander/reposcribe

## Overview

RepoScribe turns a project directory into Markdown containing file contents and, optionally, a directory tree. Users can start generation through the documented CLI or Python usage; the CLI calls the core generator, which reads ignore patterns, assembles the document, and optionally saves it. The core also provides file filtering and language-label selection. The README documents a Python import, but the supplied `reposcribe/__init__.py` excerpt is empty, so that export path is not confirmed. The graph reflects the sampled core and CLI; planned features are excluded.

Main entry points: [`reposcribe/core.py`](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py) (Document Generator), [`reposcribe/cli.py`](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/cli.py) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_developer(("Developer"))
node_project_files["Project Files"]
node_markdown_output["Markdown Output"]
node_cli["CLI<br/>[cli.py]"]
node_generator["Document Generator<br/>[core.py]"]
node_ignore_loader["Ignore Loader<br/>[core.py]"]
node_file_concatenator["File Concatenator<br/>[core.py]"]
node_tree_renderer["Tree Renderer<br/>[core.py]"]
node_filter["Path Filter<br/>[core.py]"]
node_language_mapper["Language Mapper<br/>[core.py]"]

node_developer -->|"runs"| node_cli
node_cli -->|"calls"| node_generator
node_generator -->|"loads patterns"| node_ignore_loader
node_generator -->|"assembles contents"| node_file_concatenator
node_generator -->|"adds tree"| node_tree_renderer
node_generator -->|"writes optionally"| node_markdown_output
node_project_files -->|"provides ignore file"| node_ignore_loader
node_file_concatenator -->|"reads files"| node_project_files
node_tree_renderer -->|"lists directories"| node_project_files
node_file_concatenator -->|"checks paths"| node_filter
node_tree_renderer -->|"checks paths"| node_filter
node_file_concatenator -->|"gets code labels"| node_language_mapper

click node_cli "https://github.com/rubenselander/reposcribe/blob/main/reposcribe/cli.py"
click node_generator "https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py"
click node_ignore_loader "https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py"
click node_file_concatenator "https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py"
click node_tree_renderer "https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py"
click node_filter "https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py"
click node_language_mapper "https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.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_developer,node_project_files,node_markdown_output toneIndigo
class node_cli,node_generator,node_ignore_loader,node_file_concatenator,node_tree_renderer,node_filter,node_language_mapper toneTeal
```

## Components

### Other components

- **Developer**
- **Project Files**
- **Markdown Output**
- [CLI](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/cli.py): `reposcribe/cli.py`
- [Document Generator](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py): `reposcribe/core.py`
- [Ignore Loader](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py): `reposcribe/core.py`
- [File Concatenator](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py): `reposcribe/core.py`
- [Tree Renderer](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py): `reposcribe/core.py`
- [Path Filter](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py): `reposcribe/core.py`
- [Language Mapper](https://github.com/rubenselander/reposcribe/blob/main/reposcribe/core.py): `reposcribe/core.py`

## Connections

- Developer → CLI: runs (evidence: `README.md`)
- CLI → Document Generator: calls (evidence: `reposcribe/cli.py`)
- Document Generator → Ignore Loader: loads patterns (evidence: `reposcribe/core.py`)
- Document Generator → File Concatenator: assembles contents (evidence: `reposcribe/core.py`)
- Document Generator → Tree Renderer: adds tree (evidence: `reposcribe/core.py`)
- Document Generator → Markdown Output: writes optionally (evidence: `reposcribe/core.py`)
- Project Files → Ignore Loader: provides ignore file (evidence: `reposcribe/core.py`)
- File Concatenator → Project Files: reads files (evidence: `reposcribe/core.py`)
- Tree Renderer → Project Files: lists directories (evidence: `reposcribe/core.py`)
- File Concatenator → Path Filter: checks paths (evidence: `reposcribe/core.py`)
- Tree Renderer → Path Filter: checks paths (evidence: `reposcribe/core.py`)
- File Concatenator → Language Mapper: gets code labels (evidence: `reposcribe/core.py`)
