本文へスキップ
Skillpedia
ドキュメント作成18k · #10737

mermaid-diagrams

できること

このスキルは、AIエージェントが文書ページの中に、簡潔で正確な図を描けるよう支援します。技術文書を書き、流れや構造を図で示したい人向けです。

使う場面

  • ✓ページで説明しているリクエストや処理が、図で示した方がわかりやすいとき。
  • ✓ページが、いくつもの状態があるライフサイクルや、関連するデータ表の集まりを説明しているとき。
  • ✓既に図があるページを更新し、その図も同期させる必要があるとき。

スキルのリンク

https://github.com/langchain-ai/openwiki/blob/main/skills/mermaid-diagrams/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/langchain-ai/openwiki/blob/main/skills/mermaid-diagrams/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“APIの文書ページに、リクエストがAPIをどのように通過するかを示す図を追加してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、内容に合った図の種類(シーケンス図や状態図など)を選び、Mermaid形式で書きます。コードが裏付けるものだけを描き、各図の下に短い説明を付けます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Mermaid Diagrams In Generated Wiki Pages

Diagrams are part of high-quality wiki generation, not decoration. Where a flow, lifecycle, or data model is easier to grasp visually, embed a Mermaid diagram in a fenced ```mermaid block on the most relevant page.

Choosing a diagram type

  • sequenceDiagram for runtime and request flows across components (auth flows, request lifecycles, agent tool loops).
  • stateDiagram-v2 for lifecycles and state machines (job states, connection states, run phases).
  • erDiagram for the data model: entities and their relationships.
  • flowchart TD for branching control flow and decision logic.

Discipline

  • Ground every diagram in inspected source. Do not invent participants, states, entities, or relationships the code does not support.
  • Cover the high-value cases: add a diagram wherever a page documents a request or runtime flow, a call sequence, a lifecycle or state machine, or a data model. A repository wiki usually has several such diagrams, not one overall. Skip pages that are navigation, reference tables, or pure configuration.
  • Still prefer a few strong diagrams over decorating every page: one accurate diagram on the page that needs it beats a diagram forced onto every page.
  • Give each diagram a one-line caption directly below it stating what it shows.
  • OpenWiki validates every mermaid fence after your run and converts fences that fail to parse into plain text fences. A degraded diagram is a quality failure; follow the syntax rules below so it does not happen.

Syntax safety

These rules prevent the most common render breakages. When in doubt, rephrase the label.

  • Never place semicolons or pipes inside node, message, or edge labels.
  • Never place unescaped angle brackets in labels; write "returns Promise of User" instead of "returns Promise<User>".
  • In flowchart, wrap any label containing parentheses, brackets, or other punctuation in double quotes: A["calls foo(bar)"].
  • In flowchart, never use the bare word end as a node id, and never start a node id with o or x followed by a dash (both are edge-marker syntax); rename the node.
  • In sequenceDiagram, participant names with spaces or punctuation need an alias: participant AS as Auth Service.
  • Never use a Mermaid reserved word as a participant name, alias, or node id: note, end, loop, alt, opt, par, and, else, activate, deactivate, class, state, click, link. For example a notification participant must be Notifier, not Note (which collides with the note keyword).
  • In erDiagram, entity and attribute names must be single identifier-like tokens; put human phrasing in the relationship label.
  • Keep labels short. Move explanation into the surrounding prose or the caption, not the diagram.

Update runs

  • A wrong diagram is a stale claim, not existing structure to preserve. If a source change makes a diagram inaccurate, update the diagram in the same edit as the surrounding prose.
  • Do not rewrite a diagram that is still accurate. Regenerating unchanged diagrams creates diff noise.
  • If a page contains a text fence preceded by an HTML comment starting with "openwiki: mermaid parse failed", that is a diagram a previous run degraded. Fix the syntax using the parser error in the comment, restore the ```mermaid fence, and delete the comment.
よくある質問

どの種類の図を作れますか?

シーケンス図、状態図、エンティティ関連図、フローチャートを作れます。

すべてのページに図を追加しますか?

いいえ。飾りとしてすべてのページに図を入れるより、効果的な図を少数用いることを優先します。

図が正しいことは誰が確認しますか?

図は確認したソースコードと一致している必要があるとこのスキルは述べています。実行後にWikiツールが図を検証します。

詳細

作者による元の説明

Embed Mermaid diagrams in generated wiki pages. Use whenever documenting a runtime or request flow, a call sequence, a state machine or lifecycle, a data model or entity relationships, or non-trivial control flow, since these are clearer as a diagram than as prose. Also use when an update run touches a page that already contains a mermaid fence, or a page that contains a text fence a previous run degraded.

repo: langchain-ai/openwiki

人気

GitHubのスター
18k
ランキング
#10737
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル