$npx -y skills add vidanov/aws-architecture-diagram-skill --skill claudeAlways use when user asks to create, generate, or build an AWS architecture diagram, cloud infrastructure diagram, or system diagram with AWS services. Also activates for draw.io diagrams mentioning AWS services like Lambda, DynamoDB, S3, API Gateway, etc.
| 1 | # AWS Architecture Diagram Skill |
| 2 | |
| 3 | Generate AWS architecture diagrams as native `.drawio` files using official AWS Architecture Icons. Optionally export to PNG, SVG, or PDF with embedded XML (so exported files remain editable in draw.io). |
| 4 | |
| 5 | ## How to create a diagram |
| 6 | |
| 7 | 1. **Generate draw.io XML** in mxGraphModel format following the rules below |
| 8 | 2. **Write the XML** to a `.drawio` file using the Write tool |
| 9 | 3. **If the user requested an export format** (png, svg, pdf), export using the draw.io CLI (see Export section) |
| 10 | 4. **Open the result** with `open` (macOS), `xdg-open` (Linux), or print the path |
| 11 | |
| 12 | ## Layout Rules |
| 13 | |
| 14 | - **Left-to-right flow** for data/request path |
| 15 | - **UI/Frontend on the LEFT** (users access from left side) |
| 16 | - **Data sources / external systems on the RIGHT** |
| 17 | - Use horizontal lanes for parallel paths (top lane, bottom lane) |
| 18 | - **Minimum 220px horizontal spacing** between icons (room for edge labels) |
| 19 | - **Minimum 250px vertical spacing** between lanes |
| 20 | - Secondary/auxiliary services (monitoring, DLQ) go BELOW main flow with 280px+ gap |
| 21 | - Canvas: `pageWidth="2400" pageHeight="1400"`, viewport `dx="2800" dy="1600"` |
| 22 | - Always include a title block after the background rectangle: |
| 23 | ```xml |
| 24 | <mxCell value="<b>Diagram Title</b><br>Author | Date | Version" style="text;html=1;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=14;spacing=8;" vertex="1" parent="1"> |
| 25 | <mxGeometry x="40" y="30" width="420" height="60" as="geometry" /> |
| 26 | </mxCell> |
| 27 | ``` |
| 28 | |
| 29 | ## Icon Style |
| 30 | |
| 31 | - Icons are from draw.io's built-in `mxgraph.aws4` stencil library — the **official AWS Architecture Icons** (https://aws.amazon.com/architecture/icons/) |
| 32 | - Icon size: **78x78px** for main services, **65x65px** for secondary |
| 33 | - Use `sketch=0` on all icons |
| 34 | - Use `strokeColor=#ffffff` on all AWS service icons |
| 35 | - Font size: **12px** for labels |
| 36 | - **NO colored backgrounds** on group boxes — always `fillColor=none` |
| 37 | |
| 38 | ### 3D / Isometric Diagrams — use a different icon library |
| 39 | If the user asks for a **3D**, **isometric**, or "AWS 3D" diagram, do NOT fake it by placing flat `aws4` icons on hand-built platform/pedestal shapes. draw.io has a real, separate built-in library for this: `mxgraph.aws3d.*`. |
| 40 | - Load `references/aws-icons-3d.md` before picking any icon — it has the verified shape table, style prefix, sizes, and the native `isometricEdgeStyle` edge templates. |
| 41 | - This library is a legacy pre-2019 icon set with **much smaller coverage** than `aws4` (no API Gateway, ECS/EKS/Fargate, Step Functions, EventBridge, SNS, Aurora, CloudWatch, IAM, etc.). Check the gap table in that reference file before assuming an icon exists, and flag substitutions to the user rather than guessing a stencil name. |
| 42 | - For generic hardware (clients, on-prem servers, racks, switches) with no AWS-specific icon, see `references/aws-icons-allied-telesis.md` — a separate bundled isometric image library that fills that gap. |
| 43 | - These icons are already 3D on their own — arrange them in an ascending isometric staircase (diagonal offsets between nodes), don't add fake platforms underneath. |
| 44 | - Use `edgeStyle=isometricEdgeStyle` (with `endArrow=block` override for reliable arrowheads) instead of `orthogonalEdgeStyle` for connectors. |
| 45 | |
| 46 | ## Edge Style — CRITICAL FOR CLEAN DIAGRAMS |
| 47 | |
| 48 | **Base edge style:** |
| 49 | ``` |
| 50 | edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0; |
| 51 | ``` |
| 52 | |
| 53 | **Edge label rules:** |
| 54 | - Keep labels SHORT (1-2 words max). Detail goes in icon labels, not edge labels. |
| 55 | - Always add `labelBackgroundColor=#F5F5F5;fontSize=11;` to edges with labels |
| 56 | - For edges WITHOUT labels: omit `value` entirely |
| 57 | - When NOT to label: if the flow is obvious (Lambda → DynamoDB doesn't need "Write") |
| 58 | |
| 59 | **For edges to services ABOVE or BELOW main flow, use explicit exit/entry points:** |
| 60 | - Exit bottom: `exitX=0.5;exitY=1;exitDx=0;exitDy=0;` |
| 61 | - Enter top: `entryX=0.5;entryY=0;entryDx=0;entryDy=0;` |
| 62 | - This prevents draw.io from routing lines through other icons |
| 63 | |
| 64 | **Edge types:** |
| 65 | - Solid (`strokeWidth=2`): primary data flow |
| 66 | - Dashed (`strokeWidth=2;dashed=1;`): optional/async |
| 67 | - Red dashed (`strokeWidth=2;dashed=1;strokeColor=#DD344C;`): error path |
| 68 | |
| 69 | **Edge attachment (CRITICAL — fixes "green cross" problem):** |
| 70 | - Every edge MUST have both `source="<cell-id>"` and `target="<cell-id>"` attributes referencing valid cell IDs |
| 71 | - NEVER create floating/unattached edges — all edges must be bound to shapes at both ends |
| 72 | - Always include `exitX/exitY` and `entryX/entryY` to define exact connection points on the shape perimeter |
| 73 | - **Cross-container edges:** When source and target are in different containers, set the edg |