Logo Excalidraw Generator

Excalidraw Generator

Cộng đồng
luongnv89
excalidraw-generator

Generate diagrams as valid Excalidraw JSON — flowcharts, architecture, ER diagrams, mind maps, sequence diagrams, wireframes, C4 models, and more. Don't use for draw.io/Mermaid output, slide decks, or pixel-perfect brand graphics.

Tổng quan

Nhà phát hànhluongnv89
Kho mãskills
Tên kỹ năngexcalidraw-generator
Sao
124
Bản fork
18
Tệp đi kèm
9
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 9 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được luongnv89 công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Excalidraw Generator trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/luongnv89/skills/tree/main/skills/diagram-generator/excalidraw-generator
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/luongnv89/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/diagram-generator/excalidraw-generator .claude/skills/excalidraw-generator
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Excalidraw Generator trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Excalidraw Generator ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Excalidraw Generator với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Excalidraw Diagram Generator

Generate professional diagrams as valid Excalidraw JSON. Every diagram goes through four phases: Understand the request, Propose options, Generate the JSON, and Validate before writing the file.

Part of the diagram-generator suite. For precise, editable-in-draw.io output, use drawio-generator instead; the diagram-generator umbrella routes between the two.

This SKILL.md is intentionally compact to fit the agent's context budget (token-efficient body). Long-form details live in references/ — read the linked file when you need depth.

When to Use

Triggers/exclusions are set by the frontmatter description above. Output is an Excalidraw file, or embedded in Markdown via the excalidraw fenced block if the user asks for that.

Environment Check

If the Agent tool is available, use the subagent review loop described in references/style-and-iteration.md (Subagent Architecture). It provides fresh-context validation and avoids single-pass context overflow.

If the Agent tool is unavailable (e.g., Claude.ai), execute every phase inline and self-review against the 10 checks (less rigorous, but functional).

Core Workflow

Phase 1: Understand

Confirm what to draw before generating anything.

  • Clear description ("draw a flowchart of user authentication"): restate your understanding in one sentence and propose the visualization type.
  • Ambiguous input: ask targeted questions — main entities/nodes, relationships, flow direction, style preference.
  • Code, data, schemas, or files: extract structure (code → class/dependency/architecture; SQL → ER; JSON/YAML → architecture/deployment; steps → flowchart/sequence; org data → org chart/tree).

Phase 2: Propose

Present a plan with selectable options:

  1. Diagram type — see references/diagram-types.md for the catalogue. If multiple fit, present numbered options.
  2. Key elements — list the nodes/shapes you'll include.
  3. Layout — propose 2–3 choices (e.g., (A) Top-to-bottom, (B) Left-to-right, (C) Radial).
  4. Style — see references/style-and-iteration.md. Pick rendering style (clean/hand-drawn/sketchy) and color scheme that fits the diagram's purpose. No fixed palette.
  5. Complexity — small (<10 elements), medium (10–30), large (30+).

Wait for confirmation. If the user says "just do it" or the request is straightforward, use sensible defaults (hand-drawn, roughness 1, Virgil font, best-fit layout) and proceed.

Phase 3: Generate

Write a .excalidraw file (raw JSON, no wrapper) in the current working directory. Use kebab-case names (auth-flow.excalidraw). The required envelope:

json
{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [],
  "appState": { "theme": "light", "viewBackgroundColor": "#ffffff" },
  "files": {}
}

Set theme and viewBackgroundColor to whatever suits the diagram. For full element schema and field defaults, see references/excalidraw-format.md.

Embedding in Markdown: if the user asks to embed the diagram in a .md file, write the .excalidraw first, then a companion .md that references it via a fenced block tagged excalidraw containing the same JSON.

Phase 4: Validate

Before writing the file, run all 10 checks on the in-memory JSON. Fix and re-check until all pass. Full check definitions and fix recipes are in references/validation-checks.md. Quick summary:

  1. Valid JSON — top-level keys present.
  2. Required fields — every element has the full field list (id, type, geometry, styling, boundElements, seed, etc.). Text adds text/fontSize/fontFamily/textAlign/verticalAlign/containerId/originalText/lineHeight/autoResize. Arrows add points/startBinding/endBinding/startArrowhead/endArrowhead.
  3. Unique IDs — no duplicates.
  4. Two-way text bindings — containerId ↔ boundElements {type:"text"}.
  5. Two-way arrow bindings — startBinding/endBinding ↔ boundElements {type:"arrow"}.
  6. Arrow points — points length ≥ 2 and points[0] === [0,0].
  7. No unintentional overlaps — bounding boxes don't overlap by more than 10px (unless grouped or inside a frame).
  8. Semantic completeness — every entity/relationship the user mentioned is represented.
  9. Readable text — fontSize ≥ 16, visible strokeColor, lineHeight: 1.25 (never 1.35), autoResize: true.
  10. Shape-to-text size fit — see below; this is the #1 failure mode.
