PMDesk

Azure Architecture Diagram from Terraform, Bicep or ARM (draw.io / Mermaid)Azure 構成図の自動生成: Terraform・Bicep・ARM から draw.io / Mermaid で作成

Azure Infra Diagram is a skill (free for PMDesk users) for Claude Code and Codex that reads Terraform azurerm, Bicep or ARM, or a description, and draws an Azure architecture diagram in draw.io with official icons or in Mermaid, plus a document separating facts from guesses.Azure Infra Diagram は、Terraform(azurerm)・Bicep・ARM テンプレート、または文章の説明から、Azure 構成図(Azure アーキテクチャ図)を自動生成するスキルです(Claude Code / Codex 対応、PMDesk ユーザーは無料)。公式アイコンの draw.io か Mermaid で出力し、事実と推測を分けた説明書も作ります。

Free — no extra charge. Install it from the PMDesk app.無料(追加料金なし)。PMDesk アプリからインストールできます。

Who it's forこんな方に

What it doesできること

Azure Infra Diagram is a skill that turns Azure infrastructure code into a diagram you can hand to a client, and writes down what the diagram is based on.

What you get:

  • An Azure architecture diagram as draw.io (official Azure icons, nested boxes for subscription, resource group, region, VNet and subnet) or as Mermaid (shows directly in Markdown, easy to review in a pull request).
  • An explanation document: how a request flows, network boundaries, what is reachable from the internet, where data is stored, risks worth confirming (for example an NSG rule that opens RDP 3389 to the Internet), and questions for the system owner.
  • Every statement is marked as stated (with file and line in your code), inferred (from names or common practice) or unknown. Dashed arrows and boxes in the diagram are inferred or not-expanded parts.

Works from Terraform (azurerm resources), ARM templates (JSON), Bicep files, or a plain description if there is no code. Bicep is read directly, without running the Bicep compiler, and loops (for) are reported as a limit instead of guessing how many copies exist.

How it runs: a small script lists the resources, references and NSG rules from your files; a second script lays out the draw.io file and checks it (no overlapping boxes, only confirmed Azure icons), and the agent fixes the model until the check is clean. It asks before it uses any outside tool, such as the draw.io desktop app for a PNG preview.

It reads local files only. It never calls Azure, never runs az login, never needs credentials, does not read tfvars, parameter or state files, and does not change your code. Terraform and Bicep are read without a full parser, so variables, count and modules are not evaluated; the skill tells you which parts could not be drawn.

In our test sample (a Terraform project with 17 resources, plus equivalent Bicep and ARM versions), all three runs passed the diagram check and our content check: every resource drawn or listed as skipped, subnets nested in the right VNet and resource group, and the NSG rule that opens a management port (3389 in the Terraform and Bicep versions, 22 in the ARM one) to the Internet flagged as a risk. A single run without the skill nested several resources wrongly and its draw.io file had overlapping boxes.

Using AWS or need a database diagram? See the AWS Infra Diagram skill and the ER Diagram skill.

Azure Infra Diagram は、Azure のインフラコードからお客様にそのまま渡せる Azure 構成図を作り、その図が何を根拠にしているかも文章で残すスキルです。

できること:

  • Azure 構成図を draw.io(公式 Azure アイコン、サブスクリプション / リソースグループ / リージョン / VNet / サブネットの入れ子)または Mermaid(Markdown にそのまま表示、プルリクエストでレビューしやすい)で出力します。
  • 説明書を作ります: リクエストの流れ、ネットワーク境界、インターネットから到達できる箇所、データの保存場所、確認したほうがよいリスク(例: NSG が RDP 3389 をインターネットに開いている)、システム担当者への確認事項。
  • すべての記述を「記載あり(コードのファイルと行を併記)」「推測(名前や一般的な構成から)」「不明」に分けて明記します。図の破線は推測した接続や、展開できなかった部分です。

入力は Terraform(azurerm リソース)、ARM テンプレート(JSON)、Bicep ファイル、コードがない場合は文章での説明です。Bicep は Bicep コンパイラを実行せずに直接読み、ループ(for)は何個作られるか推測せず、制限として報告します。

動き方: 小さなスクリプトがファイルからリソース・参照関係・NSG のルールを一覧にし、別のスクリプトが draw.io ファイルを配置してチェックします(図形の重なりなし、確認済みの Azure アイコンのみ)。エージェントはチェックが通るまでモデルを直します。PNG プレビュー用の draw.io デスクトップなど外部ツールは、使う前に必ず確認します。

読むのはローカルのファイルだけです。Azure には接続せず、az login も認証情報も不要で、tfvars・パラメータファイル・state ファイルは読まず、コードも変更しません。Terraform と Bicep は完全なパーサーではなく解析するため、変数・count・モジュールは展開されません。描けなかった部分はその旨を報告します。

