microsoft/architecture-diagrams
Architecture diagram authoring for cloud infrastructure: parse Azure IaC, map relationships, and render either ASCII block diagrams or Mermaid flowcharts based on the caller's chosen output format
npx skills add https://github.com/microsoft/hve-core --skill architecture-diagrams
Use this skill to turn infrastructure source files into readable architecture diagrams for reviews, ADRs, and design discussions. The skill is optimized for cloud systems and assumes the primary inputs are Terraform, Bicep, ARM templates, shell scripts, Kubernetes manifests, and Docker/Compose files. It focuses on structure, relationships, and boundary clarity rather than rendered graphics.
This skill produces either ASCII block diagrams or Mermaid flowcharts. Neither is the default: the caller or surrounding context chooses the output format for each diagram. When the caller does not state a preference, ask which format they want before generating. Follow the ASCII Conventions or the Mermaid Conventions below depending on the selected format, and keep the structure, boundaries, and relationships identical across formats.
Architecture diagram format selection applies beyond ADRs. For standalone usage, consult the root state file at .copilot-tracking/architecture-diagrams/state.json. If that file is absent, create it when a format is chosen.
{
"userPreferences": {
"diagramFormat": "mermaid"
},
"repoVisibility": "private"
}
The userPreferences.diagramFormat value must be either ascii or mermaid. The repoVisibility field is optional and may be used by surrounding workflows when they need to distinguish public and private repositories. Resolution order is:
.copilot-tracking/architecture-diagrams/state.json.Follow this sequence when authoring a diagram:
Use consistent box notation and alignment:
+------------------+ +------------------+
| Service Name |----->| Service Name |
+------------------+ +------------------+
Use the following conventions for readability:
| Arrow | Meaning |
|---------|----------------------------------|
| ----> | Data flow or dependency |
| <---> | Bidirectional connection |
| - - > | Optional or conditional resource |
Group related components inside a larger boundary when they share a network, account, or deployment domain.
Use a full box for a strong boundary:
+-----------------------------------------------+
| Resource Group |
| |
| +-------------+ +-------------+ |
| | VNet |------->| Subnet | |
| +-------------+ +-------------+ |
| |
+-----------------------------------------------+
Use labeled boundaries for secondary or nested boundaries:
:--- Virtual Network ---------------------------:
: :
: +-------------+ +-------------+ :
: | Subnet A |------->| Subnet B | :
: +-------------+ +-------------+ :
: :
:-----------------------------------------------:
When the caller chooses Mermaid output, render a mermaid fenced code block using a flowchart that expresses the same structure, boundaries, and relationships you would draw in ASCII.
flowchart TB for top-to-bottom topologies and flowchart LR when the main flow reads left to right.lb["Load Balancer"], and use [("...")] for data stores.subgraph block, such as a VNet, subnet, or resource group.--> for data flow or dependency, <--> for bidirectional connections, and -. optional .-> for optional or conditional links.flowchart TB
subgraph rg["Resource Group"]
lb["Load Balancer"]
subgraph subnet["App Subnet"]
vm1["VM 1"]
vm2["VM 2"]
end
db[("SQL Database")]
end
lb --> vm1
lb --> vm2
vm1 --> db
vm2 --> db
When reading infrastructure sources, extract:
Use this structure for every diagram:
## <Name> Architecture
[diagram in the selected format]
### Legend
[Arrow meanings from this diagram; reference the arrow types above]
### Key Relationships
[Notable connections and dependencies]
The title should use title case and follow the pattern <Name> Architecture. The legend should explain any special symbols used, and the key relationships section should focus on the most important dependencies or data flows.
## AKS Platform Architecture
+===============================================================+
| Resource Group |
| :--- Virtual Network ------------------------------------: |
| : +------------------+ +------------------+ : |
| : | NAT Gateway |------->| AKS Cluster | : |
| : +------------------+ +--------+---------+ : |
| : +--------v---------+ : |
| : | ACR | : |
| : +------------------+ : |
|:----------------------------------------------------------:|
| +------------------+ +------------------+ |
| | Log Analytics |<-------| App Insights | |
| +------------------+ +------------------+ |
+===============================================================+
### Legend
See the arrow types above. Additional symbols: `====` primary boundary, `:---:` secondary boundary.
### Key Relationships
* AKS pulls images from ACR through the network boundary.
* NAT Gateway provides egress for AKS workloads.
The same architecture in Mermaid form expresses identical structure, boundaries, and relationships:
## AKS Platform Architecture
flowchart TB
subgraph rg["Resource Group"]
subgraph vnet["Virtual Network"]
nat["NAT Gateway"]
aks["AKS Cluster"]
acr["ACR"]
end
appinsights["App Insights"]
logs[("Log Analytics")]
end
nat --> aks
aks --> acr
appinsights --> logs
### Legend
See the arrow types above; `subgraph` blocks denote network or resource boundaries.
### Key Relationships
* AKS pulls images from ACR through the network boundary.
* NAT Gateway provides egress for AKS workloads.
Take microsoft/architecture-diagrams from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.