# iepathos/claudeforge architecture

> Architecture diagram of the GitHub repository iepathos/claudeforge, 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/iepathos/claudeforge
- Repository: https://github.com/iepathos/claudeforge

## Overview

ClaudeForge is a CLI project scaffolder. Users select a language and project name; the runtime resolves a registered template, fetches or reuses its cached repository, copies and customizes files, then initializes and commits a Git repository in the new project. The CLI also lists templates, refreshes cached templates, and reports version information. The workflow wiring is supported by the sampled entry point, loader, and processor; unsampled implementation details are not expanded.

Main entry points: [`src/template/loader.rs`](https://github.com/iepathos/claudeforge/blob/master/src/template/loader.rs) (Template loader), [`src/template/processor.rs`](https://github.com/iepathos/claudeforge/blob/master/src/template/processor.rs) (Project creation), [`src/main.rs`](https://github.com/iepathos/claudeforge/blob/master/src/main.rs) (Command dispatch), [`src/git/mod.rs`](https://github.com/iepathos/claudeforge/blob/master/src/git/mod.rs) (Git operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI commands"]
  node_main["Command dispatch<br/>[main.rs]"]
  node_cli_args["Command arguments<br/>[cli.rs]"]
  node_version["Version output<br/>[main.rs]"]
end

subgraph group_templates["Template management"]
  node_loader["Template loader<br/>[loader.rs]"]
  node_registry["Built-in registry<br/>[registry.rs]"]
  node_template_model["Template rules<br/>[mod.rs]"]
  node_cache[("Template cache")]
end

subgraph group_generation["Project generation"]
  node_create["Project creation<br/>[processor.rs]"]
  node_fs_utils["Filesystem utilities<br/>[fs.rs]"]
end

subgraph group_support["Configuration and Git"]
  node_config["User configuration<br/>[mod.rs]"]
  node_git_ops["Git operations<br/>[mod.rs]"]
end

node_user(("CLI user"))
node_local_fs[("Local filesystem")]
node_git_service(("Git repositories"))
node_project["Generated project"]

node_user -->|"provides command"| node_cli_args
node_cli_args -->|"dispatches"| node_main
node_main -->|"checks availability"| node_git_ops
node_main -->|"creates project"| node_create
node_main -->|"lists templates"| node_loader
node_main -->|"updates cache"| node_loader
node_main -->|"prints version"| node_version
node_loader -->|"loads settings"| node_config
node_loader -->|"loads registry"| node_registry
node_registry -->|"defines rules"| node_template_model
node_loader -->|"checks cache"| node_cache
node_loader -->|"clones templates"| node_git_ops
node_git_ops -->|"accesses repositories"| node_git_service
node_loader -->|"manages cache"| node_local_fs
node_create -->|"resolves template"| node_loader
node_loader -->|"returns template path"| node_create
node_create -->|"reads customization rules"| node_template_model
node_create -->|"copies template files"| node_fs_utils
node_fs_utils -->|"reads and writes"| node_local_fs
node_create -->|"customizes files"| node_local_fs
node_create -->|"initializes and commits"| node_git_ops
node_git_ops -->|"creates repository"| node_project
node_create -->|"writes scaffold"| node_project

click node_main "https://github.com/iepathos/claudeforge/blob/master/src/main.rs"
click node_cli_args "https://github.com/iepathos/claudeforge/blob/master/src/cli.rs"
click node_create "https://github.com/iepathos/claudeforge/blob/master/src/template/processor.rs"
click node_loader "https://github.com/iepathos/claudeforge/blob/master/src/template/loader.rs"
click node_registry "https://github.com/iepathos/claudeforge/blob/master/src/template/registry.rs"
click node_template_model "https://github.com/iepathos/claudeforge/blob/master/src/template/mod.rs"
click node_config "https://github.com/iepathos/claudeforge/blob/master/src/config/mod.rs"
click node_git_ops "https://github.com/iepathos/claudeforge/blob/master/src/git/mod.rs"
click node_fs_utils "https://github.com/iepathos/claudeforge/blob/master/src/utils/fs.rs"
click node_version "https://github.com/iepathos/claudeforge/blob/master/src/main.rs"

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_main,node_cli_args,node_version,node_user toneBlue
class node_loader,node_registry,node_template_model,node_cache,node_local_fs toneAmber
class node_create,node_fs_utils toneMint
class node_config,node_git_ops toneRose
class node_git_service,node_project toneIndigo
```

## Components

### CLI commands

- [Command dispatch](https://github.com/iepathos/claudeforge/blob/master/src/main.rs): `src/main.rs`
- [Command arguments](https://github.com/iepathos/claudeforge/blob/master/src/cli.rs): `src/cli.rs`
- [Version output](https://github.com/iepathos/claudeforge/blob/master/src/main.rs): `src/main.rs`

### Template management

- [Template loader](https://github.com/iepathos/claudeforge/blob/master/src/template/loader.rs): `src/template/loader.rs`
- [Built-in registry](https://github.com/iepathos/claudeforge/blob/master/src/template/registry.rs): `src/template/registry.rs`
- [Template rules](https://github.com/iepathos/claudeforge/blob/master/src/template/mod.rs): `src/template/mod.rs`
- **Template cache**

### Project generation

- [Project creation](https://github.com/iepathos/claudeforge/blob/master/src/template/processor.rs): `src/template/processor.rs`
- [Filesystem utilities](https://github.com/iepathos/claudeforge/blob/master/src/utils/fs.rs): `src/utils/fs.rs`

### Configuration and Git

- [User configuration](https://github.com/iepathos/claudeforge/blob/master/src/config/mod.rs): `src/config/mod.rs`
- [Git operations](https://github.com/iepathos/claudeforge/blob/master/src/git/mod.rs): `src/git/mod.rs`

### Other components

- **CLI user**
- **Local filesystem**
- **Git repositories**
- **Generated project**

## Connections

- CLI user → Command arguments: provides command
- Command arguments → Command dispatch: dispatches
- Command dispatch → Git operations: checks availability
- Command dispatch → Project creation: creates project
- Command dispatch → Template loader: lists templates
- Command dispatch → Template loader: updates cache
- Command dispatch → Version output: prints version
- Template loader → User configuration: loads settings
- Template loader → Built-in registry: loads registry
- Built-in registry → Template rules: defines rules
- Template loader → Template cache: checks cache
- Template loader → Git operations: clones templates
- Git operations → Git repositories: accesses repositories
- Template loader → Local filesystem: manages cache
- Project creation → Template loader: resolves template
- Template loader → Project creation: returns template path
- Project creation → Template rules: reads customization rules
- Project creation → Filesystem utilities: copies template files
- Filesystem utilities → Local filesystem: reads and writes
- Project creation → Local filesystem: customizes files
- Project creation → Git operations: initializes and commits
- Git operations → Generated project: creates repository
- Project creation → Generated project: writes scaffold
