zero2Agent is a tutorial repository that teaches software developers how to build AI agents, covering core concepts, model APIs, tools, memory, frameworks, implementation, and complete projects. It is intended for programmers learning agent engineering and for candidates preparing for agent-related technical interviews.
Borrowing it
Nothing to install: this file belongs to ranxi2001/zero2Agent. 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/ranxi2001/zero2Agent/main/.agents/skills/mermaid-check/SKILL.mdgit clone --depth 1 https://github.com/ranxi2001/zero2AgentWrote 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/ranxi2001/zero2agent/mermaid-check)<a href="https://agentmods.dev/skills/ranxi2001/zero2agent/mermaid-check"><img src="https://agentmods.dev/badge/skills/ranxi2001/zero2agent/mermaid-check/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/ranxi2001/zero2agent/mermaid-check"><img src="https://agentmods.dev/badge/skills/ranxi2001/zero2agent/mermaid-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Agent Snooping · line 206 Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
- medium MCP Rug Pull · line 58 npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.Fix: Pin the version: npx @scope/[email protected]
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.00083 | $0.02456 |
| Opus 5.5 | $0.00033 | $0.00982 |
| Sonnet 5.5 | $0.00017 | $0.00491 |
| Haiku 4.5 | $0.00008 | $0.00246 |
Grade B, and why
mermaid-check scanned grade B with 2 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.
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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
grep -rn '```mermaid' --include="*.md" . | grep -v ".claude/" Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
result = subprocess.run( How it starts
The opening of the file, as written. The whole thing — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mermaid 语法检查与修复
本项目使用 mermaid 9.4.3(CDN 加载),配置 htmlLabels: false,securityLevel: 'loose'。
图表写在 ```mermaid 代码围栏中,由 _layouts/default.html 中的 JS 转换后渲染。
渲染管线原理
```mermaid 代码围栏
↓ kramdown 渲染
<div class="language-mermaid"><code>原始文本(HTML 实体转义)</code></div>
↓ 项目 JS(default.html)
code.textContent → 原始 mermaid 文本(含 <br>、-->、| 等)
↓ srcToInnerHTML() 转换
innerHTML: 转义 < > & 但保留 <br/> 为真实 HTML 标签
↓ mermaid.init()
读取 innerHTML → entityDecode() → 解析器
关键函数 srcToInnerHTML
function srcToInnerHTML(src) {
return src
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/<br\s*\/?>/gi, '<br/>');
}
原理:先将所有 HTML 特殊字符转义,再把 <br> 从实体还原为真实标签。
mermaid 的 entityDecode 通过 escape()/unescape() 能正确处理:
-->→ 解码回--><br/>(真实标签) → escape 变为%3Cbr/%3E→ unescape 变回<br/>|→ escape 变为%7C→ unescape 变回|
使用 Node.js 验证 mermaid 语法
安装 mermaid CLI:
npm install -g @mermaid-js/mermaid-cli
验证单个图表:
echo 'flowchart LR
A[text] -->|label| B' > /tmp/test.mmd
npx mmdc -i /tmp/test.mmd -o /tmp/test.svg 2>&1
批量验证项目中所有 mermaid 块:
python3 << 'EOF'
import re, os, subprocess, tempfile
base = os.getcwd()
errors = []
for root, dirs, files in os.walk(base):
dirs[:] = [d for d in dirs if d not in ['.git', '.claude', 'node_modules']]
for f in files:
if not f.endswith('.md'): continue
path = os.path.join(root, f)
with open(path) as fh:
content = fh.read()
for m in re.finditer(r'```mermaid\n(.*?)\n```', content, re.DOTALL):
block = m.group(1)
line = content[:m.start()].count('\n') + 1
with tempfile.NamedTemporaryFile(suffix='.mmd', mode='w', delete=False) as tmp:
tmp.write(block)
tmp_path = tmp.name
result = subprocess.run(
['npx', 'mmdc', '-i', tmp_path, '-o', '/dev/null'],
capture_output=True, text=True
)
os.unlink(tmp_path)
if result.returncode != 0:
errors.append((path, line, result.stderr.strip()))
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.
- 2mo ago First seen · 244 lines · 83 tokens per session scan B c8c17930c718
mermaid-check is a skill published in the GitHub repository ranxi2001/zero2Agent (1,026 stars, last pushed yesterday), licensed MIT. It adds 83 tokens to every session and 2,456 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 2 findings (reads agent configuration directories, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
mermaid-check compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mermaid-checkranxi2001/zero2Agent | Skill | 1.0k | yesterday | MIT | B | 83 | Claude Code, Codex |
| reproduce-buggoogleapis/mcp-toolbox | Skill | 17k | yesterday | Apache-2.0 | A | 130 | Claude Code, Codex |
| fix-failing-testsgoogleapis/mcp-toolbox | Skill | 17k | yesterday | Apache-2.0 | A | 87 | Claude Code, Codex |
| triage-issuesgoogleapis/mcp-toolbox | Skill | 17k | yesterday | Apache-2.0 | A | 164 | Claude Code, Codex |
| langbot-plugin-devlangbot-app/LangBot | Skill | 19k | yesterday | Apache-2.0 | A | 115 | Claude Code, Codex |
| browser-edge-casesaden-hive/hive | Skill | 11k | 4d ago | Apache-2.0 | A | 40 | Claude Code |
| triage-issueaden-hive/hive | Skill | 11k | 4d ago | Apache-2.0 | A | 0 | Claude Code |