Maintaining Architecture Diagrams & Docs
This guide explains how contributors and team members can maintain, update, and compile the architecture documentation and Graphviz diagrams.
Directory Conventions
Section titled “Directory Conventions”homectl/├── scripts/│ └── build-diagrams.sh # Automated compilation script├── docs/│ ├── src/│ │ ├── assets/│ │ │ └── architecture/ # Source .dot files and compiled .webp images│ │ │ ├── homectl-overall.dot│ │ │ ├── homectl-overall.webp│ │ │ ├── sonos.dot│ │ │ ├── sonos.webp│ │ │ ├── lutron.dot│ │ │ ├── lutron.webp│ │ │ ├── qolsys.dot│ │ │ ├── qolsys.webp│ │ │ ├── cast.dot│ │ │ ├── cast.webp│ │ │ ├── camera.dot│ │ │ └── camera.webp│ │ └── content/│ │ └── docs/│ │ └── architecture/ # Starlight Markdown documentation pagesPrerequisites
Section titled “Prerequisites”To edit and compile diagrams, install Graphviz:
# macOS (Homebrew)brew install graphviz
# Debian / Ubuntu Linuxsudo apt-get install -y graphvizVerify dot is available on your PATH:
dot -vUpdating an Architecture Diagram
Section titled “Updating an Architecture Diagram”1. Edit the Source .dot File
Section titled “1. Edit the Source .dot File”Edit the corresponding .dot file in docs/src/assets/architecture/.
Graphviz Styling Guidelines:
Section titled “Graphviz Styling Guidelines:”- Typography: Use clean system fonts:
fontname="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
- HTML Labels: Use HTML-like tables for multi-line nodes with subtitles:
node_name [label=<<table border="0" cellborder="0" cellspacing="2"><tr><td><font color="#0284c7"><b>Component Name</b></font></td></tr><tr><td><font color="#64748b" point-size="8">Protocol or Detail</font></td></tr></table>>,fillcolor="#ffffff",color="#0284c7"];
- Color Palette:
- Interactions / Clients: Blue (
#0284c7) - Agent Plugins & Skills: Purple (
#7c3aed) - Gateways & Servers: Green (
#059669) - Go Modules & Core: Amber (
#d97706) - Physical Hardware: Red / Orange (
#dc2626/#ea580c)
- Interactions / Clients: Blue (
2. Compile Diagrams to WebP
Section titled “2. Compile Diagrams to WebP”Run the automated build target from the repository root:
make diagramsOr execute the build script directly:
./scripts/build-diagrams.shWhat the script does:
Section titled “What the script does:”- Iterates over every
.dotfile indocs/src/assets/architecture/. - Runs
dot -Twebp "$dotfile" -o "${dotfile%.dot}.webp". - Automatically mirrors service diagrams to their respective plugin asset folders (e.g.,
plugins/sonos/assets/architecture.webp). - Prints output file sizes for inspection.
3. Verify the Starlight Documentation Site
Section titled “3. Verify the Starlight Documentation Site”After recompiling diagrams or updating Markdown pages, build the documentation site locally:
npm --prefix docs run buildOr start the live development preview:
npm --prefix docs run dev4. Git & Commit Guidelines
Section titled “4. Git & Commit Guidelines”- Commit
.dotand.webptogether: Always commit both the source Graphviz.dotfile and the generated.webpimage in the same commit. - Intermediate PNGs are gitignored: Intermediate
.pngfiles are ignored via.gitignoreto avoid repository bloat. - Conventional Commits: Use
docs(architecture): update sonos vertical with favorites flow.