원클릭으로
architecture-diagram
Generate a Mermaid architecture diagram derived from application components and infrastructure context data
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Generate a Mermaid architecture diagram derived from application components and infrastructure context data
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Generate Azure infrastructure as Bicep code from planning data
Generate Azure infrastructure as Terraform code from planning data
Configure an individual application component by mapping it to an Azure service with SKU, region, and service-specific settings
Document source control, CI/CD platform, environments, deployment process, and quality gates for the application
Read all planning data, propose relevant ADR topics, and generate Architecture Decision Records following the project template
Gather network topology, landing zones, existing resources, and connectivity requirements for Azure infrastructure planning
| name | architecture-diagram |
| description | Generate a Mermaid architecture diagram derived from application components and infrastructure context data |
This skill generates a Mermaid graph TB diagram that visualizes the application architecture, including network topology and component relationships. It generates infra/application-architecture/architecture-diagram.md.
Unlike other skills, this one primarily derives the diagram from existing planning data rather than asking many questions. The goal is to produce a useful diagram with minimal interaction.
The generated file will be displayed in the UI when the user runs npx @zureltd/az-infra-harness and navigates to the Application Architecture section.
Run this skill when:
/application-components)/infrastructure-context)/architecture-diagramRead all available planning data to derive the diagram. Gather from:
infra/application-definition/application-components.md — component names and typesinfra/application-architecture/components/*.json — Azure services for each componentinfra/context/infrastructure-context.md — network topology (hub VNet, spoke VNet, subnets)infra/context/platform-context.md — shared services (Key Vault, Log Analytics, Container Registry)If application-components.md doesn't exist, stop:
I need application components to generate a diagram. Please run /application-components first.
Check whether infra/application-architecture/architecture-diagram.md already exists.
If existing diagram found:
I found an existing architecture diagram. Would you like to:
1. Regenerate it based on your current planning data (overwrites existing)
2. Update it manually (I'll show you the current diagram and ask what to change)
3. Keep the existing diagram as-is
Wait for the user's choice.
Analyze the planning data and build a mental model of the diagram:
Network layers to represent (based on infrastructure-context.md):
Component placement (based on component type and Azure service):
Platform services (based on platform-context.md):
Present the proposed diagram structure before generating the Mermaid code:
Based on your planning data, here's the architecture I'll diagram:
**Network layers:**
- [Hub VNet with Firewall + Application Gateway — if hub-spoke]
- [Spoke VNet with: Web tier (subnet), App tier (subnet), Data tier (subnet)]
**Components:**
- [Component 1] → [Azure Service] → [subnet placement]
- [Component 2] → [Azure Service] → [subnet placement]
- [Component 3] → [Azure Service] → [subnet placement]
**Connections:**
- Internet → Application Gateway → [frontend component]
- [Frontend] → [backend API]
- [Backend] → [database]
- [All components] → Key Vault (secrets)
- [All components] → Log Analytics (logging)
Does this look right? Shall I generate the diagram, or would you like to adjust anything?
Wait for the user's confirmation or corrections before generating.
Once confirmed, generate the Mermaid diagram following this structure:
# Architecture Diagram
```mermaid
graph TB
Internet((Internet))
subgraph HubVNet["Hub VNet (10.0.0.0/16)"]
FW[Azure Firewall]
AppGW[Application Gateway + WAF]
end
subgraph SpokeVNet["Spoke VNet (10.1.0.0/16)"]
subgraph WebTier["Web Tier Subnet"]
SWA[Static Web App / Frontend]
end
subgraph AppTier["App Tier Subnet"]
ACA[Container Apps - API]
end
subgraph DataTier["Data Tier Subnet"]
SQL[(Azure SQL Database)]
end
end
subgraph PlatformServices["Platform Services"]
KV[Key Vault]
AI[Application Insights]
end
OnPrem[On-Premises Systems]
Internet --> AppGW
AppGW --> SWA
SWA --> ACA
ACA --> SQL
ACA -.-> KV
ACA -.-> AI
OnPrem -- Private Connection --> FW
FW --> SpokeVNet
**Diagram rules:**
- Use `graph TB` (top to bottom) direction
- Use `subgraph` blocks to represent VNets and subnets
- Use `[(name)]` for databases
- Use `((name))` for external systems (Internet, On-premises)
- Use `[name]` for services and components
- Use solid arrows (`-->`) for primary traffic flows
- Use dotted arrows (`-.->`) for supporting services (Key Vault, logging)
- Label subnet blocks with their address space if known
- Include at least the hub and spoke VNets if hub-spoke topology is used
**Adapt the diagram** to the actual components and services found in the planning data — do not hardcode the example content.
---
### Step 6: Validation
Before saving:
- ✅ File starts with `# Architecture Diagram`
- ✅ Contains a valid Mermaid code block (` ```mermaid `)
- ✅ Diagram uses `graph TB`
- ✅ All components from `application-components.md` appear in the diagram
- ✅ At least one subgraph block is present
- ✅ No placeholder text remains
---
### Step 7: Save File
**Target location:** `infra/application-architecture/architecture-diagram.md`
**Pre-save checks:**
1. Verify directory `infra/application-architecture/` exists
2. If the directory does not exist, create it (including all parent directories) and continue.
**Error handling:**
- If write fails: "Error: Failed to write file. Please check file permissions and try again."
---
### Step 8: Confirm to User
✅ Created architecture diagram successfully!
📄 File location: infra/application-architecture/architecture-diagram.md
🌐 To view in the UI:
npx @zureltd/az-infra-harnessThe diagram shows [brief summary: e.g., "your hub-spoke network with Container Apps, SQL Database, and platform services"].
The next step is to run /deployment-strategy to document your deployment strategy.
---
## Error Handling
### If application-components.md is missing:
- Stop with clear message: "Please run /application-components first to define your components."
### If infrastructure-context.md is missing:
- Generate diagram with a flat (no hub-spoke) layout
- Note: "No infrastructure context found — generating a simplified diagram without network topology. Run /infrastructure-context to add network details."
### If component JSON files are missing:
- Use generic Azure service labels based on component type
- Note in the confirmation: "Some components aren't configured yet — I've used generic labels. Run /configure-component to add specific Azure services."
### If directory doesn't exist:
- Create the directory (including all parent directories) and continue
---
## Example Interaction
**Agent:** "Based on your planning data, here's what I'll diagram:
**Network layers:**
- Hub VNet (10.0.0.0/16) with Azure Firewall and Application Gateway
- Spoke VNet (10.1.0.0/16) with Web, App, and Data tier subnets
**Components:**
- Web Frontend (Container Apps) → App tier
- API Backend (Container Apps) → App tier
- Customer Database (Azure SQL) → Data tier
- Application Gateway (Azure Application Gateway) → Hub
**Connections:** Internet → App GW → Frontend → API → Database, with Key Vault and Application Insights as shared services.
Does this look right? Shall I generate the diagram?"
**User:** "Yes, generate it."
**Agent:** [Generates Mermaid diagram]
**Agent:** "✅ Created architecture diagram successfully!"
---
## Reference Files
- **Sample output**: `infra/application-architecture/architecture-diagram.md`
- **Component data**: `infra/application-definition/application-components.md`
- **Component config**: `infra/application-architecture/components/*.json`
- **Network data**: `infra/context/infrastructure-context.md`
- **Platform data**: `infra/context/platform-context.md`
- **Documentation**: `DATA-STRUCTURE.md`
---
## Success Criteria
- ✅ File created at `infra/application-architecture/architecture-diagram.md`
- ✅ Contains a valid Mermaid `graph TB` diagram
- ✅ All defined application components appear in the diagram
- ✅ Network topology matches the infrastructure context data
- ✅ User confirmed the diagram structure before generation
- ✅ File is not empty and is readable
- ✅ User is informed of successful creation
- ✅ UI displays the diagram after browser refresh