Agent skill

Xs Diagram Generator

by karaage0703 in karaage0703/ai-assistant-workspace

内容に応じて最適な図表形式を自動選択し、ローカルで画像生成(Pillow)またはコード出力(Mermaid/PlantUML)。フローチャート、アーキテクチャ図、階層図などを生成。資料作成、システム設計時に使用。

MITAuto-check passedDevelopment

Install Xs Diagram Generator

skills CLI
$ npx skills add karaage0703/ai-assistant-workspace --skill xs-diagram-generator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install karaage0703/ai-assistant-workspace xs-diagram-generator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/karaage0703/ai-assistant-workspace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/xs-diagram-generator .claude/skills/xs-diagram-generator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
xs-diagram-generator
GitHub stars
136
Token cost
~1.1k tokens
SKILL.md length
104 words
Files
2
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

内容に応じて最適な図表形式を自動選択し、ローカルで画像生成(Pillow)またはコード出力(Mermaid/PlantUML)。フローチャート、アーキテクチャ図、階層図などを生成。資料作成、システム設計時に使用。

  • Works in 2 steps: Mermaid → 画像化(Docker mermaid-cli) → Pillow で直接画像生成(uv run)
  • Tasks that involve Diagrams
  • SKILL.md covers 判断フロー, 1. Mermaid → 画像化(Docker…, 2. Pillow で直接画像生成(uv run) and 利用可能な色, plus 2 more sections
  • Runs Python scripts from its folder; calls uv and docker

What it does

Xs Diagram Generator is an agent skill from karaage0703/ai-assistant-workspace. 内容に応じて最適な図表形式を自動選択し、ローカルで画像生成(Pillow)またはコード出力(Mermaid/PlantUML)。フローチャート、アーキテクチャ図、階層図などを生成。資料作成、システム設計時に使用。

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `draw_diagram.py`).

It sits in Development, covering Diagrams. It works with Mermaid. The licence is MIT.

When your agent uses it

  • Tasks that involve Diagrams

Example prompts

  • “/xs-diagram-generator”

Requirements

  • Python 3
  • Docker

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Mermaid → 画像化(Docker mermaid-cli)
  2. Pillow で直接画像生成(uv run)

What it can do on your machine

Read from SKILL.md and the folder at commit c689862. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv
    • docker

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv and docker, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Xs Diagram Generator loads about 1.1k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 104 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from karaage0703/ai-assistant-workspace at commit c689862, republished under its MIT licence (© karaage0703). 104 words, ~1,138 tokens.

Download SKILL.mdSave it as .claude/skills/xs-diagram-generator/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
xs-diagram-generator
description
内容に応じて最適な図表形式を自動選択し、ローカルで画像生成(Pillow)またはコード出力(Mermaid/PlantUML)。フローチャート、アーキテクチャ図、階層図などを生成。資料作成、システム設計時に使用。

スマート図表生成支援

内容に応じて最適な図表形式を自動選択し、画像を生成する。

判断フロー

Mermaidコードがすでにある?
  ├─ YES → Docker mermaid-cli で画像化(最優先)
  └─ NO  → 内容に応じて選択
              ├─ フロー/シーケンス → Mermaidコード作成 → Docker mermaid-cli
              └─ アーキテクチャ/階層 → Pillow(uv run)で直接生成

1. Mermaid → 画像化(Docker mermaid-cli)

Mermaidコードがある場合はこれを最優先で使う。

bash
# 1. Mermaidファイルを作成
cat > /tmp/diagram.mmd << 'EOF'
flowchart TB
    A[開始] --> B[処理]
    B --> C{判断}
    C -->|Yes| D[完了]
    C -->|No| B
EOF

# 2. Docker版 mermaid-cli で画像生成
docker run --rm -u $(id -u):$(id -g) \
  -v /tmp:/data \
  minlag/mermaid-cli \
  -i /data/diagram.mmd -o /data/diagram.png -b white

ポイント:

  • -u $(id -u):$(id -g) でパーミッション問題を回避
  • -b white で白背景(スライド向け)
  • 日本語・絵文字も表示可能
  • SVG出力: -o /data/diagram.svg
