From knowledge-tools
Generate hand-drawn style Excalidraw diagrams from text content. Supports three output modes - Obsidian (.md), Standard (.excalidraw), and Animated (.excalidraw with animation order). Choose this over Obsidian Canvas when the user wants an Excalidraw hand-drawn whiteboard style. For standard Mermaid diagrams (flowcharts, sequence diagrams, etc.), use the mermaid-visualizer skill instead. Triggers on "Excalidraw", "畫圖", "Excalidraw流程圖", "Excalidraw心智圖", "標準Excalidraw", "standard excalidraw", "Excalidraw動畫", "動畫圖".
How this skill is triggered — by the user, by Claude, or both
Slash command
/knowledge-tools:excalidraw-diagramThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create Excalidraw diagrams from text content with multiple output formats.
Create Excalidraw diagrams from text content with multiple output formats.
根據使用者的觸發詞選擇輸出模式:
| 觸發詞 | 輸出模式 | 檔案格式 | 用途 |
|---|---|---|---|
Excalidraw、畫圖、Excalidraw流程圖、Excalidraw心智圖 | Obsidian(預設) | .md | 在 Obsidian 中直接開啟 |
標準Excalidraw、standard excalidraw | Standard | .excalidraw | 在 excalidraw.com 開啟/編輯/分享 |
Excalidraw動畫、動畫圖、animate | Animated | .excalidraw | 拖到 excalidraw-animate 產生動畫 |
嚴格按照以下結構輸出,不得有任何修改:
---
excalidraw-plugin: parsed
tags: [excalidraw]
---
==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'
# Excalidraw Data
## Text Elements
%%
## Drawing
```json
{JSON 完整資料}
%%
**關鍵要點:**
- Frontmatter 必須包含 `tags: [excalidraw]`
- 警告訊息必須完整
- JSON 必須被 `%%` 標記包圍
- 不能使用 `excalidraw-plugin: parsed` 以外的其他 frontmatter 設定
- **副檔名**:`.md`
### Mode 2: Standard Excalidraw Format
直接輸出純 JSON 檔案,可在 excalidraw.com 開啟:
```json
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [...],
"appState": {
"gridSize": null,
"viewBackgroundColor": "#ffffff"
},
"files": {}
}
關鍵要點:
source 使用 https://excalidraw.com(不是 Obsidian 外掛).excalidraw與 Standard 格式相同,但每個元素添加 customData.animate 欄位控制動畫順序:
{
"id": "element-1",
"type": "rectangle",
"customData": {
"animate": {
"order": 1,
"duration": 500
}
},
...其他標準欄位
}
動畫順序規則:
order: 動畫播放順序(1, 2, 3...),數字越小越先出現duration: 該元素的繪製時長(毫秒),預設 500order 的元素同時出現使用方法:
.excalidraw 檔案副檔名:.excalidraw
選擇合適的圖表形式,以提升理解力與視覺吸引力。
| 類型 | 英文 | 使用情境 | 做法 |
|---|---|---|---|
| 流程圖 | Flowchart | 步驟說明、工作流程、任務執行順序 | 用箭頭連接各步驟,清晰表達流程走向 |
| 心智圖 | Mind Map | 概念發散、主題分類、靈感捕捉 | 以中心為核心向外發散,放射狀結構 |
| 層級圖 | Hierarchy | 組織結構、內容分級、系統拆解 | 自上而下或自左至右建構層級節點 |
| 關係圖 | Relationship | 要素之間的影響、依賴、互動 | 圖形間用連線表示關聯,箭頭與說明 |
| 對比圖 | Comparison | 兩種以上方案或觀點的對照分析 | 左右兩欄或表格形式,標明比較維度 |
| 時間線圖 | Timeline | 事件發展、專案進度、模型演化 | 以時間為軸,標出關鍵時間點與事件 |
| 矩陣圖 | Matrix | 雙維度分類、任務優先級、定位 | 建立 X 與 Y 兩個維度,座標平面安置 |
| 自由版面配置 | Freeform | 內容零散、靈感記錄、初步資訊收集 | 無需結構限制,自由放置圖塊與箭頭 |
fontFamily: 5(Excalifont 手寫字型)" 替換為 『』() 替換為 「」lineHeight: 1.25estimatedWidth = text.length * fontSize * 0.5(CJK 字元用 * 1.0)x = centerX - estimatedWidth / 2estimatedWidth = 5 * 20 * 0.5 = 50 → x = 300 - 25 = 275文字顏色(strokeColor for text):
| 用途 | 色值 | 說明 |
|---|---|---|
| 標題 | #1e40af | 深藍 |
| 副標題/連接線 | #3b82f6 | 亮藍 |
| 正文文字 | #374151 | 深灰(白底最淺不低於 #757575) |
| 強調/重點 | #f59e0b | 金色 |
形狀填充色(backgroundColor, fillStyle: "solid"):
| 色值 | 語意 | 適用情境 |
|---|---|---|
#a5d8ff | 淺藍 | 輸入、資料源、主要節點 |
#b2f2bb | 淺綠 | 成功、輸出、已完成 |
#ffd8a8 | 淺橙 | 警告、待處理、外部依賴 |
#d0bfff | 淺紫 | 處理中、中間件、特殊項 |
#ffc9c9 | 淺紅 | 錯誤、關鍵、告警 |
#fff3bf | 淺黃 | 備註、決策、規劃 |
#c3fae8 | 淺青 | 儲存、資料、快取 |
#eebefa | 淺粉 | 分析、指標、統計 |
區域背景色(大矩形 + opacity: 30,用於分層圖表):
| 色值 | 語意 |
|---|---|
#dbe4ff | 前端/UI 層 |
#e5dbff | 邏輯/處理層 |
#d3f9d8 | 資料/工具層 |
對比度規則:
#757575,否則不可讀#15803d,不用 #22c55e)#b0b0b0、#999)出現在白底上參考:references/excalidraw-schema.md
Obsidian 模式:
{
"type": "excalidraw",
"version": 2,
"source": "https://github.com/zsviczian/obsidian-excalidraw-plugin",
"elements": [...],
"appState": { "gridSize": null, "viewBackgroundColor": "#ffffff" },
"files": {}
}
Standard / Animated 模式:
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [...],
"appState": { "gridSize": null, "viewBackgroundColor": "#ffffff" },
"files": {}
}
Each element requires these fields (do NOT add extra fields like frameId, index, versionNonce, rawText -- they may cause issues on excalidraw.com. boundElements must be null not [], updated must be 1 not timestamps):
{
"id": "unique-id",
"type": "rectangle",
"x": 100, "y": 100,
"width": 200, "height": 50,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
"fillStyle": "solid",
"strokeWidth": 2,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"roundness": {"type": 3},
"seed": 123456789,
"version": 1,
"isDeleted": false,
"boundElements": null,
"updated": 1,
"link": null,
"locked": false
}
strokeStyle values: "solid"(實線,預設)| "dashed"(虛線)| "dotted"(點線)。虛線適合表示選擇性路徑、非同步流、弱關聯等。
Text elements add:
{
"text": "顯示文字",
"fontSize": 20,
"fontFamily": 5,
"textAlign": "center",
"verticalAlign": "middle",
"containerId": null,
"originalText": "顯示文字",
"autoResize": true,
"lineHeight": 1.25
}
Animated 模式額外添加 customData 欄位:
{
"id": "title-1",
"type": "text",
"customData": {
"animate": {
"order": 1,
"duration": 500
}
},
...其他欄位
}
See references/excalidraw-schema.md for all element types.
## Text Elements 部分在 Markdown 中必須留空,僅用 %% 作為分隔符id(可以是字串,如「title」「box1」等)IMPORTANT: Do NOT include frameId, index, versionNonce, or rawText fields. Use boundElements: null (not []), and updated: 1 (not timestamps).
{
"id": "unique-identifier",
"type": "rectangle|text|arrow|ellipse|diamond",
"x": 100, "y": 100,
"width": 200, "height": 50,
"angle": 0,
"strokeColor": "#color-hex",
"backgroundColor": "transparent|#color-hex",
"fillStyle": "solid",
"strokeWidth": 2,
"strokeStyle": "solid|dashed|dotted",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"roundness": {"type": 3},
"seed": 123456789,
"version": 1,
"isDeleted": false,
"boundElements": null,
"updated": 1,
"link": null,
"locked": false
}
文字元素 (type: "text") 需要額外屬性(do NOT include rawText):
{
"text": "顯示文字",
"fontSize": 20,
"fontFamily": 5,
"textAlign": "center",
"verticalAlign": "middle",
"containerId": null,
"originalText": "顯示文字",
"autoResize": true,
"lineHeight": 1.25
}
"appState": {
"gridSize": null,
"viewBackgroundColor": "#ffffff"
}
"files": {}
x 是左邊緣,不是中心。必須用置中公式手動計算,否則文字會偏到一邊#757575,有色文字用深色變體當產生 Excalidraw 圖表時,必須自動執行以下步驟:
根據輸出模式選擇副檔名:
| 模式 | 檔案名稱格式 | 範例 |
|---|---|---|
| Obsidian | [主題].[類型].md | 商業模式.relationship.md |
| Standard | [主題].[類型].excalidraw | 商業模式.relationship.excalidraw |
| Animated | [主題].[類型].animate.excalidraw | 商業模式.relationship.animate.excalidraw |
{current_directory}/[filename].md必須按以下格式產生(不能有任何修改):
---
excalidraw-plugin: parsed
tags: [excalidraw]
---
==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'
# Excalidraw Data
## Text Elements
%%
## Drawing
```json
{完整的 JSON 資料}
%%
#### 5. JSON 資料要求
- 包含完整的 Excalidraw JSON 結構
- 所有文字元素使用 `fontFamily: 5`
- 文字中的 `"` 替換為 `『』`
- 文字中的 `()` 替換為 `「」`
- JSON 格式必須有效,通過語法檢查
- 所有元素有唯一的 `id`
- 包含 `appState` 和 `files: {}` 欄位
#### 6. 使用者回饋與確認
向使用者報告:
- 圖表已產生
- 精確的儲存位置
- 如何在 Obsidian 中檢視
- 圖表的設計選擇說明(選擇了什麼類型的圖表、為什麼)
- 是否需要調整或修改
### Example Output Messages
**Obsidian 模式:**
Excalidraw 圖已產生!
儲存位置:商業模式.relationship.md
使用方式:
**Standard 模式:**
Excalidraw 圖已產生!
儲存位置:商業模式.relationship.excalidraw
使用方式:
**Animated 模式:**
Excalidraw 動畫圖已產生!
儲存位置:商業模式.relationship.animate.excalidraw
動畫順序:標題(1) → 主框架(2-4) → 連接線(5-7) → 說明文字(8-10)
產生動畫:
npx claudepluginhub timlai666/skills --plugin knowledge-toolsGuides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Runs a structured interview session to sharpen plans or designs, producing ADRs and a glossary as output.
Applies curated color/font themes to slides, docs, and HTML artifacts. Includes 10 preset themes and can generate custom themes on demand.