検証用のサンプル(リソース 17 個の Terraform プロジェクトと、同等の Bicep・ARM 版)では、スキルありの 3 回とも図の検査と内容チェックに合格しました。すべてのリソースを描くか省略として記載し、サブネットを正しい VNet とリソースグループの中に入れ、インターネットに管理用ポートを開く NSG ルール(Terraform・Bicep 版は 3389、ARM 版は 22)をリスクとして挙げています。スキルなしの 1 回では、複数のリソースの入れ子が誤っており、draw.io の箱も重なっていました。

AWS 構成図は AWS Infra Diagram スキル、データベースの ER 図は ER Diagram スキルをご利用ください。

How to use使い方

  1. Open the PMDesk app, go to Marketplace, open this skill and press Install.PMDesk アプリで「マーケットプレイス」を開き、このスキルを開いて「インストール」を押す
  2. Choose this project or this Mac.「このプロジェクト」か「このMac」を選ぶ
  3. Ask Claude Code or Codex to use the skill, then review the result in PMDesk.Claude Code または Codex にこのスキルを使うよう頼み、結果を PMDesk で確認する

Requirements必要なもの

  • PMDesk (license or trial)PMDesk(ライセンスまたはトライアル)
  • Claude Code or CodexClaude Code または Codex
  • uv

Scripts in this skill含まれるスクリプト

  • scripts/drawio_lib.py
  • scripts/hcl_scan.py
  • scripts/list_resources.py

The agent runs these only when it uses the skill, and asks for your permission first.エージェントはこのスキルを使うときにだけ実行し、実行前に許可を求めます。

FAQ

Do I need an Azure account or to run az login?

No. The skill only reads local files (Terraform, ARM or Bicep) and never calls Azure or the az command. That also means the diagram shows what the code says, not what is actually deployed in the subscription.

Can it read Bicep files that I have not built?

Yes. It reads .bicep files directly, including resources with a parent, existing resources and local modules. It does not run bicep build unless you agree. Loops (for) and conditions (if) are not expanded: the diagram shows one box and the document says the number of copies is unknown.

Does it use the official Azure icons?

In draw.io mode, yes: it uses the Azure icon set bundled with draw.io, and a check rejects any icon path that has not been confirmed. For a service without a confirmed icon it draws a labelled box and tells you. Mermaid mode has no icons.

How accurate is the diagram?

Connections come from references in your code, so they are as accurate as the code. It cannot see portal-only resources, other deployments or remote state, and a reference is not proof of network traffic. The document marks every statement as stated, inferred or unknown, and dashed lines show what a reviewer should verify. It does not name the subscription, because the code does not.

Does it work with Codex as well as Claude Code?

Yes. It is a standard skill (SKILL.md plus Python scripts run with uv), so any agent that can follow a skill and run a command can use it. In PMDesk you install it once and use it from either agent.

Does it change my infrastructure or send my code anywhere?

No. It does not run terraform, az or bicep, and it does not edit your code. It writes only the diagram and the document. Your agent, as usual, sends the file contents it reads to its own model provider.

Azure のアカウントや az login は必要ですか?

不要です。このスキルは Terraform・ARM・Bicep などローカルのファイルだけを読み、Azure や az コマンドには接続しません。そのため、図はコードに書かれている内容を表すもので、実際にサブスクリプションにデプロイされている状態とは限りません。

ビルドしていない Bicep ファイルも読めますか?

読めます。.bicep を直接読み、parent を持つリソース、existing、ローカルのモジュールにも対応します。ご自身が許可しない限り bicep build は実行しません。ループ(for)と条件(if)は展開せず、図では 1 つの箱にして、何個作られるかは不明と説明書に書きます。

draw.io の公式 Azure アイコンは使えますか?

draw.io 出力では、draw.io 付属の Azure アイコンセットを使い、確認していないアイコンのパスはチェックで弾きます。確認済みアイコンがないサービスはラベル付きの箱で描き、その旨をお知らせします。Mermaid 出力にアイコンはありません。

構成図の精度はどのくらいですか?

接続はコード内の参照から作るため、コードと同じ精度です。ポータルだけで作ったリソース、別のデプロイ、リモートステートは見えず、参照があっても通信できる証拠にはなりません。説明書では全記述を「記載あり / 推測 / 不明」に分け、破線でレビュー時の確認点を示します。コードにはサブスクリプションが書かれないため、サブスクリプション名は特定しません。

Claude Code だけでなく Codex でも使えますか?

使えます。標準的なスキル(SKILL.md と uv で実行する Python スクリプト)なので、スキルに従ってコマンドを実行できるエージェントなら使えます。PMDesk で一度インストールすれば、どちらのエージェントからでも使えます。

インフラを変更したり、コードを外部に送ったりしませんか?

しません。terraform、az、bicep は実行せず、コードも編集しません。作成するのは図と説明書だけです。なお、エージェントが読んだファイルの内容は、通常どおりそのエージェントのモデル提供元に送られます。

Related関連