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 $0.00056 $0.00659
Sonnet 5 $0.00023 $0.00263
Haiku 4.5 $0.00011 $0.00132

Measured 11d ago against content hash c4584c2f80c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 11d 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. 11d 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 (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.

Related

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.

nexu-io/open-design · 41 tokens

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.

nexu-io/open-design · 53 tokens

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).

nexu-io/open-design · 78 tokens

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.

Yeachan-Heo/oh-my-codex · 50 tokens

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.

microsoft/hve-core · 47 tokens

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.

Hisn00w/ASu-skills · 86 tokens