⚠️ Mermaid記法の注意(よく間違えるやつ)

改行は <br> を使う! \n は使わない!

mermaid
# NG(\n がそのまま表示される)
A["Gateway\nRust / Axum"]

# OK(ちゃんと改行される)
A["Gateway<br>Rust / Axum"]

subgraphのタイトルが長いと途中で改行される:

  • タイトルは短くする(15文字以内推奨)
  • 補足は中のノードに書く

線の交差を減らすコツ:

  • direction LR / direction TB をsubgraph内で使い分ける
  • 関連するノードを近くに配置する
  • 包含関係はsubgraphのネストで表現する(矢印より明確)

subgraphのネスト例(包含関係の表現):

mermaid
subgraph outer["親システム"]
    subgraph inner["子システム"]
        A["コンポーネントA"]
    end
    B["コンポーネントB"] --> A
end
複数ファイルを一括変換
bash
for f in /tmp/*.mmd; do
  docker run --rm -u $(id -u):$(id -g) \
    -v /tmp:/data \
    minlag/mermaid-cli \
    -i /data/$(basename "$f") -o /data/$(basename "$f" .mmd).png -b white
done

2. Pillow で直接画像生成(uv run)

Mermaidを経由せず、直接画像を生成したい場合に使用。

スクリプト実行
bash
uv run --with pillow python [SKILL_DIR]/draw_diagram.py <type> -o <output.png> -d '<json>'
対応する図の種類
アーキテクチャ図 (architecture)
bash
uv run --with pillow python [SKILL_DIR]/draw_diagram.py architecture \
  -o /tmp/arch.png -d '{
  "title": "システム構成",
  "boxes": [
    {"id": "api", "label": "API Server", "color": "blue", "row": 0, "col": 1},
    {"id": "db", "label": "Database", "sublabel": "PostgreSQL", "color": "green", "row": 1, "col": 0},
    {"id": "cache", "label": "Cache", "sublabel": "Redis", "color": "orange", "row": 1, "col": 2}
  ],
  "arrows": [
    {"from": "api", "to": "db", "label": "query"},
    {"from": "api", "to": "cache", "label": "read/write"}
  ]
}'

パラメータ:

  • boxes[].id: 識別子(矢印の接続に使用)
  • boxes[].label: メインラベル
  • boxes[].sublabel: サブラベル(オプション)
  • boxes[].color: blue/orange/purple/green/red/gray/teal
  • boxes[].row, boxes[].col: グリッド位置
  • arrows[].from, arrows[].to: 接続元・先の id
  • arrows[].label: 矢印のラベル(オプション)
フローチャート (flowchart)
bash
uv run --with pillow python [SKILL_DIR]/draw_diagram.py flowchart \
  -o /tmp/flow.png -d '{
  "title": "ユーザー登録フロー",
  "steps": [
    {"id": "s1", "label": "開始", "type": "start"},
    {"id": "s2", "label": "フォーム入力", "type": "process"},
    {"id": "s3", "label": "バリデーション", "type": "decision"},
    {"id": "s4", "label": "DB保存", "type": "process"},
    {"id": "s5", "label": "完了", "type": "end"}
  ],
  "connections": [
    {"from": "s1", "to": "s2"},
    {"from": "s2", "to": "s3"},
    {"from": "s3", "to": "s4", "label": "OK"},
    {"from": "s4", "to": "s5"}
  ]
}'

ステップの type: start(緑)/ end(赤)/ process(青)/ decision(オレンジ)

階層図 (hierarchy)
bash
uv run --with pillow python [SKILL_DIR]/draw_diagram.py hierarchy \
  -o /tmp/org.png -d '{
  "title": "組織図",
  "root": {
    "label": "CEO",
    "color": "purple",
    "children": [
      {"label": "CTO", "color": "blue", "children": [
        {"label": "Dev Team", "color": "green"},
        {"label": "Infra Team", "color": "green"}
      ]},
      {"label": "CFO", "color": "orange", "children": [
        {"label": "Finance", "color": "gray"}
      ]}
    ]
  }
}'

利用可能な色

色名用途の目安
blue技術系、API、サーバー
green正常系、開始、データベース
orange条件分岐、警告、キャッシュ
purple重要、トップレベル
red終了、エラー、削除
gray補助、外部システム
tealその他

使用例

Mermaidコードを画像化したい場合
「このMermaidを画像にして」
→ .mmdファイルに保存 → docker mermaid-cli → PNG送信
ゼロから図を作りたい場合
「APIサーバー、DB、キャッシュの構成図を作って」
→ Pillow architecture で JSON 生成 → uv run → PNG送信

「ユーザー登録の流れをフローチャートにして」
→ Mermaidコード作成 → docker mermaid-cli → PNG送信

⚠️ 注意事項

  • ローカル mermaid-cli (npx): ARM64環境ではPuppeteerが動作しないため非推奨。Docker版を使うこと。
  • Mermaid記法の落とし穴は上の「⚠️ Mermaid記法の注意」セクションを参照

© karaage0703, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/xs-diagram-generator of karaage0703/ai-assistant-workspace.

  • SKILL.md
  • draw_diagram.py

Open the folder on GitHubat commit c689862

Compare with similar skills

Xs Diagram Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Xs Diagram Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Xs Diagram Generator this skillkaraage0703/ai-assistant-workspace136—~1.1kAutomated safety check: PassMIT
Archify Diagramstt-a1i/archify82k—~2.9kAutomated safety check: PassMIT
Diagram Designcathrynlavery/diagram-design49k1 repos~7.6kAutomated safety check: PassMIT
Draw.io Diagram StudioAgents365-ai/drawio-skill10k—~2.4kAutomated safety check: NotesMIT
Pretty Mermaid Rendererimxv/Pretty-mermaid-skills1.5k—~2kAutomated safety check: PassMIT
Archify Diagram BuilderUnclecheng-li/AI_Animation1.5k2 repos~4.1kAutomated safety check: PassMIT

Similar skills

  • Archify Diagrams

    tt-a1i/archify

    Creates interactive architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone HTML with inline SVG, themes and image or video export.

    82k GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Diagram Design

    cathrynlavery/diagram-design

    Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.

    49k GitHub starsUsed in 1 repo~7.6k tokens
    DevelopmentAuto-check passed
  • Draw.io Diagram Studio

    Agents365-ai/drawio-skill

    Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.

    10k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check: notes
  • Pretty Mermaid Renderer

    imxv/Pretty-mermaid-skills

    Writes and renders Mermaid diagrams as themed SVG, PNG or terminal ASCII and Unicode art with a bundled Node.js CLI that needs no browser.

    1.5k GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Archify Diagram Builder

    Unclecheng-li/AI_Animation

    Builds validated architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone interactive HTML from a small JSON spec, with optional motion and image export.

    1.5k GitHub starsUsed in 2 repos~4.1k tokens
    DevelopmentAuto-check passed
  • Mermaid

    WH-2099/mermaid-skill

    Generate Mermaid diagrams from user requirements. An agent skill from WH-2099/mermaid-skill.

    288 GitHub starsUsed in 4 repos~958 tokens
    DevelopmentAuto-check passed

More from karaage0703/ai-assistant-workspace

All 23 skills in this repo
  • Xs Arxiv

    karaage0703/ai-assistant-workspace

    arXiv論文の検索・トレンド発見・詳細分析を行う統合スキル。興味度スコアでユーザーに刺さる論文を自動選定。PDF全文読み込み・Notion蓄積対応。「arXivチェックして」「論文検索」「論文分析して」で使用。

    136 GitHub stars~1.4k tokensUpdated 18 days ago
    Auto-check passed
  • Xs Multi Agent

    karaage0703/ai-assistant-workspace

    異なるproviderのAI(Codex/Claude/Grok/Cursor/Antigravity等)から独立意見を集め、共通論点で相互検討して統合する。最初に利用可能エージェントを検出する。「みんなで考えて」「マルチエージェントで分析して」「複数のAIでレビューして」と言われたら使う。

    136 GitHub stars~1.8k tokensUpdated 18 days ago
    Auto-check passed
  • Xs Podcast

    karaage0703/ai-assistant-workspace

    ポッドキャストの音声取得・文字起こし・まとめを行う統合スキル。「ポッドキャストまとめて」「音声配信をダウンロード」「Podcastの内容を教えて」で使用。

    136 GitHub stars~557 tokensUpdated 18 days ago
    Auto-check passed
  • Xs Skill Creator

    karaage0703/ai-assistant-workspace

    スキルの作成・改善を行うスキル。既存スキルの分析から抽出したパターンとテンプレートで統一感のあるスキルを効率的に作成。スキルを作りたい、新しいスキルを追加したい、スキルを改善したい、SKILL.mdを書きたい場合に使用。

    136 GitHub stars~1k tokensUpdated 18 days ago
    Auto-check passed
  • Xs Bridge Ideas

    karaage0703/ai-assistant-workspace

    ワークスペース内の遠い知識や活動をつないで、新しいアイデアを生成する思考支援スキル。過去記事・メモ・発信資産から企画や実装ネタを出したい時に使用。「アイデア出して」「知識をつないで」「一見関係ないものをつないで」で使用。

    136 GitHub stars~487 tokensUpdated 18 days ago
    Auto-check passed
  • Xs Calendar

    karaage0703/ai-assistant-workspace

    カレンダー予定を確認するスキル。ICS(Googleカレンダー等)と手動追加(画像読み取り)を統合。「今日の予定」「明日の予定」「カレンダー画像送って」「スケジュール確認」で使用。/calendar で発動。

    136 GitHub stars~441 tokensUpdated 18 days ago
    Auto-check passed

Works with

Categories

Questions about Xs Diagram Generator

What does Xs Diagram Generator do?

内容に応じて最適な図表形式を自動選択し、ローカルで画像生成(Pillow)またはコード出力(Mermaid/PlantUML)。フローチャート、アーキテクチャ図、階層図などを生成。資料作成、システム設計時に使用。. Xs Diagram Generator is an agent skill from karaage0703/ai-assistant-workspace.

When should I use Xs Diagram Generator?

Xs Diagram Generator fits situations like: tasks that involve Diagrams.

How do I install Xs Diagram Generator in Claude Code?

Run `npx skills add karaage0703/ai-assistant-workspace --skill xs-diagram-generator -a claude-code`. Or copy the skill folder (skills/xs-diagram-generator in karaage0703/ai-assistant-workspace) into .claude/skills/xs-diagram-generator in your project. Claude Code loads it when a task matches its description.

How do I install Xs Diagram Generator in Codex?

Run `npx skills add karaage0703/ai-assistant-workspace --skill xs-diagram-generator -a codex`. Or copy the skill folder (skills/xs-diagram-generator in karaage0703/ai-assistant-workspace) into .agents/skills/xs-diagram-generator in your project. Codex loads it when a task matches its description.

Can I use Xs Diagram Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add karaage0703/ai-assistant-workspace --skill xs-diagram-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/xs-diagram-generator, .gemini/skills/xs-diagram-generator, .github/skills/xs-diagram-generator and .opencode/skills/xs-diagram-generator in your project.

What does Xs Diagram Generator need to run?

Going by SKILL.md and its folder, Xs Diagram Generator needs Python for the scripts in its folder and the command-line tools its instructions call (uv and docker). Our summary lists: Python 3; Docker.

Does Xs Diagram Generator access the network?

SKILL.md contains no URLs. Its commands use uv and docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Xs Diagram Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Xs Diagram Generator use?

Xs Diagram Generator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Xs Diagram Generator use?

About 1.1k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Xs Diagram Generator?

Skills that share tags, products or a category with Xs Diagram Generator: Archify Diagrams (tt-a1i/archify, 82k stars), Diagram Design (cathrynlavery/diagram-design, 49k stars), Draw.io Diagram Studio (Agents365-ai/drawio-skill, 10k stars) and Pretty Mermaid Renderer (imxv/Pretty-mermaid-skills, 1.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Xs Diagram Generator?

karaage0703 (a GitHub user) maintains it in karaage0703/ai-assistant-workspace, which has 136 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on September 23, 2026.

Source: karaage0703/ai-assistant-workspace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.