ponchimap

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0

README

ponchimap

アプリが使うクラウドのサービスとその関係を、根拠の付いた構成図にするツールです。
コーディングエージェントが同梱の Skill に従ってリポジトリと資料に加えて実環境を調べ、ponchimap の CLI が図とレポートを書きます。

架空の注文受付サービスを描いた図

特徴

  • 図の箱と線には、どれも根拠があります。設定ファイルの宣言、実装、資料の記述、エージェントがサービスの CLI で実環境を照会した結果のどれを根拠にしたかは、レポートで読めます。
  • 設定ファイルに書いてあるだけで実環境と照合していない要素には「未照合」の印が、根拠どうしで値が食い違う要素には「不一致」の印が付きます。資料や手がかりにしか出てこないものは破線で描きます。
  • 特定のクラウドに限りません。ponchimap の Skill と CLI はサービスごとの知識を持たず、設定ファイルの読み方や照会のコマンドは、エージェントが各サービスの CLI のヘルプと公式の資料で確かめます。

はじめる

Go 1.27.4 以降が要ります。ponchimap の CLI を入れます。

go install github.com/ochamu/ponchimap/cmd/ponchimap@latest

go install は ponchimap を Go の bin フォルダ(通常 ~/go/bin)に置きます。そのフォルダを PATH に入れておきます。エージェントも PATH から ponchimap を探します。

構成図を描きたいアプリのフォルダで init を実行します。

ponchimap init

そのフォルダで Claude Code や Codex などのエージェントを起動し、次のように頼みます。

このリポジトリの構成図を作って

エージェントは init が置いた Skill に従って、設定ファイル、コード、資料を読みます。環境が複数あって依頼が名指していなければ、どの環境を描くかを尋ねます。サービスの CLI のサインイン先が対象のアカウントと合わないときも、照会の前に尋ねます。調べたことは調査入力(JSON のファイル)に書き、ponchimap の CLI で図とレポートにします。最後に、図とレポートの場所、主な要素の役割、確かめられなかった点とその理由を答えます。

もう一度頼むと、エージェントは前の調査入力を読んだうえでリポジトリと資料を調べ直し、同じ要素を同じIDのまま更新します。architecture.view.yaml に書いた表示名やグループは残ります。

見本で試す

エージェントもクラウドのアカウントも使わずに、図ができるまでを試せます。手で書いた調査入力の見本を取り込んで描きます。見本には、設定ファイルを読んだ結果とクラウドに照会した結果を、架空の値で書いてあります。見本はこのリポジトリにあるので、まず git clone で取得します。ponchimap のコマンドはどれもネットワークを使いません。

