Design Md

v0.1.4

在 Markdown 文档里插入脑图或架构图。用户说"画个脑图"、"画架构图"、"插入图表"、"mind map"、"diagram"时触发。

0· 104·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for drunkpig/mddoc-design.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Design Md" (drunkpig/mddoc-design) from ClawHub.
Skill page: https://clawhub.ai/drunkpig/mddoc-design
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required binaries: mddoc, d2
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install mddoc-design

ClawHub CLI

Package manager switcher

npx clawhub@latest install mddoc-design
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the runtime instructions. Requested binaries (mddoc, d2) are exactly what the SKILL.md uses to render mind maps and D2 diagrams, and required files are constrained to a project-local .mddoc directory.
Instruction Scope
Instructions tell the agent to create source files in .mddoc/, generate PNGs, and insert Markdown links—this is within scope. The SKILL.md also includes commands that install tools (npm install -g mddoc-cli, brew/winget links) and instructs use of Bash/Read/Write; those are expected but allow the agent to run network-backed installers and modify project files, so review installs/changes before running.
Install Mechanism
There is no packaged install spec (instruction-only). The doc recommends installing mddoc via npm -g and d2 via package managers or the official site. These are standard, but global npm installs execute code from the npm registry and require network and possibly elevated permissions—consider preferring a local install or auditing the npm package first.
Credentials
The skill requires no environment variables, credentials, or config paths beyond writing/reading project files in .mddoc; this matches the stated functionality.
Persistence & Privilege
always is false and the skill does not request persistent system-wide settings or modify other skills' configurations. It operates at project level (.mddoc) and does not demand elevated persistent privileges.
Assessment
This skill appears to do what it says: create diagram source files in a local .mddoc folder, render them with mddoc/d2, and insert PNG links into Markdown. Before installing or running: (1) ensure you trust the npm package mddoc-cli (review its npm page/repo) if you plan to run npm install -g; consider installing locally instead of globally; (2) confirm you want the agent to run Bash commands that will create/modify files under your project (back up important docs); (3) if you cannot or do not want to install system tools, decline installation—no credentials are requested by the skill.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

Binsmddoc, d2
latestvk976rmpcbf1p74x89w8pdn25xs84x6d5
104downloads
0stars
5versions
Updated 1w ago
v0.1.4
MIT-0

向 Markdown 文档插入图表时,始终遵循以下规则。

依赖检查

开始任何操作前,先检查依赖是否已安装:

which mddoc && which d2

mddoc 未安装:

npm install -g mddoc-cli

d2 未安装:

两个都就绪后再继续。

规则

  • 所有图表源文件和 PNG 只放在 .mddoc/ 目录(与 Markdown 文件平级)
  • 文件名用英文小写 + 连字符auth-flowmodule-overview),不用中文或序号
  • 先写源文件,再生成 PNG,再插入 Markdown,顺序不可颠倒
  • Markdown 正文中永远不要直接写 D2 或 markmap 代码块
  • .mddoc/ 不存在时先创建

脑图(.mmd)

1. 写源文件.mddoc/<name>.mmd,格式为 markmap markdown:

# 根节点标题

## 一级分支
- 叶节点
- 叶节点

## 一级分支
- 叶节点
  - 二级叶节点

2. 生成 PNG:

mddoc mindmap .mddoc/<name>.mmd

3. 插入 Markdown:

![脑图:<描述>](.mddoc/<name>.png)
*源文件:[<name>.mmd](.mddoc/<name>.mmd)*

架构图(.d2)

1. 写源文件.mddoc/<name>.d2,格式为 D2 语言:

direction: right

client: 客户端 {shape: rectangle}
gateway: API Gateway {shape: rectangle}
db: Database {shape: cylinder}

client -> gateway -> db

2. 生成 PNG:

mddoc arch .mddoc/<name>.d2

3. 插入 Markdown:

![架构图:<描述>](.mddoc/<name>.png)
*源文件:[<name>.d2](.mddoc/<name>.d2)*

批量重新生成

mddoc build

反馈与问题

遇到问题或有建议,请到 GitHub 提 issue: https://github.com/drunkpig/md-of-programer/issues

Comments

Loading comments...