SKILL-PROJECT: Skill for OpenCode

.opencode/skills/mermaid-gen/SKILL.md

mermaid-gen is a skill for OpenCode from BeWaterMyFriend7/SKILL-PROJECT. It costs 113 tokens per session (1,317 once invoked), scanned A, original, Apache-2.0.

A tool for creating Mermaid diagrams as code inside Markdown or other documentation. Mermaid is a text format that automatically lays out flowcharts, timelines, database relationships, and other diagrams.

In plain words
What is it for?
Use it to document processes, software structure, database relationships, message flows, schedules, Git branches, and other relationships. It can generate Mermaid code blocks or Markdown files.
Why use it?
It turns written descriptions into diagrams that can be stored, reviewed, and changed like code. It avoids drawing diagrams by hand when an automatically arranged layout is suitable.

Skill for OpenCode

Written for OpenCode: installed under .opencode/.

This is BeWaterMyFriend7/SKILL-PROJECT's own configuration. It tells OpenCode how to work on SKILL-PROJECT itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything SKILL-PROJECT configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/BeWaterMyFriend7/SKILL-PROJECT/main/.opencode/skills/mermaid-gen/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/BeWaterMyFriend7/SKILL-PROJECT

Made for: OpenCode.

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 mermaid-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/bewatermyfriend7/skill-project/mermaid-gen/github.svg)](https://agentmods.dev/skills/bewatermyfriend7/skill-project/mermaid-gen)
Your own site
<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.

agentmods 80×15 button for mermaid-gen

Your own site · 80×15
<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>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,317 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 pass 7 Sept 2026
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.00113 $0.01317
Opus 5.5 $0.00045 $0.00527
Sonnet 5.5 $0.00023 $0.00263
Haiku 4.5 $0.00011 $0.00132

Measured 2mo ago against content hash c4584c2f80c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/validate_mermaid.py, tests/test_validate_mermaid.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.

.opencode/skills/mermaid-gen/SKILL.md · 103 lines

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"}}}%%

Read the full file on GitHub · 103 lines

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. 2mo ago First seen · 103 lines · 113 tokens per session scan A c4584c2f80c6

Subscribe to this mod's changes

mermaid-gen is a skill published in the GitHub repository BeWaterMyFriend7/SKILL-PROJECT (56 stars, last pushed 15d ago), licensed Apache-2.0. It adds 113 tokens to every session and 1,317 once invoked, about $0.0005 per session on Opus 5.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

mermaid-gen compared with skills from other repositories

mermaid-gen next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mermaid-genBeWaterMyFriend7/SKILL-PROJECTSkill5615d agoApache-2.0A113OpenCode
webgl-holographic-foilnexu-io/open-designSkill106kyesterdayApache-2.0A41Claude Code, Codex
html-ppt-hermes-cyber-terminalnexu-io/open-designSkill106kyesterdayApache-2.0A53Claude Code, Codex
html-ppt-taste-brutalistnexu-io/open-designSkill106kyesterdayApache-2.0A78Claude Code, Codex
visual-ralphYeachan-Heo/oh-my-codexSkill34k3d agoMITA52Codex
glance-canonical-layoutsandroid/skillsSkill10kyesterdayApache-2.0A56Claude Code
accessibilitymicrosoft/hve-coreSkill1.6kyesterdayMITA47Claude Code