xs-diagram-generator

xs-diagram-generator is a skill for Claude Code, Codex from karaage0703/ai-assistant-workspace. It costs 81 tokens per session (2,037 once invoked), scanned A, original, MIT.

A tool for choosing and creating diagrams from written information. It can produce Mermaid or PlantUML code, or image files made locally with Pillow, a Python image library.

In plain words
What is it for?
Use it when preparing documents or designing systems that need flowcharts, sequence diagrams, architecture diagrams, or nested hierarchy diagrams.
Why use it?
Choosing the right diagram format and drawing it by hand can take time. This tool provides a repeatable way to turn system descriptions into flowcharts, architecture diagrams, and hierarchy diagrams.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when preparing documents or designing systems that need flowcharts, sequence diagrams, architecture diagrams, or nested hierarchy diagrams.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/karaage0703/ai-assistant-workspace/xs-diagram-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add karaage0703/ai-assistant-workspace --skill xs-diagram-generator
Clone the repo
git clone --depth 1 https://github.com/karaage0703/ai-assistant-workspace

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xs-diagram-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/karaage0703/ai-assistant-workspace/xs-diagram-generator/github.svg)](https://agentmods.dev/skills/karaage0703/ai-assistant-workspace/xs-diagram-generator)
Your own site
<a href="https://agentmods.dev/skills/karaage0703/ai-assistant-workspace/xs-diagram-generator"><img src="https://agentmods.dev/badge/skills/karaage0703/ai-assistant-workspace/xs-diagram-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for xs-diagram-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/karaage0703/ai-assistant-workspace/xs-diagram-generator"><img src="https://agentmods.dev/badge/skills/karaage0703/ai-assistant-workspace/xs-diagram-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,037 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 37
    Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
    Fix: Pin the image: image:tag or image@sha256:abc123
  • medium MCP Rug Pull · line 84
    Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
    Fix: Pin the image: image:tag or image@sha256:abc123
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.02037
Opus 5 $0.00041 $0.01019
Sonnet 5 $0.00016 $0.00407
Haiku 4.5 $0.00008 $0.00204

Measured 13d ago against content hash aa604fb3ce43, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

xs-diagram-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (draw_diagram.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/xs-diagram-generator/SKILL.md · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.

スマート図表生成支援

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

判断フロー

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

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

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

# 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 は使わない!

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

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

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

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

線の交差を減らすコツ:

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

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

subgraph outer["親システム"]
    subgraph inner["子システム"]
        A["コンポーネントA"]
    end
    B["コンポーネントB"] --> A
end

複数ファイルを一括変換

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を経由せず、直接画像を生成したい場合に使用。

スクリプト実行

uv run --with pillow python [SKILL_DIR]/draw_diagram.py <type> -o <output.png> -d '<json>'

対応する図の種類

アーキテクチャ図 (architecture)
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"}
  ]
}'

Read the full file on GitHub · 217 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 217 lines · 81 tokens per session scan A aa604fb3ce43

Subscribe to this mod's changes

xs-diagram-generator is a skill published in the GitHub repository karaage0703/ai-assistant-workspace (137 stars, last pushed 25d ago), licensed MIT. It adds 81 tokens to every session and 2,037 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

kami-landing

Produce a print-grade single-page kami (紙 / 纸) document — warm parchment canvas, ink-blue accent, serif at one weight, no italic, no cool grays. The output reads like a professional white paper or studio one-pager, not an app UI. Multilingual by design (EN · zh-CN · ja). One self-contained HTML file, zero dependencies.

nexu-io/open-design · 81 tokens

applying-brand-guidelines

This skill applies consistent corporate branding and styling to all generated documents including colors, fonts, layouts, and messaging.

anthropics/claude-cookbooks · 27 tokens

html-ppt-obsidian-claude-gradient

OpenDesign's enterprise AI-adoption brief: local-first agents at work, the risk controls, the ROI, and the rollout plan. Built as a decision-grade AI literacy deck for leadership, IT, security.

nexu-io/open-design · 53 tokens

kami

A design and typesetting guide for creating professional documents and product landing pages, such as resumes, white papers, portfolios, and slide decks.

tw93/Kami · 157 tokens

read

Reads URLs and PDFs by fetching source content, defaulting to concise summaries for plain read requests and clean Markdown when asked to convert, save, quote, cite, or feed downstream work. Use when users ask in any language to read, fetch, check, summarize, quote, cite, convert, or save a URL or PDF. Not for local…

tw93/Waza · 78 tokens

mermaid-tools

Extracts Mermaid diagrams from markdown files and generates high-quality PNG images using bundled scripts. Activates when working with Mermaid diagrams, converting diagrams to PNG, extracting diagrams from markdown, or processing markdown files with embedded Mermaid code.

daymade/claude-code-skills · 48 tokens