360 Secure SkillHub
360 安全技能中心

Md Of Programer

该 Skill 按用户请求为 Markdown 文档生成思维导图(.mmd)与架构图(.d2)源文件,调用 mddoc 渲染为 PNG 后嵌入文档;源文件与图片统一存放在 .mddoc/ 目录,并可用 mddoc build 重新生成全部图表。使用前会检查并按平台安装 mddoc 与 d2。

分类:创作
drunkpig
drunkpig
热度 21.84
最近更新 2026-05-11 17:43:22

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add drunkpig/md-of-programer
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
md-of-programer
version
0.1.0
description
Insert mind maps and architecture diagrams into Markdown documents. Triggered when the user says "draw a mind map", "draw an architecture diagram", "insert a diagram", "mind map", or "diagram".
argument-hint
["diagram description","optional"]
allowed-tools
Write, Bash, Read
metadata
{"openclaw":{"requires":{"bins":["mddoc","d2"]}}}

When inserting diagrams into a Markdown document, always follow the rules below.

Dependency Check

Before doing anything, check that dependencies are installed:

which mddoc && which d2

If mddoc is not installed:

npm install -g mddoc-cli

If d2 is not installed:

Make sure both are available before continuing.

Rules

  • All diagram source files and PNGs go only in the .mddoc/ directory (alongside the Markdown file)
  • File names must use lowercase English + hyphens (auth-flow, module-overview) — no spaces or numbers
  • Always write the source file first, then generate the PNG, then embed into Markdown — in that order
  • Never write D2 or markmap code blocks directly in the Markdown body
  • Create .mddoc/ if it does not exist

Mind Map (.mmd)

1. Write the source file → .mddoc/<name>.mmd in markmap markdown format:

# Root node

## Branch one
- Leaf node
- Leaf node

## Branch two
- Leaf node
  - Child leaf

2. Generate PNG:

mddoc mindmap .mddoc/<name>.mmd

3. Embed in Markdown:

![Mind map: <description>](.mddoc/<name>.png)
*Source: [<name>.mmd](.mddoc/<name>.mmd)*

Architecture Diagram (.d2)

1. Write the source file → .mddoc/<name>.d2 in D2 language:

direction: right

client: Client {shape: rectangle}
gateway: API Gateway {shape: rectangle}
db: Database {shape: cylinder}

client -> gateway -> db

2. Generate PNG:

mddoc arch .mddoc/<name>.d2

3. Embed in Markdown:

![Architecture: <description>](.mddoc/<name>.png)
*Source: [<name>.d2](.mddoc/<name>.d2)*

Regenerate All Diagrams

mddoc build

Feedback

Issues and suggestions → https://github.com/drunkpig/md-of-programer/issues