claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

🏗️aws-diagram

プラグイン
aws-dev-toolkit

説明

説明文、既存のIaC、または会話のコンテキストから、MermaidまたはASCII形式のAWSアーキテクチャ図を生成します。 次のような場合に使用: ユーザーがアーキテクチャを視覚化したいとき。

原文を表示

Generate AWS architecture diagrams in Mermaid or ASCII from a description, existing IaC, or conversation context. Use when the user wants to visualize an architecture.

ユースケース

  • AWSアーキテクチャを視覚化したいとき
  • IaCからアーキテクチャ図を生成したいとき
  • 会話のコンテキストからアーキテクチャを図示したいとき

本文(日本語訳)

AWSアーキテクチャ図を生成します。システム内のリクエスト/データフローを明確かつ読みやすく表現した図を作成してください。

プロセス

  1. ソースを判定する:
    • $ARGUMENTS"from-iac" が含まれる場合: リポジトリをスキャンして IaC ファイル(CDK、Terraform、CloudFormation、SAM)を検索し、アーキテクチャをリバースエンジニアリングする
    • それ以外の場合: $ARGUMENTS または会話のコンテキストに含まれる説明を使用する
  2. Mermaid 図(メイン)と ASCII フォールバックを生成する
  3. 自明でない記法には凡例を付ける

Mermaid 図のスタイル

リクエストフローには graph LR(左→右)、階層型アーキテクチャには graph TD(上→下)を使用する。

記法の規則

  • ユーザー/クライアント: スタジアム形状 ([User])
  • AWS サービス: 矩形 [Service Name]
  • データベース: シリンダー形状 [(Database)]
  • キュー: 平行四辺形 [/Queue/]
  • 外部サービス: 二重枠 [[External API]]
  • サブグラフ: VPC・サブネット・論理境界ごとにグループ化
  • 矢印: プロトコル/アクションをラベルで示す(例: -->|HTTPS|-->|async|

graph LR
    User([User]) -->|HTTPS| CF[CloudFront]
    CF -->|HTTPS| ALB[ALB]

    subgraph VPC
        subgraph Public Subnet
            ALB
        end
        subgraph Private Subnet
            ECS[ECS Fargate]
            ECS -->|TCP 5432| RDS[(Aurora PostgreSQL)]
            ECS -->|TCP 6379| Redis[(ElastiCache Redis)]
        end
    end

    ECS -->|HTTPS| S3[S3 Bucket]
    ECS -->|SQS| Queue[/Processing Queue/]
    Queue --> Lambda[Lambda Processor]
    Lambda --> S3

ASCII フォールバック

Mermaid をレンダリングできない環境向け:

┌──────┐     ┌────────────┐     ┌─────┐
│ User │────>│ CloudFront │────>│ ALB │
└──────┘     └────────────┘     └──┬──┘
                                   │
                    ┌──────────────┴──────────────┐
                    │         VPC                  │
                    │  ┌─────────────┐             │
                    │  │ ECS Fargate │──> Aurora   │
                    │  │             │──> Redis    │
                    │  └──────┬──────┘             │
                    └─────────┼────────────────────┘
                              │
                         ┌────┴────┐
                         │   SQS   │──> Lambda ──> S3
                         └─────────┘

IaC からのリバースエンジニアリング

from-iac が指定された場合:

  1. *.tf*.ts(CDK)、template.yaml(SAM)、*.template.json(CFN)を glob で検索する
  2. リソース、それらの関係、およびネットワーク設定を抽出する
  3. 図のノードとエッジにマッピングする
  4. セキュリティ上の懸念点(パブリックサブネット、オープンなセキュリティグループ等)を警告マーカーで強調する

出力

常に以下をすべて提供すること:

  1. Mermaid 図```mermaid コードブロック内)
  2. ASCII フォールバック``` コードブロック内)
  3. フローの説明(リクエスト/データの経路を 1〜2 文で説明)
  4. 注記(前提とした仮定、セキュリティに関する所見)
原文(English)を表示

You are generating an AWS architecture diagram. Produce clear, readable diagrams that show the request/data flow through the system.

Process

  1. Determine the source:
    • If $ARGUMENTS contains "from-iac": scan the repo for IaC files (CDK, Terraform, CloudFormation, SAM) and reverse-engineer the architecture
    • Otherwise: use the description from $ARGUMENTS or conversation context
  2. Generate a Mermaid diagram (primary) and an ASCII fallback
  3. Include a legend for any non-obvious notation

Mermaid Diagram Style

Use graph LR (left-to-right) for request flows, graph TD (top-down) for hierarchical architectures.

Conventions

  • Users/Clients: Stadium shape ([User])
  • AWS Services: Rectangle [Service Name]
  • Databases: Cylinder [(Database)]
  • Queues: Parallelogram [/Queue/]
  • External Services: Double-bordered [[External API]]
  • Subgraphs: Group by VPC, subnet, or logical boundary
  • Arrows: Label with protocol/action (e.g., -->|HTTPS|, -->|async|)

Example

graph LR
    User([User]) -->|HTTPS| CF[CloudFront]
    CF -->|HTTPS| ALB[ALB]

    subgraph VPC
        subgraph Public Subnet
            ALB
        end
        subgraph Private Subnet
            ECS[ECS Fargate]
            ECS -->|TCP 5432| RDS[(Aurora PostgreSQL)]
            ECS -->|TCP 6379| Redis[(ElastiCache Redis)]
        end
    end

    ECS -->|HTTPS| S3[S3 Bucket]
    ECS -->|SQS| Queue[/Processing Queue/]
    Queue --> Lambda[Lambda Processor]
    Lambda --> S3

ASCII Fallback

For environments that don't render Mermaid:

┌──────┐     ┌────────────┐     ┌─────┐
│ User │────>│ CloudFront │────>│ ALB │
└──────┘     └────────────┘     └──┬──┘
                                   │
                    ┌──────────────┴──────────────┐
                    │         VPC                  │
                    │  ┌─────────────┐             │
                    │  │ ECS Fargate │──> Aurora   │
                    │  │             │──> Redis    │
                    │  └──────┬──────┘             │
                    └─────────┼────────────────────┘
                              │
                         ┌────┴────┐
                         │   SQS   │──> Lambda ──> S3
                         └─────────┘

From IaC Reverse Engineering

When from-iac is specified:

  1. Glob for *.tf, *.ts (CDK), template.yaml (SAM), *.template.json (CFN)
  2. Extract resources, their relationships, and networking config
  3. Map to diagram nodes and edges
  4. Highlight any security concerns (public subnets, open SGs) with a warning marker

Output

Always provide:

  1. Mermaid diagram (in a ```mermaid code block)
  2. ASCII fallback (in a ``` code block)
  3. Flow description (1-2 sentences explaining the request/data path)
  4. Notes (any assumptions made, security observations)

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。