homelab-diagram

A script, written with Claude Code, that turns a YAML inventory of a homelab into a large SVG and PNG network diagram, plus a CLAUDE.md for adapting it.

  • 40 GitHub stars
  • ⚖️ MIT

Last verified: write-up checked

git clone https://github.com/Goblinmine/homelab-diagram
homelab-diagram — skill preview

What it is

This is a worked example more than a product. The author posted a network diagram on r/homelab, built it with Claude Code in about 60 rounds of feedback, then cleaned the code up for release. The content comes from one inventory.yaml (VLANs, devices, switch ports, port forwards, Proxmox hardware, TrueNAS pools, containers), while the layout is hand-placed SVG drawn by build.py. What makes it useful as a skill is the CLAUDE.md in the repository. It documents how the code is structured, which parts of the layout are hardcoded, the questions an agent should ask about your network, the render-and-check loop and the design rules the diagram follows. The README's "How it was made" section lists the steps: gather facts with read-only checks of live systems, draft, iterate, then publish a cleaned copy that renders exactly the posted image. Code and glyph icons are MIT. Fonts are Fira Sans and Fira Code under the SIL Open Font License and are not included. Star count was 39 on 2026-11-07.

Who it's for

  • Homelab owners who want an r/homelab-style diagram of their own network
  • People who want a worked example of steering Claude Code through about 60 render-and-feedback rounds

Requirements

Requirements

  • Python 3 with PyYAML; Pillow is optional but makes label widths exact
  • rsvg-convert (librsvg) for the PNG, and the fonts Fira Sans and Fira Code installed

Setup

  1. Step 1

    bash
    git clone https://github.com/Goblinmine/homelab-diagram
  2. Step 2

    bash
    python3 fetch_icons.py
  3. Step 3

    bash
    python3 build.py

سكربت كُتب بمساعدة Claude Code يحوّل ملف YAML يصف المختبر المنزلي إلى مخطط شبكة كبير بصيغتي SVG وPNG، مع ملف CLAUDE.md لتكييفه.

Examples

Ask Claude Code to adapt it

Prompt
prompt
help me make this diagram for my homelab

Expected output: The README suggests cloning the repo, opening it in Claude Code and saying something like this. The agent reads CLAUDE.md, interviews you about your network and rewrites inventory.yaml and build.py.

Build the diagram

bash
bash
python3 fetch_icons.py          # downloads the service icons into icons/ (once)
python3 build.py                # → out/homelab.svg + out/homelab.png (redacted)
python3 build.py --unredacted   # → out/homelab-unredacted.svg + .png

What it does: The default render replaces the real domain with redacted.com and gives SSIDs generic names so the PNG can be posted; the unredacted flag keeps real values.

Pros & cons

Pros

  • Pro:Link line width shows negotiated speed (10G, 2.5G, 1G, 100M) and every switch port shows its VLANs
  • Pro:Redacted by default, so the picture can be posted publicly, with a flag for a private version
  • Pro:Includes the author's real prompts, such as asking for line thickness to show link speed and dropping interface names

Cons

  • Con:The README says plainly that it is not a general tool: the layout is hand-placed in build.py for the author's own network, so expect to move coordinates
  • Con:Service icons are downloaded from homarr-labs/dashboard-icons and the logos belong to their projects
  • Con:Brand new: created 2026-11-07 with 39 stars on the same day