agentleFS
seandkendallseandkendall/kiro-config/skills/aws-diagram-png/SKILL.md

aws-diagram-png

Skill8 starsChanged 45 days agoApache-2.0View on GitHub

Generate AWS architecture diagrams as PNG images with real AWS icons using the awslabs/diagram-as-code (awsdac) CLI. Triggers when user wants a PNG diagram, architecture image, or visual export of AWS infrastructure. Produces publication-ready diagrams following AWS architecture guidelines.

  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 4 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill (aws-diagram-png) when the user wants a PNG file directly, a ready-to-share image, or a diagram for a slide/doc

    line 13
  2. Very specific:

    Use aws-architecture-diagram when the user wants editable draw.io XML that they can modify later in app.diagrams.net

    line 14
  3. Very specific:

    Use aws-diagram-html when the user wants a polished HTML page with hand-routed connectors that never overlap (awsdac auto-layout can route …

    line 15
  4. Distinctive:

    If the user says "analyze", "scan", "from code", or references their existing project:

    line 35
  5. Very specific:

    Shortcut: If the user has a CloudFormation template, use awsdac -c template.yaml to auto-generate the diagram directly (beta feature)

    line 40
  6. Distinctive:

    If the user describes an architecture or says "brainstorm" / "design" / "from scratch":

    line 44
  7. Distinctive:

    Ask 3-5 focused questions (purpose, services, scale, security, traffic pattern)

    line 46
  8. Very specific:

    Write the YAML file (see structure below) to a sensible path — typically docs/diagrams/<name>.yaml or architecture/<name>.yaml

    line 52
  9. Distinctive:

    Verify the PNG was created: check that output file exists and is non-zero size

    line 54
  10. Very specific:

    DefinitionFiles: Always use the official definition-for-aws-icons-light.yaml URL (has real AWS icons)

    line 128
  11. Very specific:

    Canvas: Always the root. Set Direction: vertical or horizontal

    line 129
  12. Very specific:

    VPC / Subnet: Use Preset: PublicSubnet or Preset: PrivateSubnet for color coding

    line 131
  13. Very specific:

    Resource types: Use CloudFormation resource types (e.g., AWS::Lambda::Function, AWS::DynamoDB::Table, AWS::S3::Bucket)

    line 132

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AWS Diagram PNG Generator (awsdac)

Generate production-ready PNG diagrams with official AWS architecture icons using the awsdac CLI tool. Use this skill when the user wants a PNG image (not draw.io XML).

When to Use This Skill vs. aws-architecture-diagram

  • Use this skill (aws-diagram-png) when the user wants a PNG file directly, a ready-to-share image, or a diagram for a slide/doc
  • Use aws-architecture-diagram when the user wants editable draw.io XML that they can modify later in app.diagrams.net
  • Use aws-diagram-html when the user wants a polished HTML page with hand-routed connectors that never overlap (awsdac auto-layout can route lines across each other)

Prerequisites

awsdac must be installed on the user's machine:

# macOS
brew install awsdac

# Go 1.21+
go install github.com/awslabs/diagram-as-code/cmd/awsdac@latest

Verify with: awsdac --version

Workflow

Mode A — Codebase Analysis

If the user says "analyze", "scan", "from code", or references their existing project:

  1. Scan for infrastructure files: CloudFormation (*.yaml, *.json), CDK (cdk.json, app.py), Terraform (*.tf)
  2. Extract services, relationships, VPC structure, and data flow
  3. Confirm discovered architecture with the user before generating
  4. Shortcut: If the user has a CloudFormation template, use awsdac -c template.yaml to auto-generate the diagram directly (beta feature)

Mode B — Brainstorming / From Scratch

If the user describes an architecture or says "brainstorm" / "design" / "from scratch":

  1. Ask 3-5 focused questions (purpose, services, scale, security, traffic pattern)
  2. Propose the architecture with service recommendations and data flow
  3. Iterate if needed, then generate

Generation Steps

  1. Write the YAML file (see structure below) to a sensible path — typically docs/diagrams/<name>.yaml or architecture/<name>.yaml
  2. Run: awsdac <name>.yaml -o <name>.png
  3. Verify the PNG was created: check that output file exists and is non-zero size
  4. Tell the user the path to the generated PNG

YAML Structure

Diagram:
  DefinitionFiles:
    - Type: URL
      Url: 'https://raw.githubusercontent.com/awslabs/diagram-as-code/main/definitions/definition-for-aws-icons-light.yaml'

  Resources:
    Canvas:
      Type: AWS::Diagram::Canvas
      Direction: vertical
      Children:
        - AWSCloud
        - User

    AWSCloud:
      Type: AWS::Diagram::Cloud
      Direction: vertical
      Preset: AWSCloudNoLogo
      Align: center
      Children:
        - VPC

    VPC:
      Type: AWS::EC2::VPC
      Direction: vertical
      Children:
        - PublicSubnet
        - ALB
      BorderChildren:
        - Position: S
          Resource: IGW

    PublicSubnet:
      Type: AWS::EC2::Subnet
      Preset: PublicSubnet
      Children:
        - WebServer

    WebServer:
      Type: AWS::EC2::Instance

    ALB:
      Type: AWS::ElasticLoadBalancingV2::LoadBalancer
      Preset: Application Load Balancer

    IGW:
      Type: AWS::EC2::InternetGateway

    User:
      Type: AWS::Diagram::Resource
      Preset: User

  Links:
    - Source: User
      Target: IGW
      TargetArrowHead:
        Type: Open
    - Source: IGW
      Target: ALB
      TargetArrowHead:
        Type: Open
    - Source: ALB
      Target: WebServer
      TargetArrowHead:
        Type: Open

Key YAML Conventions

  • DefinitionFiles: Always use the official definition-for-aws-icons-light.yaml URL (has real AWS icons)
  • Canvas: Always the root. Set Direction: vertical or horizontal
  • AWSCloud: Wraps anything running inside AWS. Use Preset: AWSCloudNoLogo for cleaner look
  • VPC / Subnet: Use Preset: PublicSubnet or Preset: PrivateSubnet for color coding
  • Resource types: Use CloudFormation resource types (e.g., AWS::Lambda::Function, AWS::DynamoDB::Table, AWS::S3::Bucket)
  • Links: Connect resources with arrows. TargetArrowHead: Type: Open is standard

Common Resource Types

Note: Prefer the base service type (e.g., AWS::CloudFront) when a specific variant isn't defined in awsdac's icon file. Variants like AWS::CloudFront::Distribution fall back to the base icon with a warning. The types below are all verified to render cleanly with zero warnings.

ServiceType
LambdaAWS::Lambda::Function
API GatewayAWS::ApiGateway (REST) / AWS::ApiGatewayV2::Api (HTTP)
DynamoDBAWS::DynamoDB::Table
S3AWS::S3::Bucket
CloudFrontAWS::CloudFront
CognitoAWS::Cognito::UserPool
SQSAWS::SQS::Queue
SNSAWS::SNS::Topic
Step FunctionsAWS::StepFunctions
EventBridgeAWS::Events
EC2 InstanceAWS::EC2::Instance
RDSAWS::RDS::DBInstance
ECSAWS::ECS::Service
ALBAWS::ElasticLoadBalancingV2::LoadBalancer (with Preset: Application Load Balancer)
VPCAWS::EC2::VPC
SubnetAWS::EC2::Subnet (with Preset: PublicSubnet or PrivateSubnet)
CloudWatchAWS::CloudWatch::Alarm
X-RayAWS::XRay
Secrets MgrAWS::SecretsManager::Secret
User / ClientAWS::Diagram::Resource with Preset: User

See the full list at: https://github.com/awslabs/diagram-as-code/blob/main/doc/resource-types.md

CLI Options

# Basic usage - generates output.png by default
awsdac diagram.yaml

# Custom output path
awsdac diagram.yaml -o architecture.png

# Convert CloudFormation template directly (beta)
awsdac -c cloudformation.yaml -o diagram.png

# Generate YAML from CloudFormation for manual editing
awsdac -c cloudformation.yaml -d -o diagram.yaml

# Verbose logging for debugging
awsdac diagram.yaml -v

Best Practices

  • Keep diagrams focused — one diagram per concern (data flow, security, deployment) beats one giant diagram
  • Add a User resource at the top or left edge for flows that start with users
  • Group by VPC/Subnet to clearly show network boundaries
  • Use consistent direction — vertical for top-to-bottom data flow, horizontal for step-by-step
  • Save the YAML alongside the PNG so the diagram can be regenerated or tweaked later

Troubleshooting

  • "command not found: awsdac" — Run brew install awsdac (macOS) or use go install
  • "unknown resource type" — Check the resource-types.md doc; use the exact CloudFormation-style name
  • Ugly layout — Reorganize the Children lists; resources stack in the order listed. Try switching Direction between vertical and horizontal
  • Text is cut off — The tool auto-sizes; if specific labels are wrong, use Title: field on the resource

Reference Links

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.