← 返回
未分类 中文

excalidraw

Generate Excalidraw diagrams (.excalidraw files) from natural language descriptions. Use this skill whenever the user asks to create, draw, or visualize a di...
根据自然语言描述生成Excalidraw图表(.excalidraw文件)。当用户要求创建、绘制或可视化图表时使用此技能。
jannik689 jannik689 来源
未分类 clawhub v1.0.0 1 版本 99795.1 Key: 无需
★ 0
Stars
📥 487
下载
💾 15
安装
1
版本
#latest

概述

Excalidraw Diagram Generator

You generate .excalidraw files from natural language descriptions. The user can open these files directly in Excalidraw (File → Open) or drag-and-drop onto the canvas.

Workflow

  1. Understand the description — identify what the user wants to visualize
  2. Auto-select diagram type — choose the best type from the table below
  3. Generate the intermediate JSON — write a structured diagram_input.json
  4. Run the build script — execute build_excalidraw.py to produce the file
  5. Tell the user — report the output file path and how to open it

Diagram Type Selection

What the user describesType to use
-------------------------------------
Steps, process, decisions, branchingflowchart
Systems, services, components, infrastructurearchitecture
Topics, ideas, concepts radiating from a centermindmap
Two or more parties exchanging messages over timesequence

When in doubt, prefer flowchart — it handles the widest range of content.

Intermediate JSON Formats

Generate one of the following formats as diagram_input.json in the current working directory.

Flowchart

{
  "type": "flowchart",
  "title": "Short descriptive title",
  "nodes": [
    {"id": "unique_id", "label": "Display Text", "shape": "rectangle"},
    {"id": "decision", "label": "Is it valid?", "shape": "diamond"},
    {"id": "start_end", "label": "Start", "shape": "oval"}
  ],
  "edges": [
    {"from": "node_a", "to": "node_b"},
    {"from": "decision", "to": "node_c", "label": "Yes"},
    {"from": "decision", "to": "node_d", "label": "No"}
  ]
}

Shape choices: rectangle (default), diamond (decisions/conditions), oval (start/end points)

Architecture

{
  "type": "architecture",
  "title": "System Architecture",
  "groups": [
    {
      "id": "frontend",
      "label": "Frontend",
      "nodes": [
        {"id": "web", "label": "Web App"},
        {"id": "mobile", "label": "Mobile App"}
      ]
    },
    {
      "id": "backend",
      "label": "Backend",
      "nodes": [
        {"id": "api", "label": "API Gateway"},
        {"id": "auth", "label": "Auth Service"}
      ]
    }
  ],
  "nodes": [],
  "edges": [
    {"from": "web", "to": "api", "label": "HTTPS"},
    {"from": "mobile", "to": "api", "label": "HTTPS"}
  ]
}

Note: groups is optional. Use nodes at the top level for ungrouped components. You can mix both.

Mind Map

{
  "type": "mindmap",
  "title": "Topic Overview",
  "root": "Central Topic",
  "branches": [
    {
      "label": "Branch 1",
      "children": ["Subtopic A", "Subtopic B", "Subtopic C"]
    },
    {
      "label": "Branch 2",
      "children": ["Subtopic D", "Subtopic E"]
    }
  ]
}

Sequence Diagram

{
  "type": "sequence",
  "title": "Interaction Flow",
  "actors": ["User", "Frontend", "API", "Database"],
  "messages": [
    {"from": "User", "to": "Frontend", "label": "Click Login"},
    {"from": "Frontend", "to": "API", "label": "POST /login"},
    {"from": "API", "to": "Database", "label": "Query user"},
    {"from": "Database", "to": "API", "label": "Return record"},
    {"from": "API", "to": "Frontend", "label": "JWT token"},
    {"from": "Frontend", "to": "User", "label": "Redirect"}
  ]
}

Execution Steps

After writing diagram_input.json, run the build script:

python <skill_dir>/scripts/build_excalidraw.py \
  --input diagram_input.json \
  --output <title>.excalidraw

Where is the directory containing this SKILL.md file, and </code> is a sanitized version of the diagram title.</p><h2>Output Message to User</h2><p>After successful generation, tell the user:</p><pre><code>✓ Diagram saved to: <filename>.excalidraw To open in Excalidraw: 1. Go to https://excalidraw.com 2. Click the menu (☰) → Open → select the file — or — drag the file onto the canvas </code></pre><h2>Tips for Good Diagrams</h2><ul><li><strong>Keep labels concise</strong> — 1–5 words per node works best</li><li><strong>Limit nodes</strong> — 5–15 nodes per diagram for readability; split complex diagrams into multiple files</li><li><strong>Use meaningful IDs</strong> — snake_case, no spaces (e.g., <code>api_gateway</code>, <code>check_auth</code>)</li><li><strong>Flowchart edges</strong> — always go from a defined node ID to another defined node ID</li><li><strong>Sequence actors</strong> — list them in the order they first appear in the conversation</li></ul><h2>Error Handling</h2><p>If the script fails:</p><ol><li>Check that <code>diagram_input.json</code> has valid JSON syntax</li><li>Ensure all edge <code>from</code>/<code>to</code> values match existing node <code>id</code> values</li><li>Verify Python 3.6+ is available (<code>python3 --version</code>)</li></ol></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 1 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v1.0.0</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-03-31 00:57 安全 安全 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://tix.qq.com/search/skill?keyword=e514ac1161a7e0e54a31e68fa9b9bf0d" target="_blank">查看报告</a> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://static.cloudsec.tencent.com/html-report-v2/2026/05/26/418414_e4cdef315e7795118fb052657dcbdf4b.html?q-sign-algorithm=sha1&q-ak=AKID8JMG1bzBC1dz96qNhssfFftujT1NCoFi&q-sign-time=1782050237%3B1813586237&q-key-time=1782050237%3B1813586237&q-header-list=host&q-url-param-list=&q-signature=804dd1900a783608c56f4dcc7ccc15bc353502ae" target="_blank">查看报告</a> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">education</span> <h3><a href="/s/gaokao-tool">gaokao-advisor</a></h3> <div class="rec-owner">jannik689</div> <div class="rec-desc">高考志愿填报顾问技能。当用户提到高考志愿、报考大学、填志愿、模拟分数报什么学校、专业选择、录取分数线查询、六边形分析、冲稳保、平行志愿、新高考选科、选大学、大学排名、专业就业前景等话题时使用此技能。触发词包括:高考、志愿填报、报考、分数线、</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 2</span> <span style="color:#5b6abf;">📥 502</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">design-media</span> <h3><a href="/s/openai-whisper">Openai Whisper</a></h3> <div class="rec-owner">steipete</div> <div class="rec-desc">使用 Whisper CLI 进行本地语音转文字(无需 API 密钥)</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 330</span> <span style="color:#5b6abf;">📥 93,130</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">design-media</span> <h3><a href="/s/nano-banana-pro">Nano Banana Pro</a></h3> <div class="rec-owner">steipete</div> <div class="rec-desc">使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 426</span> <span style="color:#5b6abf;">📥 116,347</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>