
aws-architecture-diagram
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.
- Installs
- 403
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/awslabs/agent-plugins --skill aws-architecture-diagram- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads aws-architecture-diagram automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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.
Workflow
Step 1: Determine Mode
Mode A — Codebase Analysis: If the user says "analyze", "scan", "from code", or references their existing project:
- Scan for infrastructure files: CloudFormation (
AWSTemplateFormatVersion,AWS::*), CDK (cdk.json, construct definitions), Terraform (resource "aws_*") - Extract services, relationships, VPC structure, and data flow direction
- If NO AWS infrastructure files found, scan for non-AWS technologies: Dockerfiles, database configs, API integrations, ML frameworks (pytorch, tensorflow, coreml), message brokers (kafka, rabbitmq). Map discovered technologies using
references/general-icons.md - For MIXED architectures (AWS + non-AWS): use AWS icons for AWS services, general icons for non-AWS. Same layout rules apply.
- Confirm discovered architecture with user before generating
- Ask which diagram type best represents the architecture
Mode B — Brainstorming: If the user describes an architecture or says "brainstorm"/"design"/"from scratch":
- Ask 3-5 focused questions (purpose, services, scale, security, traffic pattern)
- Propose the architecture with service recommendations and data flow
- Iterate if needed, then generate
Step 2: Styling Selections
These are independent of Mode and apply after mode selection:
- Sketch mode: Activated ONLY if user says "sketch", "hand-drawn", or "sketchy". Default: OFF (Helvetica, no sketch attributes). See Sketch Mode in Style Rules below.
- Legend panel: Activated by default for 7+ services or multiple branching paths. Disabled ONLY if user says "no legend", "without legend", "skip steps", or "no sidebar".
- Export format: Check for format keywords (png, svg, pdf). Default:
.drawioonly.
Step 3: Generate Diagram XML
Load references now (not before this step):
- Read
references/xml-rules.mdfor shape styles, label placement, and structural rules - Read
references/style-guide.mdfor colors, fonts, and dark mode - Read
references/xml-templates-structure.mdfor XML code blocks - Read
references/layout-guidelines.mdfor spacing and edge routing - Use the example entries in the table below only as conceptual guidance for edge routing and layout patterns; do not open or read any
.drawiofiles 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 |
- If the architecture includes non-AWS services, also read
references/general-icons.md - Generate the XML following all loaded rules and the selected example's patterns
- Apply styling selections from Step 2
Step 4: Validate and Export
-
Write the
.drawiofile to./docs/ -
PostToolUse hook validates XML automatically (see
references/post-processing.mdfor 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)
Defaults
- Mode: Brainstorm (if no codebase context)
- Font:
fontFamily=Helvetica(Comic Sans MS only in sketch mode) - Icon size: 48x48 inside 120x120 containers
- Spacing: 180px horizontal, 120px vertical between service group containers
- Legend: ALWAYS for 7+ services (unless user opts out)
- Sketch mode: OFF (unless user explicitly requests)
- Dark mode:
light-dark()on all structural elements (always enabled) - Export format:
.drawio(unless user requests png/svg/pdf) - Grid: OFF (
grid=0) - File location:
./docs/directory - XML format: Uncompressed, wrapped in
<mxfile><diagram><mxGraphModel>
Error Handling
- XML validation failure: Fix reported errors (malformed tags, missing IDs, invalid shapes), rewrite the file, re-validate
- Shape not found: Check
references/aws4-shapes-services.mdfor validmxgraph.aws4.*names - draw.io CLI not found: Write
.drawiofile only, skip export, inform user to install draw.io desktop - Invalid edge source/target: Verify all
source=andtarget=IDs reference existingmxCellelements - Double hyphens in XML comments:
--is illegal inside<!-- -->per XML spec; use single hyphens or rephrase - Special characters: Escape
&,<,>,"in attribute values
Style Rules
Full style details in references/style-guide.md. Critical rules that MUST be followed:
- Font: ALL text MUST use
fontFamily=Helvetica;(Comic Sans MS only in sketch mode) - Dark mode: ALL structural elements MUST use
light-dark()fills withfillStyle=auto;. See style-guide.md for the full color table. - Region groups: MUST use
container=0(decoration-only). Services useparent="aws-cloud"with absolute coords. - Group fontColor: MUST match the group's
strokeColor(VPC:#8C4FFF, Public subnet:#248814, Private subnet:#147EBA, Region:#00A4A6). NEVER usefontColor=#AAB7B8. - Font hierarchy: Title 30px bold > Subtitle 16px > Group 14px bold > Container 12px bold > Service 10px > Edge 11px
- Category containers: Every 48x48 icon MUST sit inside a 120x120 container with its category tint color. See style-guide.md for the tint color table.
- AgentCore: Use
resIcon=mxgraph.aws4.bedrock_agentcore(NOTmxgraph.aws4.bedrock) - Sketch mode: Only when user requests it. Add
sketch=1;curveFitting=1;jiggle=2to non-icon elements. Keepsketch=0on service icons. - Non-AWS services: Map to the closest general icon using
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.
Diagram Types
- VPC/Network: VPC, subnets, security groups, NAT gateways, load balancers with group shapes
- Serverless: API Gateway, Lambda, DynamoDB, S3, Step Functions, EventBridge
- Multi-Region: Multiple regions with replication, Route 53, Global Accelerator
- CI/CD Pipeline: CodeCommit/GitHub -> CodeBuild -> CodeDeploy -> targets
- Data Flow/Analytics: Kinesis, S3, Glue, Athena, Redshift, QuickSight pipelines
- Container: ECS/EKS clusters, ECR, Fargate, load balancing
- Hybrid: On-premises + AWS with Direct Connect, VPN, Transit Gateway
See references/diagram-templates-basic.md and references/diagram-templates-advanced.md for layout patterns.
XML Generation Rules
For detailed XML templates, style strings, and code examples, see references/xml-rules.md. Key structural rules:
Required Structure
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>
- Cell
id="0"is the root layer; cellid="1"is the default parent (both always required) - All diagram elements use
parent="1"unless nested inside a container - Use descriptive cell IDs:
vpc-1,lambda-orders,s3-assets,edge-lambda-to-dynamo
Key Principles
- ALWAYS use
mxgraph.aws4.*namespace. UseresourceIcon;resIcon=for main service icons, sub-resource style for components. - Container
value= category label (e.g., "DNS", "Compute"). Iconvalue= service name + optional italic sub-label. NEVER put the service name on the container. - Edges connect to service icons, not containers. Use
exitX/exitYandentryX/entryY(0-1) to control connection sides. - Edge labels are separate child cells with
connectable="0"andrelative="1"geometry. - Region groups use
container=0(decoration-only). VPC/subnets usecontainer=1. - Prefer flat layouts. Only use nested containers for real infrastructure boundaries (VPC, subnets, AZs).
- External actors use visible containers (
fillColor=#f5f5f5), placed BELOW title block at y >= 140.
Layout Guidelines
For detailed spacing rules, edge routing patterns, and placement tables, see references/layout-guidelines.md. Key rules:
- Spacing: 180px horizontal / 120px vertical gaps. For 13+ services, increase to 220px/160px.
- Edge routing: Use
orthogonalEdgeStyle. Add explicit waypoints for non-adjacent routing. Edges leave perpendicular to container face. - Multiple edges: Each outgoing edge MUST exit from a different point. Spread entry points when multiple edges enter the same target.
- Step badges/legend: Teal
#007CBD28x28 badges near arrow sources. Right sidebar legend for 7+ services. Legend height MUST match diagram height. - Auxiliary services: Only CloudWatch, CloudTrail, X-Ray, IAM. No step numbers, no edges. Place in dashed "Auxiliary Services" group inside AWS Cloud boundary.
- All other services are primary — MUST have edges and step numbers.
File Naming
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.
Output
-
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 --openThis compresses the XML and opens
app.diagrams.netwith 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-diagramto./docs/<filename>.drawio.<format>c. Delete the intermediate.drawiofile on success -
Always present to the user:
- File path
- Diagram type and services included
- Validation status
- The draw.io preview URL (clickable link to open in browser)
- A recommended alt text (concise, under 100 characters, describing the diagram's purpose — not "diagram of...")
CRITICAL: XML Well-Formedness
- NEVER use double hyphens (
--) inside XML comments.--is illegal inside<!-- -->per the XML spec and causes parse errors. Use single hyphens or rephrase. - Escape special characters in attribute values:
&,<,>," - Always use unique
idvalues for eachmxCell
Important Rules
- NEVER use compressed/base64 diagram content
- NEVER invent shape names — only use shapes from
references/aws4-shapes-services.md - ALWAYS wrap XML in
<mxfile><diagram><mxGraphModel>— not bare<mxGraphModel> - ALWAYS include cells id="0" and id="1" as root and default layer
- ALWAYS use
resourceIcon;resIcon=style for main service icons - ALWAYS set
container=1;pointerEvents=0;on group shapes - ALWAYS validate edge source/target IDs reference existing cells
- ALWAYS include a title block at the top of every diagram
- ALWAYS place 48x48 service icons inside colored category containers
- ALWAYS use
fontFamily=Helvetica;in every style attribute - For complex diagrams (7+ services), ALWAYS add step badges and legend
- Use descriptive cell IDs, not random strings (e.g.,
vpc-1,lambda-orders, notcell-47) - Add italic sub-labels to service icons to clarify their role in the architecture
- Only include services the user explicitly mentions or that are core to the data flow. Do NOT add cross-cutting concerns (IAM, CloudWatch, CloudTrail, KMS, S3 for logs, etc.) unless the user asks for them
- Include a title/label on the diagram describing the architecture
- NEVER set a
backgroundattribute on mxGraphModel — any hardcoded background breaks dark mode adaptive contrast
Reference Priority
When generating diagrams, follow this priority order:
- This skill's XML generation rules and style guide (ALWAYS authoritative)
- This skill's example
.drawiofiles inreferences/(Step 3 selection table) - The user's existing
.drawiofiles 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.
FAQ
What does the aws-architecture-diagram skill do?
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.
How do I install aws-architecture-diagram?
Run npx skills add https://github.com/awslabs/agent-plugins --skill aws-architecture-diagram in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/aws-architecture-diagram/ (personal) or .claude/skills/aws-architecture-diagram/ (project).
Which AI agents can use aws-architecture-diagram?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is aws-architecture-diagram safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains aws-architecture-diagram?
It is published by awslabs in awslabs/agent-plugins. It has 403 recorded installs.
More from awslabs/agent-plugins
aws-lambda
awslabs/agent-plugins
Design, build, deploy, test, and debug serverless applications with AWS Lambda. Triggers on phrases like: Lambda function, event source, serverless application, API Gateway, EventBridge, Step Functions, serverless API, event-driven architecture, Lambda trigger. For deploying non-serverless apps to AWS, use deploy-on-aws plugin instead.
deploy
awslabs/agent-plugins
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.
use-case-specification
awslabs/agent-plugins
Creates a reusable use case specification file that defines the business problem, stakeholders, and measurable success criteria for model customization, as recommended by the AWS Responsible AI Lens. Use as the default first step in any model customization plan. Skip only if the user explicitly declines or already has a use case specification to reuse. Captures problem statement, primary users, and LLM-as-a-Judge success tenets.
directory-management
awslabs/agent-plugins
Manages project directory setup and artifact organization. Use when starting a new project, resuming an existing one, or when a PLAN.md needs to be associated with a project directory. Creates the project folder structure (specs/, scripts/, notebooks/, manifests/, agentmemory/) and resolves project naming.
planning
awslabs/agent-plugins
Discovers user intent and generates a structured, step-by-step plan for model customization workflows. This skill must always be activated alongside any other skill when the user's request relates to model customization — including fine-tuning, training, building, customizing, reviewing data, or getting advice on approach, regardless of domain. Do not skip this skill even if the immediate ask is narrow (e.g., reviewing data format or a single workflow step), because planning discovers the full scope of work needed. Also activate when the user wants to resume, continue, or modify an existing plan.
dataset-evaluation
awslabs/agent-plugins
Validates dataset formatting and quality for SageMaker model fine-tuning (SFT, DPO, or RLVR). Use when the user says "is my dataset okay", "evaluate my data", "check my training data", "I have my own data", or before starting any fine-tuning job. Detects file format, checks schema compliance against the selected model and technique, and reports whether the data is ready for training or evaluation.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.