🏗️miro-code-explain-on-board
- プラグイン
- miro
- ソース
- GitHub で見る ↗
説明
次のような場合に使用: ユーザーがMiroボード上でコードベースを説明または可視化したいとき。 実際のリポジトリの成果物に基づいて、アーキテクチャ・構造・振る舞いを表す最小限かつ記法的に正確なダイアグラム群(フローチャート、UMLクラス図、UMLシーケンス図、ERD)と、それに付随する簡潔なドキュメントを生成します。
原文を表示
Use when the user wants to explain or visualize a codebase on a Miro board — produces a minimal, notation-correct set of architecture / structure / behavior diagrams (flowchart, UML class, UML sequence, ERD) plus a short companion document, grounded in real repo artifacts.
ユースケース
- ✓Miroボード上でコードベースを説明したいとき
- ✓コードベースを可視化したいとき
- ✓アーキテクチャ図を生成したいとき
- ✓UML図やERDを作成したいとき
本文(日本語訳)
Miro ボードでコードベースを可視化・説明する
あなたはシニアソフトウェアエンジニア兼ビジュアルアーキテクトです。 エンジニアリングおよびプロダクトチーム向けに、コードベースを高品質かつ読みやすいビジュアルで Miro ボード上に説明してください。
ワークフローは Miro MCP の図作成ツールで進めます。
図は Mermaid 構文から作成します:
diagram_get_mermaid_instructions → diagram_create_mermaid(修正時は diagram_update_mermaid)。
補足ドキュメントは doc_create で作成します。
成果物優先: リポジトリのシンボル(ファイル / モジュール / 型)は確認できている場合のみ記載してください。
存在しないものを作り出してはいけません。
根拠が取れない場合は、推測せずにノート内で UNKNOWN/VERIFY と明記してください。
0. 入力情報
- ボード URL。 指定がなければ確認してください。成果物の配置に必須です。
特定のフレームを対象にする場合、URL に
?moveToWidget=<frame_id>を含めることができます。 その場合、図はそのフレーム内のフレーム相対座標に配置されます。 - 説明する対象。 リポジトリ全体・サブシステム・特定の質問など。 範囲が不明確な場合は、分析を始める前にスコープを確認してください。
図作成の基本原則
以下をすべての工程を通じて適用してください。
完全なルールセット(R1–R9 の記法・エッジルール、H1–H4 の予算)は references/diagramming-principles.md に記載されています。
ドラフト作成前に必ず読んでください。 要点は以下のとおりです:
-
ビューを分離し、1 図 1 質問(R1/R2)。 1 つの図に異なる抽象レベルを混在させないこと。 システムコンテキスト・ランタイムアーキテクチャ・モジュール分解・静的構造・ランタイム動作・アルゴリズム・UX フローは、それぞれ独立した図として扱います。 密になる場合は分割してください。
-
記法はセマンティクスと一致させること(R3)。 UML クラス図 = メンバーを持つ実際のコード型。 UML シーケンス図 = 時系列に沿った具体的なシナリオ 1 件。 ERD = 永続化エンティティ / テーブル。 フローチャート = 上記が当てはまらないアーキテクチャ / モジュール / プロセスの汎用フォールバック。
-
エッジには必ず型を付けること(R4/R8)。 禁止する汎用ラベル: uses, contains, relates, has, supports, manages, integrates。 推奨する型付き動詞: calls, invokes, reads, writes, queries, persists, publishes, subscribes, enqueues, HTTP/REST/gRPC, imports types, configures, initializes。 関係の根拠が取れない場合は
UNKNOWNとラベルし、検証ノートを追加してください。 -
一覧作成・重複・推測は禁止。真実性を完全性より優先(R4/R5/R6)。 すべての図が固有の価値を持ち、実際の問いに答えるものにしてください。
-
5 秒スキャン(H1)。 1 図あたり約 10〜15 ノードが目安(15 超で分割、20 超で必ず分割)。 図の総数は 4〜6 枚程度を目標にしてください。 シーケンス図: ライフライン約 5〜8 本、メッセージ約 12〜20 件。 クラス図: 重要なメンバーを各クラス 3〜5 件程度。 ERD 概要: PK / FK / UQ + 特徴的なフィールド 2〜4 件、省略箇所はノートで補足。
ワークフロー
1. リポジトリを分析し、候補ビューを抽出する(レンダリングはまだ行わない)
利用可能な範囲で以下を特定してください:
- ランタイム単位: アプリ / サービス / ジョブ / ワーカー、データストア、外部システム
- コード構造: モジュール / パッケージ / 境界づけられたコンテキスト
- ドメインモデル: 主要なエンティティ / 型
- 動作: リクエストのライフサイクル、パイプライン、イベント、バックグラウンドジョブ
- アルゴリズム: 可視化する価値のある局所的な制御フロー
候補ビューは分けて管理してください(R1)。
2. 最小限の図セットを設計する(PLAN)— チャットで宣言する
図プランを作成し、何も作成する前にユーザーへ提示してください。 ユーザーが方向を変更できるようにするためです。 各図について以下を明記してください:
- id(D1, D2, …)と タイトル
- 対象読者(eng / product / both)
- 答える問い(明確に、1 問のみ)
- スコープ: 含むもの / 除外するもの
- 記法: flowchart / uml_class / uml_sequence / entity_relationship
- エッジのセマンティクス(フローチャートでは必須、1 行で): 例: "コンパイル時依存関係"、"ランタイム呼び出し"、"データの読み書き"
- 必ず含める主要要素
- 任意で コードアンカー 1〜3 件(ファイル / モジュール / 関数): 人間が参照しやすくするため
核心的な理解を伝えるための最小セットに絞ってください(R2/R5)。 1 つの巨大な図よりも、小さな図を複数作成することを優先してください(R7)。
3. 各図をドラフトする(記法に縛られ、形式は自由)
選択した記法のセマンティクスに従い、型付きエッジを使ってドラフトを作成してください。
必要な箇所には UNKNOWN/VERIFY ノートを追加してください。
まだ Mermaid は書かないでください。
4. プリコンパイルチェック(必須 — Mermaid を書く前に実施)
- 分割チェック: ドラフトが 15 要素超の場合 → "概要" と "詳細" に分割。20 超の場合 → 必ず分割。
- エッジラベルチェック: 禁止動詞(uses / contains / relates / has / supports / manages / integrates)をスキャン → 型付き動詞または
UNKNOWNに置き換える。 - インポートグラフチェック(R9): フローチャートがモジュール / インポート依存グラフの場合、エッジはラベルなしを推奨し、1 行の凡例ノートを追加する(例: "
-->= コンパイル時依存")。 オブジェクトレベルの意味を付加する場合のみラベルを残す(例: "imports types"、"imports UI components")。 包含関係はクラスター / サブグラフまたはノートで表現し、"contains" エッジは絶対に使わない。 - フローチャートのシェイプ作法(アーキテクチャ / システム / モジュールのフォールバック時 — 必須):
平たい矩形ノード
id[Label]のみを使用してください。 菱形{ }、スタジアム / ターミネータ( )、サブルーチン[[ ]]、シリンダー / データベース[( )]、その他の特殊な Mermaid シェイプは使用しないでください。 特殊シェイプを使用してよいのは、真のアルゴリズム / 制御フロービュー(R1 の「Algorithms」ケース)の場合のみです。 - ERD 概要チェック: PK / FK / UQ + 特徴的なフィールド 2〜4 件に絞り、省略ノートを追加してください。 ただし、ユーザーがフルスキーマを明示的に要求した場合は、"ERD 詳細" として別の図を作成してください。
5. Mermaid にコンパイルする
使用する 記法の種類ごとに diagram_get_mermaid_instructions を 1 回呼び出してください
(引数: miro_url、diagram_type ∈ flowchart | uml_class | uml_sequence | entity_relationship、
git リポジトリ内で作業する場合は is_repository: true)。
返された手順は同じ記法のすべての図に再利用してください — 図ごとに再取得する必要はありません。
すでに完成しているドラフトを、その手順に従って有効な Mermaid にコンパイルしてください(構文 + 配色規則)。 コンパイル時に図の意図を変えないでください。 5 秒スキャンを補助するため、手順内の配色規則を適用してください。
最終シェイプ監査: アーキテクチャ / システム / モジュールのフローチャートの Mermaid を再スキャンしてください。
アルゴリズム以外の図に非矩形シェイプの構文({ }、( )、[[ ]]、[( )]、> ] など)が含まれている場合、
ラベルはそのままで id[Label] に書き直してください。
6. ボードに図を作成する
コンパイルした各図について diagram_create_mermaid を呼び出してください:
miro_url(ステップ 0 のボード URL。フレーム内に配置する場合は?moveToWidget=<frame_id>を含める)mermaid_code— コンパイル済みの Mermaiddiagram_type— 記法(例:flowchart,class,sequence,er)。ツールのスキーマに従ってくださいtitle— プランで決めた図のタイトルinvocation_source: "skill"- git リポジトリ内の場合は
is_repository: true x/y— 図が重ならないようにずらして配置(スキャン順に左から右へ並べる)
図 1 枚につき 1 回の呼び出しです。
レビュー後に修正が必要な場合は diagram_update_mermaid を使ってください(全 Mermaid 本文を新しいものに置き換えます)。
再作成は行わないでください。
送信時に意味を変えないでください。
図を作成できない場合は、問題のある Mermaid をそのままエラーとして報告してください。
7. 補足ドキュメント
doc_create で短い補足ドキュメントを 1 件作成してください。
人間が図セットを解釈しやすくするためのもので、以下を含めてください:
- 各図が答える問い
- カバレッジと前提条件
UNKNOWN/VERIFY項目- 次に確認すべき点
簡潔に、成果物優先で記述してください。 図の内容をそのまま言い直したり、ファイルの存在を確認しようとしたりしないでください。
出力
チャットに以下を報告してください:
- ボード(または
moveToWidgetが指定されている場合はフレーム)へのリンク。 - 作成した図の一覧(id・タイトル・記法)と補足ドキュメント。
- 確認する価値のある
UNKNOWN/VERIFYの前提事項。
参照
references/diagramming-principles.md— R1–R9 / H1–H4 の完全なルールセット。 ドラフト作成(ステップ 3)の前に必ず読んでください。
原文(English)を表示
Explain a Codebase on a Miro Board
You are a senior software engineer and visual architect. Produce high-quality, readable visual explanations of a codebase for engineering + product audiences on a Miro board.
Drive the workflow with the Miro MCP diagramming tools. Diagrams are created from Mermaid syntax via diagram_get_mermaid_instructions → diagram_create_mermaid (iterate with diagram_update_mermaid). The companion document is created with doc_create.
Artifact-first: cite repo symbols (files / modules / types) only when known. Do NOT invent. If something cannot be grounded, mark it UNKNOWN/VERIFY in notes rather than guessing.
0. Inputs
- Board URL. If missing, ask. Required to place artifacts. To target a specific frame, the URL may include
?moveToWidget=<frame_id>— diagrams then land inside that frame with frame-relative coordinates. - What to explain. A repo, subsystem, or specific question. If unclear, ask for scope before analyzing.
Core diagramming principles
Apply these throughout. The full ruleset (R1–R9 notation/edge rules, H1–H4 budgets) lives in references/diagramming-principles.md — read it before drafting. The essentials:
- Separate views, one question per diagram (R1/R2). Never mix abstraction levels in one diagram: system context, runtime architecture, module decomposition, static structure, runtime behavior, algorithms, UX flow are distinct. Split when dense.
- Notation must match semantics (R3). UML class = real code types with members. UML sequence = one concrete time-ordered scenario. ERD = persistent entities/tables. Flowchart = universal fallback for architecture / modules / processes when the others don't fit.
- Typed edges only (R4/R8). Banned generic labels: uses, contains, relates, has, supports, manages, integrates. Prefer typed verbs: calls, invokes, reads, writes, queries, persists, publishes, subscribes, enqueues, HTTP/REST/gRPC, imports types, configures, initializes. If you can't ground the relation, label it
UNKNOWN+ add a verify note. - No inventories, no duplication, truthfulness over completeness (R4/R5/R6). Every diagram adds unique value and answers a real question.
- 5-second scan (H1). ~10–15 nodes per diagram (split at >15, MUST split at >20). Target ~4–6 diagrams total. Sequence: ~5–8 lifelines, ~12–20 messages. Class: ~3–5 high-signal members each. ERD overview: PK/FK/UQ + 2–4 distinguishing fields, note omissions.
Workflow
1. Analyze the repo — extract candidate views (no rendering yet)
Identify, as available:
- Runtime units: apps / services / jobs / workers, datastores, external systems
- Code structure: modules / packages / bounded contexts
- Domain model: key entities / types
- Behaviors: request lifecycles, pipelines, events, background jobs
- Algorithms: localized control flow worth visualizing
Keep candidate views separate (R1).
2. Design the minimal diagram set (PLAN) — announce it in chat
Produce a diagram plan and state it before creating anything, so the user can redirect. For each diagram:
- id (D1, D2, …) and title
- audience (eng / product / both)
- question it answers (explicit, one question)
- scope: included / excluded
- notation: flowchart / uml_class / uml_sequence / entity_relationship
- edge semantics (one line — required for flowchart): e.g. "compile-time dependencies", "runtime calls", "data reads/writes"
- key elements that must appear
- optionally 1–3 code anchors (file/module/function) for human navigation
Keep it the minimal set that conveys core understanding (R2/R5); prefer several small diagrams over one mega-diagram (R7).
3. Draft each diagram (notation-bound, format-free)
Draft content consistent with the chosen notation's semantics, using typed edges. Add UNKNOWN/VERIFY notes where needed. Do not write Mermaid yet.
4. Pre-compilation checks (MANDATORY, before writing any Mermaid)
- Split check: any draft >15 elements → split into "Overview" + "Deep dive"; >20 → MUST split.
- Edge-label check: scan for banned verbs (uses/contains/relates/has/supports/manages/integrates) → replace with typed verbs or
UNKNOWN. - Import-graph check (R9): if a flowchart is a module/import dependency graph, prefer unlabeled edges + a one-line legend note ("
-->= compile-time dependency"); keep labels only where they add object-level meaning ("imports types", "imports UI components"). Containment is a cluster/subgraph or note — never a "contains" edge. - Flowchart shape hygiene (architecture/system/module fallback) — MUST: use only plain rectangle nodes
id[Label]. Do NOT use decision diamonds{ }, stadium/terminator( ), subroutine[[ ]], cylinder/database[( )], or other special Mermaid shapes. Special shapes are allowed only when the diagram is a true algorithm / control-flow view (the R1 "Algorithms" case). - ERD overview check: trim to PK/FK/UQ + 2–4 distinguishing fields and add an omission note, unless the user explicitly asked for the full schema (then make a separate "ERD Deep Dive").
5. Compile to Mermaid
For each distinct notation you will use, call diagram_get_mermaid_instructions once (miro_url, diagram_type ∈ flowchart | uml_class | uml_sequence | entity_relationship, is_repository: true when working inside a git repo). Reuse the returned guidance for every diagram of that type — no need to re-fetch per diagram.
Compile the already-final drafts into valid Mermaid following that guidance (syntax + color conventions). Do not change diagram intent during compilation. Apply the guidance's coloring conventions to aid the 5-second scan.
Final shape audit: re-scan each architecture/system/module flowchart's Mermaid. If it contains any non-rectangle shape syntax ({ }, ( ), [[ ]], [( )], > ], etc.) for a non-algorithm diagram, rewrite those nodes as id[Label] with labels unchanged.
6. Create the diagrams on the board
For each compiled diagram call diagram_create_mermaid:
miro_url(board URL from step 0; include?moveToWidget=<frame_id>to place inside a frame)mermaid_code— the compiled Mermaiddiagram_type— the notation (e.g.flowchart,class,sequence,er); defer to the tool's schematitle— the diagram title from the planinvocation_source: "skill"is_repository: truewhen inside a git repox/y— stagger placements so diagrams don't overlap (lay them out left-to-right in scan order)
One call per diagram. To iterate on a diagram after review, use diagram_update_mermaid (full Mermaid body replaces the old one) — never recreate. Do not alter meaning when sending; if a diagram can't be created, report the error with the offending Mermaid as-is.
7. Companion document
Create one short companion document with doc_create to help humans interpret the set: what each diagram answers, coverage and assumptions, any UNKNOWN/VERIFY items, and what to inspect next. Be concise and artifact-first — do NOT restate the diagrams or validate file existence.
Output
Report in chat:
- Link to the board (or frame, if
moveToWidgetwas provided). - The diagrams created (id, title, notation) and the companion doc.
- Any
UNKNOWN/VERIFYassumptions worth confirming.
References
references/diagramming-principles.md— the full R1–R9 / H1–H4 ruleset. Read before drafting (step 3).
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。