--- name: architecture-diagram description: Generate detailed layered architecture diagrams as self-contained HTML artifacts with inline SVG icons, CSS Grid nested container layout, SVG path connection overlays, and color-coded connection legends. Use when the user asks to create architecture diagrams, infrastructure diagrams, system topology diagrams, network diagrams, cloud architecture visuals, deployment diagrams, integration flow diagrams, or any request involving visual representation of system components, their containment hierarchy, and interconnections. Triggers on terms like "architecture diagram", "infra diagram", "system diagram", "topology", "deployment diagram", "network diagram", "integration architecture", or when the user provides a system description and asks for a visual/diagram. metadata: version: 1.0.0 --- # Architecture Diagram Generator Produces self-contained `.html` files: inline SVG icons, CSS Grid nested zones, JS-driven SVG connection overlay with color-coded semantic line types and arrowhead markers. Zero external dependencies. ## Workflow 1. **Parse** user input → extract: components (with descriptions), containment hierarchy (zones/nesting), connections (with semantic types), and any provider context 2. **Read** `references/icons.md` — select or create icons for each component 3. **Read** `references/layout-patterns.md` — choose topology pattern, set grid-template-columns 4. **Read** `references/connections.md` — define connection array with types, side-forcing, routing 5. **Start from** `assets/template.html` — use its CSS/JS structure as the base 6. **Assemble** the HTML: - Set `{{DIAGRAM_TITLE}}`, `{{BG_COLOR}}`, `{{MAX_WIDTH}}` - Populate `{{LEGEND_ITEMS}}` — one entry per connection type used - Build zone hierarchy as nested `div.zone > span.zone-label + div.zone-content` - Place nodes with `data-node-id`, each containing: `.node-icon` (inline SVG), `.node-title`, `.node-desc` - Populate the `connections` JS array - Apply provider theming if applicable 7. **Output** final `.html` to the working directory or user-specified path ## Node construction Every node must have: - Unique `data-node-id` (semantic: `fusion-hcm`, `edi-adaptor`, not `node-7`) - `.node-icon` with inline SVG from the icon registry (or custom-generated following registry constraints) - `.node-title` — short name (1–3 words, bold) - `.node-desc` — extended description text (protocols, module lists, capabilities). Populate this whenever the user provides detail beyond just a name. This is critical for professional-quality diagrams. ## Key structural invariants - Every `div.zone` has exactly one `span.zone-label` and one `div.zone-content` - Every `div.zone-content` has explicit `style="grid-template-columns: ..."` - Zone depth class (`zone-depth-0` to `zone-depth-3`) matches actual nesting level - All SVG icons are inline inside `.node-icon` — no external image references - Connection overlay SVG with `` (arrow markers for each color) sits after the diagram div - Connection renderer `