# caffeine-addictt/waku architecture

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

- Interactive diagram: https://gitdiagram.com/caffeine-addictt/waku
- Repository: https://github.com/caffeine-addictt/waku

## Overview

Waku is a CLI project scaffolder. Its main workflow validates `new` options, prompts for project details and template style, obtains and parses a template, resolves license and variable data, writes generated files, and optionally initializes Git. The README also describes consistency-focused setup, while the tree exposes health and template-check commands. Source excerpts establish the main flow; some supporting command and template modules are unsampled, so their internal relationships are not expanded.

Main entry points: [`cmd/commands/new.go`](https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/new.go) (New project), [`cmd/root.go`](https://github.com/caffeine-addictt/waku/blob/main/cmd/root.go) (Command root), [`internal/git`](https://github.com/caffeine-addictt/waku/tree/main/internal/git) (Git operations), [`internal/license/store.go`](https://github.com/caffeine-addictt/waku/blob/main/internal/license/store.go) (License selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI entrypoints"]
  node_main["Program entry<br/>[main.go]"]
  node_root["Command root<br/>[root.go]"]
  node_checkcmd["Template check<br/>[check.go]"]
  node_healthcmd["Git healthcheck<br/>[healthcheck.go]"]
end

subgraph group_workflow["Project creation"]
  node_newcmd["New project<br/>[new.go]"]
  node_options["New options<br/>[new.go]"]
  node_license["License selection<br/>[store.go]"]
  node_filewrite["Generated files<br/>[new.go]"]
end

subgraph group_template["Template processing"]
  node_prompts["Prompt selection<br/>[prompting.go]"]
  node_configparse["Template config<br/>[parse_config.go]"]
  node_resources["Style resources<br/>[resource.go]"]
  node_templatefiles["Template parsing<br/>[template.go]"]
  node_configtypes["Template config model"]
  node_variables["Prompt variables<br/>[variables.go]"]
end

subgraph group_integrations["External integrations"]
  node_gitops["Git operations"]
end

subgraph group_support["Shared support"]
  node_cleanup["Cleanup handlers<br/>[cleanup.go]"]
  node_spinner["Progress UI<br/>[spinner.go]"]
  node_errors["Error handling<br/>[errors.go]"]
  node_logging["Logging"]
end

node_user(("CLI user"))
node_gitremote["Template repository"]
node_licensehost["License catalog"]

node_user -->|"runs"| node_main
node_main -->|"executes"| node_root
node_root -->|"registers commands"| node_newcmd
node_root -->|"starts cleanup"| node_cleanup
node_root -->|"sets verbosity"| node_logging
node_newcmd -->|"validates and reads"| node_options
node_newcmd -->|"runs progress"| node_spinner
node_newcmd -->|"requests prompts"| node_prompts
node_newcmd -->|"parses config"| node_configparse
node_newcmd -->|"collects resources"| node_resources
node_newcmd -->|"resolves license"| node_license
node_newcmd -->|"writes files"| node_filewrite
node_newcmd -->|"initializes Git"| node_gitops
node_newcmd -->|"schedules cleanup"| node_cleanup
node_newcmd -->|"formats errors"| node_errors
node_newcmd -->|"reports progress"| node_logging
node_options -->|"clones source"| node_gitops
node_gitops -->|"clones repository"| node_gitremote
node_prompts -->|"fetches choices"| node_license
node_newcmd -->|"resolves variables"| node_variables
node_license -->|"fetches catalog"| node_licensehost
node_checkcmd -->|"wraps errors"| node_errors
node_healthcmd -->|"checks Git"| node_gitops

click node_main "https://github.com/caffeine-addictt/waku/blob/main/main.go"
click node_root "https://github.com/caffeine-addictt/waku/blob/main/cmd/root.go"
click node_newcmd "https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/new.go"
click node_checkcmd "https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/check.go"
click node_healthcmd "https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/healthcheck.go"
click node_options "https://github.com/caffeine-addictt/waku/blob/main/cmd/options/new.go"
click node_prompts "https://github.com/caffeine-addictt/waku/blob/main/internal/template/prompting.go"
click node_configparse "https://github.com/caffeine-addictt/waku/blob/main/internal/template/parse_config.go"
click node_resources "https://github.com/caffeine-addictt/waku/blob/main/internal/template/resource.go"
click node_templatefiles "https://github.com/caffeine-addictt/waku/blob/main/internal/template/template.go"
click node_configtypes "https://github.com/caffeine-addictt/waku/tree/main/pkg/config"
click node_license "https://github.com/caffeine-addictt/waku/blob/main/internal/license/store.go"
click node_filewrite "https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/new.go"
click node_gitops "https://github.com/caffeine-addictt/waku/tree/main/internal/git"
click node_cleanup "https://github.com/caffeine-addictt/waku/blob/main/cmd/cleanup/cleanup.go"
click node_spinner "https://github.com/caffeine-addictt/waku/blob/main/cmd/ui/spinner.go"
click node_errors "https://github.com/caffeine-addictt/waku/blob/main/internal/errors/errors.go"
click node_logging "https://github.com/caffeine-addictt/waku/tree/main/pkg/log"
click node_variables "https://github.com/caffeine-addictt/waku/blob/main/pkg/config/variables.go"

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_root,node_checkcmd,node_healthcmd,node_user toneBlue
class node_newcmd,node_options,node_license,node_filewrite toneAmber
class node_prompts,node_configparse,node_resources,node_templatefiles,node_configtypes,node_variables toneMint
class node_gitops toneRose
class node_cleanup,node_spinner,node_errors,node_logging,node_gitremote,node_licensehost toneIndigo
```

## Components

### CLI entrypoints

- [Program entry](https://github.com/caffeine-addictt/waku/blob/main/main.go): `main.go`
- [Command root](https://github.com/caffeine-addictt/waku/blob/main/cmd/root.go): `cmd/root.go`
- [Template check](https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/check.go): `cmd/commands/check.go`
- [Git healthcheck](https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/healthcheck.go): `cmd/commands/healthcheck.go`

### Project creation

- [New project](https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/new.go): `cmd/commands/new.go`
- [New options](https://github.com/caffeine-addictt/waku/blob/main/cmd/options/new.go): `cmd/options/new.go`
- [License selection](https://github.com/caffeine-addictt/waku/blob/main/internal/license/store.go): `internal/license/store.go`
- [Generated files](https://github.com/caffeine-addictt/waku/blob/main/cmd/commands/new.go): `cmd/commands/new.go`

### Template processing

- [Prompt selection](https://github.com/caffeine-addictt/waku/blob/main/internal/template/prompting.go): `internal/template/prompting.go`
- [Template config](https://github.com/caffeine-addictt/waku/blob/main/internal/template/parse_config.go): `internal/template/parse_config.go`
- [Style resources](https://github.com/caffeine-addictt/waku/blob/main/internal/template/resource.go): `internal/template/resource.go`
- [Template parsing](https://github.com/caffeine-addictt/waku/blob/main/internal/template/template.go): `internal/template/template.go`
- [Template config model](https://github.com/caffeine-addictt/waku/tree/main/pkg/config): `pkg/config`
- [Prompt variables](https://github.com/caffeine-addictt/waku/blob/main/pkg/config/variables.go): `pkg/config/variables.go`

### External integrations

- [Git operations](https://github.com/caffeine-addictt/waku/tree/main/internal/git): `internal/git`

### Shared support

- [Cleanup handlers](https://github.com/caffeine-addictt/waku/blob/main/cmd/cleanup/cleanup.go): `cmd/cleanup/cleanup.go`
- [Progress UI](https://github.com/caffeine-addictt/waku/blob/main/cmd/ui/spinner.go): `cmd/ui/spinner.go`
- [Error handling](https://github.com/caffeine-addictt/waku/blob/main/internal/errors/errors.go): `internal/errors/errors.go`
- [Logging](https://github.com/caffeine-addictt/waku/tree/main/pkg/log): `pkg/log`

### Other components

- **CLI user**
- **Template repository**
- **License catalog**

## Connections

- CLI user → Program entry: runs (evidence: `README.md`)
- Program entry → Command root: executes (evidence: `main.go`)
- Command root → New project: registers commands (evidence: `cmd/root.go`)
- Command root → Cleanup handlers: starts cleanup (evidence: `cmd/root.go`)
- Command root → Logging: sets verbosity (evidence: `cmd/root.go`)
- New project → New options: validates and reads (evidence: `cmd/commands/new.go`)
- New project → Progress UI: runs progress (evidence: `cmd/commands/new.go`)
- New project → Prompt selection: requests prompts (evidence: `cmd/commands/new.go`)
- New project → Template config: parses config (evidence: `cmd/commands/new.go`)
- New project → Style resources: collects resources (evidence: `cmd/commands/new.go`)
- New project → License selection: resolves license (evidence: `cmd/commands/new.go`)
- New project → Generated files: writes files (evidence: `cmd/commands/new.go`)
- New project → Git operations: initializes Git (evidence: `cmd/commands/new.go`)
- New project → Cleanup handlers: schedules cleanup (evidence: `cmd/commands/new.go`)
- New project → Error handling: formats errors (evidence: `cmd/commands/new.go`)
- New project → Logging: reports progress (evidence: `cmd/commands/new.go`)
- New options → Git operations: clones source (evidence: `cmd/options/new.go`)
- Git operations → Template repository: clones repository (evidence: `internal/git/clone.go`)
- Prompt selection → License selection: fetches choices (evidence: `internal/template/prompting.go`)
- New project → Prompt variables: resolves variables (evidence: `cmd/commands/new.go`)
- License selection → License catalog: fetches catalog (evidence: `internal/license/store.go`)
- Template check → Error handling: wraps errors (evidence: `cmd/commands/check.go`)
- Git healthcheck → Git operations: checks Git (evidence: `cmd/commands/healthcheck.go`)