Check 10 — shape sizing (always verify)

For every text element with containerId:

  1. line_count = text.split('\n').length
  2. min_text_height = line_count * fontSize * 1.25
  3. min_shape_height = min_text_height + 40 (20px padding top/bottom)
  4. The container shape's height must be >= min_shape_height.
  5. The container shape's width must be >= longest_line_pixel_width + 20.

Boundary/container labels (e.g., "System Boundary") must be standalone text with containerId: null, positioned near the top-left of the container — never bound to it.

Fix: increase the shape's height/width to fit the text and shift elements below it to keep spacing. Always set lineHeight: 1.25 and autoResize: true on text. Never patch individual outputs — fix this skill's instructions if a new failure pattern emerges.

After all checks pass, emit the validation summary (10/10 passed, element counts, binding counts, "all shapes sized to fit", any auto-fixes applied).

Step Completion Reports

After each phase, output a status block. Templates and check labels for each phase live in references/step-reports.md. Result line is PASS | FAIL | PARTIAL.

Expected Output

For "draw a flowchart of the user login process": file login-flow.excalidraw containing valid Excalidraw JSON, plus a validation summary in the response. Example fragment:

json
{
  "type": "excalidraw", "version": 2, "source": "https://excalidraw.com",
  "elements": [
    {"id": "start-1", "type": "ellipse", "x": 300, "y": 40, "width": 120, "height": 56,
     "boundElements": [{"id": "txt-start", "type": "text"}]},
    {"id": "txt-start", "type": "text", "text": "Start", "fontSize": 18, "fontFamily": 1,
     "containerId": "start-1", "lineHeight": 1.25, "autoResize": true}
  ],
  "appState": {"theme": "light", "viewBackgroundColor": "#ffffff"}, "files": {}
}

Expected response includes:

Validation: 10/10 checks passed
- Elements: 6 shapes, 6 text labels, 5 arrows
- Bindings: 6 text bindings, 10 arrow bindings (all two-way)
- Text fits: all shapes sized to fit their bound text
- No overlaps, no missing fields

Edge Cases

  • 30+ elements — spawn the subagent review loop in references/style-and-iteration.md; cap at 3 fix cycles.
  • Text-heavy nodes — apply Check 10 strictly; bigger shapes, never smaller text.
  • Ambiguous relationships — ask before guessing; saves a regeneration cycle.
  • "Just do it" — defaults (hand-drawn, roughness 1, Virgil, best-fit layout); skip the proposal.
  • Iteration on an existing file — read the file, preserve unchanged IDs, modify only the requested parts, rewrite.

See references/style-and-iteration.md for extended edge cases, iteration patterns, and style variants.

Acceptance Criteria

  • Output file is valid JSON with top-level type, version, elements, appState, files.
  • Every element has all required fields (per references/validation-checks.md Check 2).
  • Text elements have fontSize >= 16, lineHeight: 1.25, autoResize: true.
  • All element IDs are unique.
  • Text-to-shape bindings are two-way (containerId ↔ boundElements).
  • Arrow bindings are two-way (startBinding/endBinding ↔ boundElements).
  • Every arrow has points[0] === [0,0] and length ≥ 2.
  • No bounding boxes overlap by more than 10px (outside groups/frames).
  • Every entity/relationship from the user's request is represented.
  • Every container shape is sized to fit its bound text (Check 10).
  • Validation report (10/10 summary) is included in the response.

Supported Diagram Types

Full catalogue with layout guidance: references/diagram-types.md. Categories: Flow & Process, Architecture, Data & Relationships, Planning, Comparison, Data Viz, UX/Design, Custom. If the request doesn't map cleanly to one type, propose the closest fit and explain why.

References

  • references/validation-checks.md — full text of all 10 Phase-4 checks plus fix recipes.
  • references/excalidraw-format.md — Excalidraw JSON schema and field defaults.
  • references/diagram-types.md — diagram-type catalogue with layout guidance.
  • references/style-and-iteration.md — style variants, iteration patterns, subagent architecture, extended edge cases.
  • references/step-reports.md — step completion report templates per phase.
  • agents/json-generator.md, agents/json-validator.md, agents/json-fixer.md — subagent specs for the large-diagram review loop.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Excalidraw Generator làm được gì?

Generate diagrams as valid Excalidraw JSON — flowcharts, architecture, ER diagrams, mind maps, sequence diagrams, wireframes, C4 models, and more. Don't use for draw.io/Mermaid output, slide decks, or pixel-perfect brand graphics.

Vì sao nên dùng Excalidraw Generator trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Excalidraw Generator là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Excalidraw Generator trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/luongnv89/skills/tree/main/skills/diagram-generator/excalidraw-generator. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Excalidraw Generator?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Excalidraw Generator với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Excalidraw Generator với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Excalidraw Generator có miễn phí không?

Có. Kỹ năng này được luongnv89 phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