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.
Run in your terminal
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiondiagram-generatorExecute the skills CLI command in your project's root directory to begin installation:
Package manager
npx skills install zhaoxuya520/reverse-skill/skills/diagram-generatorFetches diagram-generator from zhaoxuya520/reverse-skill and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate diagram-generator. Access via /diagram-generatorin your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Package manager
npx skills install zhaoxuya520/reverse-skill/skills/diagram-generatorWorks with
0
total installs
0
this week
10.9K
GitHub stars
0
upvotes
| name | diagram-generator |
| 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. |
NOW:确认当前任务是否命中本 skill 的适用范围NOW:读取 ../tool-index.md,校验工具可用性和实际路径NEXT:缺工具时调用 bootstrap,不要猜路径ACT:进入"工作流"第一步并执行,不要停在确认状态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.
scripts/render_diagram.py.Do not over-ask for clarification. If the request is underspecified, make reasonable assumptions and label them briefly.
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 |
Assumptions section after the code.Consult references/diagram-patterns.md for compact templates.
General Mermaid rules:
flowchart TD, sequenceDiagram, erDiagram, gantt, mindmap, or journey.flowchart TD unless the user asks for left-to-right; use flowchart LR for architecture and pipelines.ingest_service[Ingest Service].decision{Condition?}.-- yes -->, -- no -->, -. async .->, or == critical ==> only when meaningful.actor for humans and participant for systems.alt/else/end, opt/end, loop/end, and par/and/end blocks for conditional, optional, repeated, and parallel flows.Use Graphviz for large, dense, or layout-sensitive relationship diagrams.
digraph G for directed relationships and graph G for undirected networks.rankdir=LR, nodesep, ranksep, and splines=true when helpful.subgraph cluster_name for boundaries and subsystems.Use PlantUML when the user asks for UML or needs formal UML notation.
@startuml and @enduml.actor, participant, database, queue, collections, or component stereotypes when useful.package, rectangle, or node for architecture boundaries.Use SVG only when text diagram languages cannot express the requested visual reliably.
<title> and meaningful text labels.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.
Before finalizing:
Use this structure for most diagram answers:
下面是可编辑的 [language] 版本:
```[language]
[source]
Assumptions:
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` 会输出安装提示而不是报错。
---
## 路由上下文
**上游入口**: `skills/SKILL.md`(总控)、`routing.md`
**触发条件**: 用户说"画图"、"流程图"、"架构图"、"攻击路径图"、"时序图"、"Mermaid"、"Graphviz"、"PlantUML"
**下游出口**:
- 生成的图表可嵌入 `docs-generator/` 的报告中
- 攻击路径图可配合 `pentest-tools/` 的渗透报告
**同级关联模块**: `docs-generator/`(报告中嵌入图表)
## 任务完成自检(声称完成前 MUST 通过)
- [ ] 我是否执行了工作流中的每一步(而不是只阅读)?
- [ ] 我是否基于 `tool-index` 使用了真实工具路径?
- [ ] 我是否产出了可复现证据(命令/脚本/截图/报告)?
- [ ] 我是否完成并回写了 RULES 要求的 Checklist 项?
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Keeps context tight: diagram-generator is the kind of skill you can hand to a new teammate without a long onboarding doc.
I recommend diagram-generator for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
We added diagram-generator from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Keeps context tight: diagram-generator is the kind of skill you can hand to a new teammate without a long onboarding doc.
diagram-generator fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
diagram-generator has been reliable in day-to-day use. Documentation quality is above average for community skills.
diagram-generator has been reliable in day-to-day use. Documentation quality is above average for community skills.
diagram-generator reduced setup friction for our internal harness; good balance of opinion and flexibility.
We added diagram-generator from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Registry listing for diagram-generator matched our evaluation — installs cleanly and behaves as described in the markdown.
showing 1-10 of 50