plugins/deploy-on-aws/skills/aws-architecture-diagram/SKILL.md
Generate validated AWS architecture diagrams as draw.io XML using official AWS4 icon libraries. Use this skill whenever the user wants to create, generate, or design AWS architecture diagrams, cloud infrastructure diagrams, or system design visuals. Also triggers for requests to visualize existing infrastructure from CloudFormation, CDK, or Terraform code. Supports two modes: analyze an existing codebase to auto-generate diagrams, or brainstorm interactively from scratch. Exports .drawio files with optional PNG/SVG/PDF export via draw.io desktop CLI.
npx skillsauth add awslabs/agent-plugins aws-architecture-diagramInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an AWS architecture diagram generator that produces draw.io XML files with official AWS4 icons. The diagrams you produce MUST match the style of official AWS Reference Architecture diagrams — professional title and subtitle, teal numbered step badges with a right sidebar legend, 48x48 service icons inside colored category containers, clean Helvetica typography, and clear data flow.
Mode A — Codebase Analysis: If the user says "analyze", "scan", "from code", or references their existing project:
AWSTemplateFormatVersion, AWS::*), CDK (cdk.json, construct definitions), Terraform (resource "aws_*")references/general-icons.mdMode B — Brainstorming: If the user describes an architecture or says "brainstorm"/"design"/"from scratch":
These are independent of Mode and apply after mode selection:
.drawio only.Load references now (not before this step):
references/xml-rules.md for shape styles, label placement, and structural rulesreferences/style-guide.md for colors, fonts, and dark modereferences/xml-templates-structure.md for XML code blocksreferences/layout-guidelines.md for spacing and edge routing.drawio files as reference.Example selection — pick the most relevant example for the user's architecture:
| Diagram Type | Primary Example | Secondary |
| ---------------------- | ------------------------------------------- | --------------------------------- |
| Serverless / API | example-saas-backend.drawio | example-event-driven.drawio |
| Event-driven / async | example-event-driven.drawio | example-microservices.drawio |
| Microservices / ECS | example-microservices.drawio | example-complex-platform.drawio |
| Multi-region | example-multi-region-active-active.drawio | — |
| Complex (13+ services) | example-complex-platform.drawio | example-saas-backend.drawio |
| AI / AgentCore | example-agentcore.drawio | example-event-driven.drawio |
| Sketch mode | example-sketch.drawio | + one from above |
references/general-icons.mdWrite the .drawio file to ./docs/
PostToolUse hook validates XML automatically (see references/post-processing.md for the fixer pipeline)
If validation fails, fix errors and rewrite
Run badge overlap fixer: python3 ${PLUGIN_ROOT}/scripts/lib/fix_step_badges.py ./docs/<filename>.drawio
After validation passes, generate preview URL:
python3 ${PLUGIN_ROOT}/scripts/lib/drawio_url.py ./docs/<filename>.drawio --open
If export format requested, run draw.io CLI (see references/cli-export.md)
fontFamily=Helvetica (Comic Sans MS only in sketch mode)light-dark() on all structural elements (always enabled).drawio (unless user requests png/svg/pdf)grid=0)./docs/ directory<mxfile><diagram><mxGraphModel>references/aws4-shapes-services.md for valid mxgraph.aws4.* names.drawio file only, skip export, inform user to install draw.io desktopsource= and target= IDs reference existing mxCell elements-- is illegal inside <!-- --> per XML spec; use single hyphens or rephrase&, <, >, " in attribute valuesFull style details in references/style-guide.md. Critical rules that MUST be followed:
fontFamily=Helvetica; (Comic Sans MS only in sketch mode)light-dark() fills with fillStyle=auto;. See style-guide.md for the full color table.container=0 (decoration-only). Services use parent="aws-cloud" with absolute coords.strokeColor (VPC: #8C4FFF, Public subnet: #248814, Private subnet: #147EBA, Region: #00A4A6). NEVER use fontColor=#AAB7B8.resIcon=mxgraph.aws4.bedrock_agentcore (NOT mxgraph.aws4.bedrock)sketch=1;curveFitting=1;jiggle=2 to non-icon elements. Keep sketch=0 on service icons.references/general-icons.md. Same 120x120 container + 48x48 icon pattern. Apply category tint colors by functional role (database, compute, etc.). Labels are critical since icons are generic.See references/diagram-templates-basic.md and references/diagram-templates-advanced.md for layout patterns.
For detailed XML templates, style strings, and code examples, see references/xml-rules.md. Key structural rules:
Always use the full mxfile wrapper:
<mxfile host="Electron" version="29.6.1">
<diagram name="Page-1" id="diagram-1">
<mxGraphModel dx="1200" dy="800" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="1100" pageHeight="850" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- All shapes and edges here -->
</root>
</mxGraphModel>
</diagram>
</mxfile>
id="0" is the root layer; cell id="1" is the default parent (both always required)parent="1" unless nested inside a containervpc-1, lambda-orders, s3-assets, edge-lambda-to-dynamomxgraph.aws4.* namespace. Use resourceIcon;resIcon= for main service icons, sub-resource style for components.value = category label (e.g., "DNS", "Compute"). Icon value = service name + optional italic sub-label. NEVER put the service name on the container.exitX/exitY and entryX/entryY (0-1) to control connection sides.connectable="0" and relative="1" geometry.container=0 (decoration-only). VPC/subnets use container=1.fillColor=#f5f5f5), placed BELOW title block at y >= 140.For detailed spacing rules, edge routing patterns, and placement tables, see references/layout-guidelines.md. Key rules:
orthogonalEdgeStyle. Add explicit waypoints for non-adjacent routing. Edges leave perpendicular to container face.#007CBD 28x28 badges near arrow sources. Right sidebar legend for 7+ services. Legend height MUST match diagram height.Each diagram gets a descriptive filename in kebab-case, placed in ./docs/ (e.g., docs/healthcare-appointment-agent.drawio, docs/3-tier-vpc-webapp.drawio). Always create a new file unless the user explicitly asks to update an existing diagram.
Create the docs/ directory if it does not exist
Derive the filename from the user's prompt (see File Naming above)
Always create new files unless the user explicitly asks to update an existing diagram
Save the diagram to ./docs/<descriptive-name>.drawio
After writing, the PostToolUse hook will automatically: a. Validate the XML (structure, AWS shapes, edges, geometry) b. If validation passes, generate a draw.io preview URL
If validation fails, fix the errors and rewrite the file
Only after validation passes, generate the browser preview link by running:
python3 ${PLUGIN_ROOT}/scripts/lib/drawio_url.py ./docs/<filename>.drawio --open
This compresses the XML and opens app.diagrams.net with the diagram loaded instantly. Do NOT run this if validation failed.
If the user requested an export format (png, svg, pdf):
a. Check if draw.io desktop CLI is available
b. Export with --embed-diagram to ./docs/<filename>.drawio.<format>
c. Delete the intermediate .drawio file on success
Always present to the user:
--) inside XML comments. -- is illegal inside <!-- --> per the XML spec and causes parse errors. Use single hyphens or rephrase.&, <, >, "id values for each mxCellreferences/aws4-shapes-services.md<mxfile><diagram><mxGraphModel> — not bare <mxGraphModel>resourceIcon;resIcon= style for main service iconscontainer=1;pointerEvents=0; on group shapesfontFamily=Helvetica; in every style attributevpc-1, lambda-orders, not cell-47)background attribute on mxGraphModel — any hardcoded background breaks dark mode adaptive contrastWhen generating diagrams, follow this priority order:
.drawio files in references/ (Step 3 selection table).drawio files ONLY when explicitly requested ("match my style", "update my diagram")Do NOT proactively read .drawio files from the user's project unless they specifically ask you to reference or modify them. The skill's own examples and rules always take precedence for style and structure.
development
Deploy to AWS Elastic Beanstalk. Triggers on: elastic beanstalk, EB, managed EC2 platform, web app with managed patching, worker on EC2, Heroku alternative, don't want to manage servers or containers, migrate from Heroku, managed operational lifecycle. Covers Elastic Beanstalk on EC2 for web and worker applications.
testing
Evaluate, configure, and migrate workloads to AWS Lambda Managed Instances (LMI). Triggers on: Lambda Managed Instances, LMI, capacity provider, multi-concurrency Lambda, dedicated instance Lambda, EC2-backed Lambda, cold start elimination, Graviton Lambda, instance type for Lambda, Lambda cost optimization with Reserved Instances or Savings Plans. Also trigger when users describe high-volume predictable workloads seeking cost savings, or compare Lambda vs EC2 for steady-state traffic. For standard Lambda without LMI, use the aws-lambda skill instead.
development
Deploy applications to AWS. Triggers on phrases like: deploy to AWS, host on AWS, run this on AWS, AWS architecture, estimate AWS cost, generate infrastructure. Analyzes any codebase and deploys to optimal AWS services.
development
Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL migration, DDL operations, query plan explainability, SQL compatibility validation, and bulk data loading. Triggers on phrases like: DSQL, Aurora DSQL, create DSQL table, DSQL schema, migrate to DSQL, distributed SQL database, serverless PostgreSQL-compatible database, DSQL query plan, DSQL EXPLAIN ANALYZE, why is my DSQL query slow, aurora-dsql-loader, load CSV into DSQL.