diagram-generator
Skill26 starsChanged 10 days agoMITView on GitHub
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.
- Installs packages
We split this skill into the rules it gives an agent
28 rules. 0 are common, 18 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
18
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Create clear, editable diagrams from messy or structured inputs.
- Distinctive: line 21
Do not over-ask for clarification.
- Distinctive: line 25
Use Mermaid unless another language is clearly better.
- Distinctive: line 45
Always provide editable source unless the user explicitly asks only for an image.
- Distinctive: line 46
Default to a single best diagram.
- Distinctive: line 47
Prefer stable, simple syntax over fancy features that may not render in older Mermaid/PlantUML versions.
- Distinctive: line 48
Use short labels. Split long text into notes outside the diagram when needed.
- Distinctive: line 49
Avoid ambiguous node IDs. Use ASCII IDs and human-readable labels.
- Very specific: line 60
Start with the correct diagram directive, for example flowchart TD, sequenceDiagram, erDiagram, gantt, mindmap, or journey.
- Distinctive: line 62
Use subgraphs for swimlanes or architecture layers.
- Very specific: line 63
Keep node IDs stable and ASCII-only, for example ingest_service[Ingest Service].
- Very specific: line 65
Use decision diamonds for branching: decision{Condition?}.
- Very specific: line 66
Use consistent edge labels: -- yes -->, -- no -->, -.
- Very specific: line 68
Use alt/else/end, opt/end, loop/end, and par/and/end blocks for conditional, optional, repeated, and parallel flows.
- Distinctive: line 72
Use Graphviz for large, dense, or layout-sensitive relationship diagrams.
- Very specific: line 74
Prefer digraph G for directed relationships and graph G for undirected networks.
- Very specific: line 76
Use subgraph cluster_name for boundaries and subsystems.
- Distinctive: line 77
Use plain labels and restrained styling.
- Distinctive: line 78
Use edge labels only when they add meaning.
- Distinctive: line 83
Use PlantUML when the user asks for UML or needs formal UML notation.
- Very specific: line 86
Use actor, participant, database, queue, collections, or component stereotypes when useful.
- Very specific: line 87
Use package, rectangle, or node for architecture boundaries.
- Distinctive: line 93
Use SVG only when text diagram languages cannot express the requested visual reliably.
- Distinctive: line 95
Keep SVG simple, accessible, and editable.
- Distinctive: line 97
Prefer rectangles, lines, arrows, and groups over complex paths.
- Distinctive: line 98
Do not embed external fonts or remote images.
- Very specific: line 102
When the user asks for PNG/SVG/PDF, create a source file and run:
- Distinctive: line 127
Use this structure for most diagram answers:
“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Diagram Generator
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
- Identify the user's intent, audience, and source material.
- Choose the diagram family and language using the decision table below.
- Normalize entities, relationships, labels, states, branches, and time/order information before writing diagram code.
- Generate concise, readable diagram source.
- Validate the syntax mentally and, when creating files, run
scripts/render_diagram.py. - 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.
| User wants | Prefer | Why |
| process flow, decision tree, simple swimlane | Mermaid flowchart | readable and easy to paste into Markdown |
| sequence of system/user interactions | Mermaid sequenceDiagram or PlantUML sequence | Mermaid for docs; PlantUML for UML formality |
| lifecycle, state machine, transitions | Mermaid stateDiagram-v2 or PlantUML state | compact transition syntax |
| database schema, entities, relationships | Mermaid erDiagram | portable ER notation |
| class/interface/object model | Mermaid classDiagram or PlantUML class | Mermaid for docs; PlantUML for detailed UML |
| project schedule | Mermaid gantt | concise timeline syntax |
| hierarchy, ideas, notes | Mermaid mindmap | good default for idea maps |
| customer/product journey | Mermaid journey | built-in journey notation |
| git history | Mermaid gitGraph | built-in git notation |
| dependency graph, package graph, large network | Graphviz DOT | better layout engines for dense graphs |
| architecture with layers, clusters, boundaries | Mermaid flowchart with subgraphs, Graphviz clusters, or PlantUML C4-style | choose based on requested fidelity |
| weighted flow/sankey-like relationship | Mermaid sankey-beta when supported, otherwise SVG or Graphviz | Mermaid support may vary by renderer |
| custom visual where source languages fit poorly | SVG | precise control over layout and styling |
Output policy
- Always provide editable source unless the user explicitly asks only for an image.
- Default to a single best diagram. Offer alternatives only when genuinely useful.
- Prefer stable, simple syntax over fancy features that may not render in older Mermaid/PlantUML versions.
- Use short labels. Split long text into notes outside the diagram when needed.
- Avoid ambiguous node IDs. Use ASCII IDs and human-readable labels.
- Preserve user terminology, but standardize capitalization within a diagram.
- For technical diagrams, include boundaries such as client, service, database, queue, external API, and operator/user when they are implied.
- For business-process diagrams, distinguish happy path, decision points, failures, retries, and manual steps when present.
- For diagrams created from uncertain text, include an
Assumptionssection after the code.
Mermaid generation rules
Consult references/diagram-patterns.md for compact templates.
General Mermaid rules:
- Start with the correct diagram directive, for example
flowchart TD,sequenceDiagram,erDiagram,gantt,mindmap, orjourney. - For flowcharts, use
flowchart TDunless the user asks for left-to-right; useflowchart LRfor architecture and pipelines. - Use subgraphs for swimlanes or architecture layers. Name subgraphs with readable labels.
- Keep node IDs stable and ASCII-only, for example
ingest_service[Ingest Service]. - Quote labels that contain punctuation likely to confuse the parser.
- Use decision diamonds for branching:
decision{Condition?}. - Use consistent edge labels:
-- yes -->,-- no -->,-. async .->, or== critical ==>only when meaningful. - In sequence diagrams, declare participants before messages. Use
actorfor humans andparticipantfor systems. - Use
alt/else/end,opt/end,loop/end, andpar/and/endblocks for conditional, optional, repeated, and parallel flows.
Graphviz DOT generation rules
Use Graphviz for large, dense, or layout-sensitive relationship diagrams.
- Prefer
digraph Gfor directed relationships andgraph Gfor undirected networks. - Set layout-friendly graph attributes at the top:
rankdir=LR,nodesep,ranksep, andsplines=truewhen helpful. - Use
subgraph cluster_namefor boundaries and subsystems. - Use plain labels and restrained styling.
- Use edge labels only when they add meaning.
- For many nodes, group by domain with clusters and avoid crossing-heavy all-to-all edges.
PlantUML generation rules
Use PlantUML when the user asks for UML or needs formal UML notation.
- Wrap diagrams with
@startumland@enduml. - Use
actor,participant,database,queue,collections, orcomponentstereotypes when useful. - Use
package,rectangle, ornodefor architecture boundaries. - For class diagrams, include only important fields/methods unless the user asks for exhaustive detail.
- For activity diagrams, use clear start/end markers and explicit branch labels.
SVG generation rules
Use SVG only when text diagram languages cannot express the requested visual reliably.
- Keep SVG simple, accessible, and editable.
- Include
<title>and meaningful text labels. - Prefer rectangles, lines, arrows, and groups over complex paths.
- Do not embed external fonts or remote images.
Rendering files
When the user asks for PNG/SVG/PDF, create a source file and run:
python "<SKILL_ROOT>/diagram-generator/scripts/render_diagram.py" input.mmd --format svg --out output.svg
python "<SKILL_ROOT>/diagram-generator/scripts/render_diagram.py" input.dot --format png --out output.png
python "<SKILL_ROOT>/diagram-generator/scripts/render_diagram.py" input.puml --format svg --out output.svg
<SKILL_ROOT>是本包skills/目录的实际路径,AI 应自动检测。
The renderer is intentionally dependency-tolerant. It tries common local tools and reports actionable installation hints if a renderer is unavailable. Do not claim an image was rendered unless the script completed successfully and the output file exists.
Validation checklist
Before finalizing:
- The diagram type matches the user's task.
- The source is syntactically plausible for the chosen language.
- Labels are short enough to fit.
- Edges and message order reflect the input accurately.
- Assumptions are called out when the input was incomplete.
- For generated files, the output exists and opens or has nonzero size.
Common response template
Use this structure for most diagram answers:
下面是可编辑的 [language] 版本:
```[language]
[source]Assumptions:
- [only if needed]
Rendered file: [link] [only if generated]
For English user requests, respond in English. For Chinese user requests, respond in Chinese unless they ask otherwise.
---
## 按需自举(On-Demand Bootstrap)
### 自动化能力边界
| 工具 | 可自动安装 | 安装方式 | 说明 |
|------|-----------|---------|------|
| Mermaid CLI (mmdc) | ✓ | npm install -g @mermaid-js/mermaid-cli | 渲染 Mermaid 为 PNG/SVG |
| Graphviz (dot) | ✗ | 手动安装 | https://graphviz.org/download/ |
| PlantUML | ✗ | 需要 Java + plantuml.jar | https://plantuml.com/download |
| Python (render script) | ✓ | 已在 bootstrap 中 | `scripts/render_diagram.py` 依赖 |
### 说明
本 skill 主要输出文本格式的图表源码(Mermaid/DOT/PlantUML),不一定需要本地渲染工具。只有当用户明确要求生成 PNG/SVG/PDF 文件时才需要对应的渲染器。
如果渲染器不可用,`scripts/render_diagram.py` 会输出安装提示而不是报错。
---
## 路由上下文
**上游入口**: `SKILL.md`(总控)、`routing.md`
**触发条件**: 用户说"画图"、"流程图"、"架构图"、"攻击路径图"、"时序图"、"Mermaid"、"Graphviz"、"PlantUML"
**下游出口**:
- 生成的图表可嵌入 `docs-generator/` 的报告中
- 攻击路径图可配合 `pentest-tools/` 的渗透报告
**同级关联模块**: `docs-generator/`(报告中嵌入图表)Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 7
- zhaoxuya520/reverse-skill-private★ 40k95% same
- zhaoxuya520/reverse-skill★ 38k95% same
- z91772524-ai/pojia-next-mac★ 3997% same
- dbx0/skills★ 785% same
- lza6/claw-code-tingfeng★ 595% same
- DorianGallo/reverse-skill★ 2100% same
- lushun2014/lushibo-skills★ 097% same
Wrote their own version · 8
- luongnv89/skills★ 131same name
- qa-aman/claude-skills★ 24same name
- sergeeey/Claude-cod-top-2026★ 9same name
- Jacobinwwey/notemdpro★ 2same name
- Matthewyin/CustomSkills★ 2same name
- mahik504/orchestra-workflow★ 1same name
- jovd83/diagram-generator★ 0same name
- puretechnyc/purebrain-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- reverse-skill-evolverSkill
- api-securitySkill
- apk-reverseSkill
- asr-registrySkill
- attack-chainSkill
- binary-diffSkill
- browser-automationSkill
- case-reviewSkill
- chainsSkill
- docs-generatorSkill
- edr-bypass-reSkill
- evolutionSkill
- firmware-pentestSkill
- ghidra-reverseSkill
- ida-reverseSkill
- js-reverseSkill
- llm-securitySkill
- malware-analysisSkill
- mobile-reverseSkill
- overnight-runSkill
- patch-diff-exploitSkill
- pentest-toolsSkill
- src-hunterSkill
- pwn-chainSkill
- radare2Skill
- reverse-engineeringSkill
- supply-chain-securitySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

