python-diagrams
Skill26 starsChanged 18 days agoMITView on GitHub
Documentation-only reference template for rendering Azure architecture diagrams with real product icons using the Python `diagrams` library (Graphviz backend), producing paired PNG + SVG output. Use when a squad role needs a committed, file-based icon diagram (HLD/LLD) instead of Mermaid, especially for the Squad Azure Architect. Templates never run from this package; a consumer copies them on demand.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- roughboy99/aiautobase-claude-skillstheir own version, first seen Aug 10, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- roughboy99/aiautobase-claude-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- squad-learnings-tenantSkill
- azure-scaffoldSkill
- sql-migration-advisorSkill
- squadSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Read installed squad/references/responsible-use.md once.
- Very specific: line 63
Verify both before authoring with python scripts/verify_installation.py (it confirms diagrams imports and Graphviz dot renders).
- Very specific: line 80
Run it. Prefer uv — it supplies Python and diagrams even when neither is on PATH:
- Very specific: line 88
Commit the emitted azure-webapp-lld.png and .svg.
- Very specific: line 92
Every generator imports diagram_kwargs from diagram_io instead of setting outformat inline, so all diagrams render both a PNG and an SVG …
- Distinctive: line 106
Import the specific node class per resource.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
-->Python Diagrams
Read installed squad/references/responsible-use.md once.
Overview
This skill bundles a documentation-only reference template for rendering Azure architecture
diagrams with real Azure product icons using the Python diagrams
library on a Graphviz backend. It is the file-based, committed-artifact counterpart to the squad's
Mermaid default and the interactive drawio MCP path: where Mermaid renders inline and draw.io opens
an editor, this skill writes paired .png + .svg siblings straight into the consumer repo.
Like every other reference template in the squad package (see .github/skills/azure-scaffold/ and
.github/skills/squad/), nothing here runs from the package. The consumer copies a generator into
their repo, adjusts it to match their Bicep or Terraform modules, and runs it. The package never reads
or writes the consumer's source tree.
This skill backs the diagram-rendering capability's non-MCP, file-output option documented in
squad-mcp-capability.instructions.md
("Out-of-Band Fallbacks → Python diagrams Library"). The library is the integration surface; no
.vscode/mcp.json entry is required.
When to use
- A role (typically the Squad Azure Architect) needs an HLD or LLD diagram with Azure icons persisted as a committed image, not an inline Mermaid block or a browser-only draw.io tab.
- You want the diagram to live next to the IaC and stay diffable in version control.
Does not: produce Mermaid (author that inline), drive the drawio MCP (that is the interactive
draw.io path), generate Bicep/Terraform, or deploy anything.
Bundled files
| File | Consumer destination (suggested) | Purpose |
| requirements.txt | merged into the repo's Python deps | Pins diagrams and graphviz; notes the Graphviz system prerequisite. |
| scripts/diagram_io.py | beside each generator (or on sys.path) | Shared output helper enforcing the paired PNG + SVG dual-output contract. |
| scripts/verify_installation.py | run once after install | Confirms diagrams imports and Graphviz dot renders. |
| templates/azure-webapp-lld.py | docs/architecture/azure_webapp_lld.py | Azure internal web app LLD generator with real Azure icons. |
Prerequisites
- Graphviz (system binary, not pip-installable) on PATH:
- Windows:
winget install Graphviz.Graphviz(machine-scope; run elevated, then reopen the shell) - macOS:
brew install graphviz - Linux:
apt-get install graphviz
- Windows:
- Python packages:
pip install -r requirements.txt(oruv run --with diagrams ...).
Verify both before authoring with python scripts/verify_installation.py (it confirms diagrams
imports and Graphviz dot renders).
Windows gotchas. On a typical Windows dev box,
pythonis often the Microsoft Store stub (it prints "Python was not found" and does nothing), and Graphviz may be installed but not on PATH. Ifpythonfails, use thepylauncher oruv(see Usage). If a render fails withExecutableNotFound/ "dot not found", Graphviz is installed but off PATH — prepend it for the session:$env:PATH = "C:\Program Files\Graphviz\bin;$env:PATH".
Usage
- Copy the bundled files; do not re-author them. Copy
scripts/diagram_io.pyverbatim and a generator fromtemplates/into the consumer repo (for an LLD, copytemplates/azure-webapp-lld.pynext todiagram_io.pyunderdocs/architecture/). The bundleddiagram_io.pyalready emits PNG + SVG natively — never rewrite it or invent a custom output helper. - Edit only the generator's nodes and edges to match the project's actual Bicep or Terraform modules. Keep every node a real node object (see Azure node reference).
Run it. Prefer
uv— it supplies Python anddiagramseven when neither is on PATH:uv run --with diagrams python azure-webapp-lld.pyFallbacks when
uvis absent:py azure-webapp-lld.py(the Windows launcher) orpython azure-webapp-lld.py. Ensure Graphvizdotis on PATH first (see Prerequisites).- Commit the emitted
azure-webapp-lld.pngand.svg.
Dual-output contract
Every generator imports diagram_kwargs from diagram_io instead of setting outformat inline, so
all diagrams render both a PNG and an SVG sibling with consistent naming. This keeps a
review-friendly raster (PNG) and a scalable vector (SVG) in sync from a single source of truth.
from diagrams import Diagram
from diagram_io import diagram_kwargs
with Diagram("My architecture", **diagram_kwargs("01-architecture", direction="LR")):
... # nodes and edgesAzure node reference
Import the specific node class per resource. Only use classes you have verified exist — do not
guess. Validate against the installed library before use, for example
python -c "import diagrams.azure.network as m; print(dir(m))", or browse the full catalog at
https://diagrams.mingrammer.com/docs/nodes/azure.
Common nodes, including the ones most often guessed wrong:
from diagrams.azure.compute import AppServices, ContainerInstances
from diagrams.azure.database import SQLDatabases, DatabaseForPostgresqlServers # NOT "DatabasesPostgreSQL"
from diagrams.azure.network import (
VirtualNetworks,
Subnets,
PrivateEndpoint,
ApplicationGateway,
Firewall, # Azure Firewall lives in network, NOT azure.general
NetworkSecurityGroupsClassic, # NOT "NetworkSecurityGroups"
)
from diagrams.azure.security import KeyVaults
from diagrams.azure.storage import StorageAccounts
from diagrams.azure.analytics import LogAnalyticsWorkspaces
from diagrams.azure.identity import ManagedIdentities, ActiveDirectoryEvery node must be a real node object — never a bare string. Model external actors (internet,
customer/API clients) with real nodes, since a Python str cannot take part in >>/<< edges and
will fail at render:
from diagrams.onprem.network import Internet # the public internet / external integrations
from diagrams.onprem.client import Users # external users / API consumersThe full Azure node catalog is at https://diagrams.mingrammer.com/docs/nodes/azure.
Fallback ladder
Per the capability map, the diagram-rendering order is: a draw.io MCP when configured → this Python
diagrams library for committed image output → Mermaid in chat or repository markdown when neither is
available. A role never blocks on a missing tool; it falls back and records which path it took.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

