# natonathan/shipyard architecture

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

- Interactive diagram: https://gitdiagram.com/natonathan/shipyard
- Repository: https://github.com/natonathan/shipyard
- Video tour (about a minute): https://gitdiagram.com/natonathan/shipyard/video

## Overview

Shipyard is a CLI for managing semantic versions, changelogs, and releases across single-package repositories and monorepos. Its principal workflow records markdown consignments, lets users inspect pending changes, then calculates and applies dependency-aware version bumps, updates changelogs and history, and creates Git tags. Separate branches cover repository initialization and package detection, configuration and templates, release notes and optional GitHub releases, prereleases, and self-upgrades. Edges are limited to relationships shown in excerpts or the README; unsampled command wiring is not inferred.

Main entry points: [`internal/commands`](https://github.com/natonathan/shipyard/tree/main/internal/commands) (Commands), [`internal/version`](https://github.com/natonathan/shipyard/tree/main/internal/version) (Version planning), [`cmd/shipyard/main.go`](https://github.com/natonathan/shipyard/blob/main/cmd/shipyard/main.go) (CLI entry), [`internal/changelog/generate.go`](https://github.com/natonathan/shipyard/blob/main/internal/changelog/generate.go) (Changelog generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_entry["CLI entry<br/>[main.go]"]
  node_commands["Commands"]
  node_output["CLI output"]
end

subgraph group_domain["Release domain"]
  node_consignments["Consignments<br/>[read.go]"]
  node_config["Configuration"]
  node_detect["Package detection<br/>[packages.go]"]
  node_graph["Dependency graph<br/>[build.go]"]
  node_version["Version planning"]
  node_semver["Semantic versions<br/>[version.go]"]
  node_changelog["Changelog generator<br/>[generate.go]"]
  node_templates["Template engine<br/>[load.go]"]
end

subgraph group_repo["Repository state"]
  node_history["Release history"]
end

subgraph group_integrations["Integrations"]
  node_ecosystem["Ecosystem adapters<br/>[python.go]"]
  node_git["Git operations"]
  node_github["GitHub releases<br/>[release.go]"]
  node_upgrade["Self-upgrade<br/>[upgrader.go]"]
end

node_user(("Engineer"))

node_user -->|"runs CLI"| node_entry
node_entry -->|"registers commands"| node_commands
node_commands -->|"writes changes"| node_consignments
node_commands -->|"loads settings"| node_config
node_commands -.->|"discovers packages"| node_detect
node_commands -->|"reads pending changes"| node_consignments
node_commands -->|"builds routes"| node_graph
node_commands -->|"calculates bumps"| node_version
node_version -->|"uses versions"| node_semver
node_version -->|"propagates changes"| node_graph
node_commands -->|"updates package versions"| node_ecosystem
node_commands -->|"generates logs"| node_changelog
node_changelog -->|"renders templates"| node_templates
node_commands -->|"appends release history"| node_history
node_commands -->|"creates tags"| node_git
node_commands -.->|"shows results"| node_output
node_commands -.->|"creates releases"| node_github
node_commands -.->|"runs upgrade"| node_upgrade

click node_entry "https://github.com/natonathan/shipyard/blob/main/cmd/shipyard/main.go"
click node_commands "https://github.com/natonathan/shipyard/tree/main/internal/commands"
click node_consignments "https://github.com/natonathan/shipyard/blob/main/internal/consignment/read.go"
click node_config "https://github.com/natonathan/shipyard/tree/main/internal/config"
click node_detect "https://github.com/natonathan/shipyard/blob/main/internal/detect/packages.go"
click node_graph "https://github.com/natonathan/shipyard/blob/main/internal/graph/build.go"
click node_version "https://github.com/natonathan/shipyard/tree/main/internal/version"
click node_semver "https://github.com/natonathan/shipyard/blob/main/pkg/semver/version.go"
click node_ecosystem "https://github.com/natonathan/shipyard/blob/main/internal/ecosystem/python.go"
click node_changelog "https://github.com/natonathan/shipyard/blob/main/internal/changelog/generate.go"
click node_templates "https://github.com/natonathan/shipyard/blob/main/internal/template/load.go"
click node_history "https://github.com/natonathan/shipyard/tree/main/internal/history"
click node_git "https://github.com/natonathan/shipyard/tree/main/internal/git"
click node_github "https://github.com/natonathan/shipyard/blob/main/internal/github/release.go"
click node_upgrade "https://github.com/natonathan/shipyard/blob/main/internal/upgrade/upgrader.go"
click node_output "https://github.com/natonathan/shipyard/tree/main/internal/ui"

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_entry,node_commands,node_output toneBlue
class node_consignments,node_config,node_detect,node_graph,node_version,node_semver,node_changelog,node_templates toneAmber
class node_history toneMint
class node_ecosystem,node_git,node_github,node_upgrade toneRose
class node_user toneIndigo
```

## Components

### CLI workflow

- [CLI entry](https://github.com/natonathan/shipyard/blob/main/cmd/shipyard/main.go): `cmd/shipyard/main.go`
- [Commands](https://github.com/natonathan/shipyard/tree/main/internal/commands): `internal/commands`
- [CLI output](https://github.com/natonathan/shipyard/tree/main/internal/ui): `internal/ui`

### Release domain

- [Consignments](https://github.com/natonathan/shipyard/blob/main/internal/consignment/read.go): `internal/consignment/read.go`
- [Configuration](https://github.com/natonathan/shipyard/tree/main/internal/config): `internal/config`
- [Package detection](https://github.com/natonathan/shipyard/blob/main/internal/detect/packages.go): `internal/detect/packages.go`
- [Dependency graph](https://github.com/natonathan/shipyard/blob/main/internal/graph/build.go): `internal/graph/build.go`
- [Version planning](https://github.com/natonathan/shipyard/tree/main/internal/version): `internal/version`
- [Semantic versions](https://github.com/natonathan/shipyard/blob/main/pkg/semver/version.go): `pkg/semver/version.go`
- [Changelog generator](https://github.com/natonathan/shipyard/blob/main/internal/changelog/generate.go): `internal/changelog/generate.go`
- [Template engine](https://github.com/natonathan/shipyard/blob/main/internal/template/load.go): `internal/template/load.go`

### Repository state

- [Release history](https://github.com/natonathan/shipyard/tree/main/internal/history): `internal/history`

### Integrations

- [Ecosystem adapters](https://github.com/natonathan/shipyard/blob/main/internal/ecosystem/python.go): `internal/ecosystem/python.go`
- [Git operations](https://github.com/natonathan/shipyard/tree/main/internal/git): `internal/git`
- [GitHub releases](https://github.com/natonathan/shipyard/blob/main/internal/github/release.go): `internal/github/release.go`
- [Self-upgrade](https://github.com/natonathan/shipyard/blob/main/internal/upgrade/upgrader.go): `internal/upgrade/upgrader.go`

### Other components

- **Engineer**

## Connections

- Engineer → CLI entry: runs CLI (evidence: `cmd/shipyard/main.go`)
- CLI entry → Commands: registers commands (evidence: `cmd/shipyard/main.go`)
- Commands → Consignments: writes changes (evidence: `internal/commands/add.go`)
- Commands → Configuration: loads settings (evidence: `internal/commands/add.go`)
- Commands → Package detection: discovers packages
- Commands → Consignments: reads pending changes (evidence: `internal/commands/version.go`)
- Commands → Dependency graph: builds routes (evidence: `internal/commands/version.go`)
- Commands → Version planning: calculates bumps (evidence: `internal/commands/version.go`)
- Version planning → Semantic versions: uses versions (evidence: `internal/version/apply.go`)
- Version planning → Dependency graph: propagates changes (evidence: `internal/version/propagate.go`)
- Commands → Ecosystem adapters: updates package versions (evidence: `internal/commands/version.go`)
- Commands → Changelog generator: generates logs (evidence: `internal/commands/version.go`)
- Changelog generator → Template engine: renders templates (evidence: `internal/changelog/generate.go`)
- Commands → Release history: appends release history (evidence: `internal/commands/version.go`)
- Commands → Git operations: creates tags (evidence: `internal/commands/version.go`)
- Commands → CLI output: shows results (evidence: `internal/commands/version.go`)
- Commands → GitHub releases: creates releases
- Commands → Self-upgrade: runs upgrade