git clone https://github.com/ochamu/ponchimap.git ~/ponchimap
mkdir -p ~/ponchimap-demo && cd ~/ponchimap-demo
ponchimap init
cp ~/ponchimap/examples/first-run/findings/*.json .ponchimap/findings/
ponchimap import && ponchimap lint && ponchimap render

docs/architecture/overview.png に、見本の図(examples/first-run/overview.png)と同じ図ができます。

エージェントで試すときは、見本のアプリ ~/ponchimap/examples/memo-app を ~/ponchimap の外に写して git init し、「はじめる」と同じように ponchimap init を実行してから頼みます。見本には dev と production の2つの環境があり、どちらを描いてもかまいません。識別子は架空の値なので、頼むときに「クラウドへの照会はしないで」と添えます。

できるもの

ファイル 中身
docs/architecture/overview.svg、overview.png 構成図
.ponchimap/report.md 要素ごとの役割、根拠、確かめられなかった点のレポート
architecture.view.yaml 表示設定。題、表示名、グループ、配置などの見せ方を書く
.ponchimap/ 調査入力(findings/)、モデル、取り込みの記録を置く作業領域

図を整える

見せ方だけを変えたいときは、エージェントに「この2つを『バックエンド』という枠でまとめて」のように頼むか、architecture.view.yaml を書き換えて ponchimap render を実行します。表示設定は見せ方だけを変え、根拠は変えません。

配置が読みにくいときは、配置エンジンと向きを替えるか、配置の seed を引き直して描き直します。配置エンジンを ELK に替えて上から下へ並べるには、次のコマンドを実行します。

ponchimap render --engine elk --direction down

既定の配置エンジン TALA で描いた図は、次のコマンドで seed を引き直せます。要素の少ない図は seed を変えても同じ図になることがあります。

ponchimap render --reroll

続けて使う配置は architecture.view.yaml の layout に書きます。

安全のために

  • Skill はエージェントに、読み取りのコマンドだけを実行するように指示しています。実行の前に、コマンドが読み取りだけであることと、出力に資格情報や秘密の値が載らないことを、ヘルプか公式の資料で確かめさせます。デプロイ、作成、削除、サインイン、CLI のインストールはしないようにも書いています。
  • 作業領域 .ponchimap/ は、init が .gitignore に加える行で Git の対象から外れます。図、表示設定、Skill のフォルダは作業領域の外にあり、コミットするかどうかは利用者が選びます。
  • レポートはアカウントIDなどの識別子の値を含みます。手元で読むための記録なので、そのまま共有しないでください。
  • 図には、調査入力に書いた役割や関係の説明がそのまま出ます。識別子や秘密の値を書いていないかを、共有する前に図で確かめてください。

詳しい資料

ライセンス

Apache License 2.0 です(LICENSE)。同梱のフォント BIZ UDPGothic は SIL Open Font License 1.1 です。依存するモジュールのライセンスは docs/reference.md にあります。

Directories

Path Synopsis
cmd
ponchimap command
Command ponchimap leaves a diagram of the infrastructure an app uses and a report in the repository it runs in.
Command ponchimap leaves a diagram of the infrastructure an app uses and a report in the repository it runs in.
internal
assets
Package assets holds the fonts and the icons a figure is drawn with, and the display names of providers.
Package assets holds the fonts and the icons a figure is drawn with, and the display names of providers.
cli
Package cli is the ponchimap command.
Package cli is the ponchimap command.
diag
Package diag holds the diagnostics the tool returns: what is wrong with an input, where, and how to put it right.
Package diag holds the diagnostics the tool returns: what is wrong with an input, where, and how to put it right.
importer
Package importer takes what an investigation found, and what the user adds to it, into the configuration model.
Package importer takes what an investigation found, and what the user adds to it, into the configuration model.
input
Package input reads one input document, JSON or YAML, and reports every problem with it as diagnostics that say where the problem is.
Package input reads one input document, JSON or YAML, and reports every problem with it as diagnostics that say where the problem is.
lint
Package lint checks a model and a view config before anything is drawn.
Package lint checks a model and a view config before anything is drawn.
model
Package model holds the configuration model: the single source of truth that diagrams and reports are derived from.
Package model holds the configuration model: the single source of truth that diagrams and reports are derived from.
render
Package render defines the boundary between the display model and whatever engine lays it out and draws it.
Package render defines the boundary between the display model and whatever engine lays it out and draws it.
render/d2render
Package d2render draws a Scene with D2.
Package d2render draws a Scene with D2.
report
Package report builds the evidence report that goes with one diagram: what every node, edge, and group is, which evidence backs it, what is unverified or disagrees, how far the investigation got, and how the figure shows each element.
Package report builds the evidence report that goes with one diagram: what every node, edge, and group is, which evidence backs it, what is unverified or disagrees, how far the investigation got, and how the figure shows each element.
view
Package view derives the display model (Scene) from the configuration model and the view config.
Package view derives the display model (Scene) from the configuration model and the view config.
workspace
Package workspace saves the files a command leaves in the user's repository.
Package workspace saves the files a command leaves in the user's repository.
Package schema embeds the public JSON Schemas of the tool.
Package schema embeds the public JSON Schemas of the tool.
Package skills embeds the agent Skill that init places where coding agents read skills.
Package skills embeds the agent Skill that init places where coding agents read skills.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL