Borrowing it
Nothing to install: this file belongs to BeWaterMyFriend7/SKILL-PROJECT. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/BeWaterMyFriend7/SKILL-PROJECT/main/.opencode/skills/mermaid-gen/SKILL.mdgit clone --depth 1 https://github.com/BeWaterMyFriend7/SKILL-PROJECTWrote 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.
[](https://agentmods.dev/skills/bewatermyfriend7/skill-project/mermaid-gen)<a href="https://agentmods.dev/skills/bewatermyfriend7/skill-project/mermaid-gen"><img src="https://agentmods.dev/badge/skills/bewatermyfriend7/skill-project/mermaid-gen/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.
<a href="https://agentmods.dev/skills/bewatermyfriend7/skill-project/mermaid-gen"><img src="https://agentmods.dev/badge/skills/bewatermyfriend7/skill-project/mermaid-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00113 | $0.01317 |
| Opus 5 | $0.00056 | $0.00659 |
| Sonnet 5 | $0.00023 | $0.00263 |
| Haiku 4.5 | $0.00011 | $0.00132 |
Grade A, and why
mermaid-gen 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 11d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mermaid 图表生成器
生成 Mermaid 代码块或 Markdown 文件。用户未指定目录时保存到项目根目录 output/mermaid/。明确要求 SVG 时使用 svg-generator,明确要求 Draw.io 时使用 xml-diagram。
必读资源
- 分析需求和规划图形前读取
references/mermaid-dsl.md。 - 遇到具体语法、特殊字符或 beta 图型时读取
references/mermaid-syntax.md。 - 读取对应的
examples/*.md;示例用于理解图型结构,禁止只替换标题后交付。
强制流程
分析需求 → 选择图型 → 自然语言 Mermaid DSL → 控制方向和复杂度
→ 生成 Mermaid → 结构/语义校验 → CLI 真实渲染 → 简化并交付
1. 分析需求
确定图表目的、受众、输出形式、浅色或深色主题、阅读方向、核心节点、关系、分区和输出路径。区分用户事实与合理补充,不擅自增加业务关系。
Mermaid 适合自动布局和文档即代码,不承诺精确坐标。用户强调品牌化、复杂部署边界、像素级布局或高级展示时改用 SVG 或 Draw.io。
2. 选择图型
| 意图 | Mermaid 类型 |
|---|---|
| 流程、步骤、判断 | flowchart |
| 调用、消息、交互 | sequenceDiagram |
| 类、接口、继承 | classDiagram |
| 实体、数据库关系 | erDiagram |
| 状态变化 | stateDiagram-v2 |
| 排期与进度 | gantt |
| Git 分支与合并 | gitGraph |
| 用户体验旅程 | journey |
| 占比 | pie |
| 层级思维结构 | mindmap |
| 里程碑 | timeline |
| 优先级矩阵 | quadrantChart |
| 数值趋势 | xychart-beta |
| 流量迁移 | sankey-beta |
| 系统模块框图 | block-beta |
- 静态系统分层优先
block-beta;带判断和流转关系时使用flowchart。 - 调用关系复杂时使用
sequenceDiagram,不要在架构图中堆积箭头。 - 数据实体关系使用
erDiagram,不要用普通方框模拟。
3. 生成自然语言 DSL
按 references/mermaid-dsl.md 描述图型、主题、方向、节点或参与者、关系、分区、复杂度和检查要求。DSL 不强制落盘,不使用 JSON、JSON Schema 或 DiagramPlan。
4. 控制方向和复杂度
- 阶段流程优先
LR,层级和判断较多时优先TD。 - 默认节点不超过 20,分区不超过 8,嵌套不超过 3 层。
- 单个标签尽量不超过 24 个中英文字符;过长时换行、精简或拆图。
- 避免多条回线、跨分区长线和大量中心发散连线。
- 自动布局出现拥挤时,优先减少关系、调整方向或拆图,不堆叠
style修补。
5. 生成 Mermaid
每个交付文件默认只包含一个主 Mermaid block。Markdown 结构使用:标题、简短说明、完整 Mermaid fence、必要说明。
浅色主题:
%%{init: {"theme":"base","themeVariables":{"fontFamily":"Inter, Noto Sans SC, Microsoft YaHei, sans-serif","primaryColor":"#FFFFFF","primaryBorderColor":"#2563EB","primaryTextColor":"#172033","lineColor":"#64748B","background":"#F6F8FB"}}}%%
深色主题:
%%{init: {"theme":"base","themeVariables":{"fontFamily":"Inter, Noto Sans SC, Microsoft YaHei, sans-serif","primaryColor":"#172033","primaryBorderColor":"#60A5FA","primaryTextColor":"#F8FAFC","lineColor":"#94A3B8","background":"#0F172A"}}}%%
What ships with it
19 files 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.
- examples/block-diagram.md 773 B
- examples/class-diagram.md 943 B
- examples/ER-diagram.md 1001 B
- examples/flowchart.md 869 B
- examples/gantt-chart.md 824 B
- examples/git-diagram.md 728 B
- examples/mindmap.md 743 B
- examples/pie-chart.md 524 B
- examples/quadrant-chart.md 809 B
- examples/sankey.md 657 B
- examples/sequence-diagram.md 953 B
- examples/state-diagram.md 722 B
- examples/timeline.md 634 B
- examples/user-journey.md 715 B
- examples/xy-chart.md 643 B
- references/mermaid-dsl.md 3.0 KB
- references/mermaid-syntax.md 2.6 KB
- scripts/validate_mermaid.py 11 KB runs code
- tests/test_validate_mermaid.py 4.3 KB runs code
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.
- 11d ago First seen · 103 lines · 113 tokens per session scan A c4584c2f80c6
mermaid-gen is a skill published in the GitHub repository BeWaterMyFriend7/SKILL-PROJECT (51 stars, last pushed 3d ago), licensed Apache-2.0. It adds 113 tokens to every session and 1,317 once invoked, about $0.0006 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.
Other skills, from other repositories
webgl-holographic-foil
A self-contained WebGL2 hero: thin-film interference over a crushed-foil surface whose palette shifts with the viewing angle; move the cursor to tilt the film.
html-ppt-hermes-cyber-terminal
OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.
html-ppt-taste-brutalist
16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).
visual-ralph
Visual Ralph orchestration for frontend UI from generated references, static references, or live URL targets, using $ralph with built-in visual verdict and pixel-diff evidence until the implementation matches and leaves a reproducible design system.
accessibility
Consolidated accessibility skill entrypoint for WCAG 2.2, ARIA Authoring Practices, cognitive accessibility, Section 508, EN 301 549, design intent verification, and the Accessibility Planner workflow.
make-resume
A Chinese-language tool for creating editable HTML resumes that can be changed in a browser and printed to PDF. It uses available resume templates when they are installed and otherwise provides a simpler fallback.