Md Of Programer
by @drunkpig
Insert mind maps and architecture diagrams into Markdown documents. Triggered when the user says "draw a mind map", "draw an architecture diagram", "insert a...
clawhub install md-of-programerπ About This Skill
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:
brew install d2winget install terrastruct.d2Make sure both are available before continuing.
Rules
.mddoc/ directory (alongside the Markdown file)auth-flow, module-overview) β no spaces or numbers.mddoc/ if it does not existMind Map (.mmd)
1. Write the source file β .mddoc/ in markmap markdown format:
# Root nodeBranch one
Leaf node
Leaf node Branch two
Leaf node
- Child leaf
2. Generate PNG:
mddoc mindmap .mddoc/.mmd
3. Embed in Markdown:
!Mind map:
*Source: .mmd *
Architecture Diagram (.d2)
1. Write the source file β .mddoc/ in D2 language:
direction: rightclient: Client {shape: rectangle}
gateway: API Gateway {shape: rectangle}
db: Database {shape: cylinder}
client -> gateway -> db
2. Generate PNG:
mddoc arch .mddoc/.d2
3. Embed in Markdown:
!Architecture:
*Source: .d2 *
Regenerate All Diagrams
mddoc build
Feedback
Issues and suggestions β https://github.com/drunkpig/md-of-programer/issues
π Constraints
.mddoc/ directory (alongside the Markdown file)auth-flow, module-overview) β no spaces or numbers.mddoc/ if it does not exist