# Diagram Generator

Generate, refine, validate, and render diagrams from natural language, notes, code...

- Repository: https://github.com/zhaoxuya520/reverse-skill (43923 stars)
- Category: Writing
- License: MIT
- Last updated: 2026-09-22
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add zhaoxuya520/reverse-skill --skill diagram-generator -g -a claude-code -y`
Codex: `npx skills add zhaoxuya520/reverse-skill --skill diagram-generator -g -a codex -y`
Cursor: `npx skills add zhaoxuya520/reverse-skill --skill diagram-generator -g -a cursor -y`
Gemini CLI: `npx skills add zhaoxuya520/reverse-skill --skill diagram-generator -g -a gemini-cli -y`

## Description

generate, refine, validate, and render diagrams from natural language, notes, code snippets, schemas, tables, or existing diagram source. use for flowcharts, swimlanes, sequence diagrams, state diagrams, er diagrams, class diagrams, architecture/c4-style diagrams, dependency graphs, gantt charts, mind maps, user journeys, sankey-style flows, org charts, network graphs, and other visual models. supports mermaid by default, graphviz dot for complex graph layout, plantuml for uml-heavy engineering diagrams, and svg output when direct markup is more reliable.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Diagram Generator

## ACTION REQUIRED（读完后立刻执行）

1. `NOW`：确认当前任务是否命中本 skill 的适用范围
2. `NOW`：读取 `../tool-index.md`，校验工具可用性和实际路径
3. `NEXT`：缺工具时调用 bootstrap，不要猜路径
4. `ACT`：进入"工作流"第一步并执行，不要停在确认状态

## Purpose

Create clear, editable diagrams from messy or structured inputs. Prefer text-based diagram source first so the result can be reviewed, versioned, and refined. Render to files only when the user asks for an image/PDF or when a downloadable artifact would materially help.

## Default workflow

1. Identify the user's intent, audience, and source material.
2. Choose the diagram family and language using the decision table below.
3. Normalize entities, relationships, labels, states, branches, and time/order information before writing diagram code.
4. Generate concise, readable diagram source.
5. Validate the syntax mentally and, when creating files, run `scripts/render_diagram.py`.
6. Return the diagram source plus a short note about assumptions. When files are generated, include links to the output files.

Do not over-ask for clarification. If the request is underspecified, make reasonable assumptions and label them briefly.

## Diagram language decision table

Use Mermaid unless another language is clearly better.

The rest: https://github.com/zhaoxuya520/reverse-skill/blob/HEAD/skills/diagram-generator/SKILL.md
