Logo Excalidraw

Excalidraw

Cộng đồng
fabricioartur
excalidraw

Create, inspect, and edit Excalidraw diagrams as editable `.excalidraw` JSON files. Use when Codex needs to turn architecture sketches, process flows, user journeys, system diagrams, workshop notes, whiteboard-style visuals, or Mermaid-like node-and-edge specs into an Excalidraw file; modify existing Excalidraw scenes; or prepare diagram files that the user can open and continue editing in Excalidraw.

Tổng quan

Nhà phát hànhfabricioartur
Kho mãcodex-excalidraw-skill
Tên kỹ năngexcalidraw
Sao
33
Bản fork
0
Tệp đi kèm
15
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ộ.

  • 15 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 fabricioartur 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 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/fabricioartur/codex-excalidraw-skill/tree/main/skill
  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/fabricioartur/codex-excalidraw-skill.git /tmp/codex-excalidraw-skill
mkdir -p .claude/skills
cp -r /tmp/codex-excalidraw-skill/skill .claude/skills/excalidraw
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 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 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 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

Overview

Create diagrams as real .excalidraw JSON, not screenshots, so the user can keep editing them in Excalidraw. Prefer simple editable shapes, text, arrows, frames, and grouped sections over pixel-perfect artwork.

Important boundary: this skill can create editable files and preview pages, but a skill alone cannot create a native inline Excalidraw widget with live editing, checkpoint restoration, or host-provided buttons inside the chat UI. That experience requires an MCP/app/widget integration that exposes operations like read_me, create_view, checkpoint storage, and widget rendering.

Core Workflow

  1. Clarify the diagram intent only when the request lacks the actors, nodes, or flow.
  2. Decide whether this is a new diagram or an edit to the previous diagram:
    • If the user asks to adjust, change, add, remove, make bigger/smaller, recolor, relabel, simplify, improve, or otherwise revise "this", "that", "the diagram", or "the last one", use the incremental edit workflow below.
    • If the user asks for a new subject, create a new diagram.
  3. Default to web-link handoff for new diagrams:
    • Use scripts/create_web_diagram.py and pass the spec through stdin.
    • Let the script create its own temporary folder under /private/tmp.
    • Request network permission during generation so Codex can upload the encrypted scene and return a ready https://excalidraw.com/#json=... link.
    • Return the preview image, the local preview page path, and the ready Excalidraw Web URL.
    • The local preview page must include an Open in Excalidraw button that points directly to the ready web URL.
    • Use --no-web-link only when the user explicitly asks for local-only/offline output or refuses network access.
    • Persist a copy of the latest diagram in the default state directory, or in CODEX_EXCALIDRAW_STATE_DIR when configured, with scripts/session_state.py save so later edits can reuse it.
  4. Choose the fastest path:
    • For simple node-and-edge diagrams, use scripts/generate_excalidraw.py.
    • For soccer/football roster or tactical squad diagrams, use scripts/create_tactical_roster.py; do not hand-write the scene unless the template cannot represent the request.
    • For landmark/building elevation diagrams, use scripts/create_building_elevation.py; do not hand-write a building scene unless the template cannot represent the request.
    • For Mermaid or standard diagram syntax, consult references/official-excalidraw.md and prefer the official @excalidraw/mermaid-to-excalidraw path when available.
    • For spatial, editorial, tactical, dashboard-like, swimlane, field/court/map, roster, org chart, comparison, or visually composed diagrams, edit/create the JSON directly using references/format.md; do not force these into generic boxes and arrows.
  5. Save output with the .excalidraw extension when a file is needed.
  6. Generate a preview when the user expects to see the diagram in chat or browser:
    • Prefer --preview with scripts/generate_excalidraw.py for generated diagrams.
    • For direct JSON edits, create a separate SVG preview, generate a ready web URL when permitted, and use scripts/preview_page.py to create the HTML preview with the Open in Excalidraw button.
  7. Validate the result with scripts/validate_scene.py when an .excalidraw file exists. It checks top-level shape, duplicate IDs, invisibly small elements, and text likely to be unreadable.
  8. Run the visual quality gate in references/quality-gate.md before delivery. Fix readability or layout problems before showing the user.
  9. Save latest-state metadata with scripts/session_state.py save unless the user explicitly asks for a throwaway diagram.
  10. Tell the user what is available: preview image first, then the ready Excalidraw Web link and local preview page with the Open in Excalidraw button.

Incremental Edit Workflow

When the user asks for a change to the previous diagram, do not start from scratch by default.

  1. Run:
bash
python3 ~/.codex/skills/excalidraw/scripts/session_state.py show
  1. If exists is true and scene points to a readable .excalidraw, load that file and modify only the requested parts.
  2. Preserve element IDs and unrelated layout whenever practical.
  3. If the previous diagram was generated from a saved spec and the requested change maps cleanly to that spec, edit the spec and regenerate through the same template. Otherwise edit the .excalidraw JSON directly.
  4. Generate a fresh preview, ready Excalidraw Web URL, and local preview page with the Open in Excalidraw button when network permission is available. Use local-only preview only if web upload is refused or explicitly undesired.
  5. Validate with scripts/validate_scene.py.
  6. Save the revised diagram back to session state with scripts/session_state.py save.
  7. In the response, briefly say it reused the previous diagram and describe only what changed.

If no previous state exists, say that there is no saved previous diagram and create a new one from the user's request.

Experience Levels

Use the right handoff based on what the environment supports:

  • File handoff: create .excalidraw only. Best when the user just needs an editable file.
  • Web-link handoff: create temporary files under /private/tmp, use the default web upload, return the https://excalidraw.com/#json=... URL plus preview image and preview HTML. This is the default because it gives the user a ready one-click Excalidraw Web path.
  • Preview handoff: create .excalidraw, -preview.svg, and -preview.html without upload by passing --no-web-link. Use this when the user wants local-only/offline output or does not grant network permission.
  • Session-state handoff: after creating or editing, copy the latest scene, preview, and spec into the default state directory with scripts/session_state.py. This makes follow-up edits faster and safer.
  • MCP widget handoff: use a dedicated Excalidraw MCP/app integration if available. This is required for inline editing in chat, preserving manual edits via checkpoint IDs, and one-click open/edit actions backed by the host UI.

Do not describe preview HTML as equivalent to a native MCP widget. Explain that it is a local approximation: the button exists in the preview page, not as a native button embedded in the chat transcript.

Creating Diagrams

Use the generator for architecture diagrams, process maps, simple flows, stakeholder maps, and other diagrams that can be represented as boxes plus arrows.

Before using the generator, ask: "Would a human expect this as a specific visual composition?" If yes, create a custom Excalidraw scene instead. Examples:

  • Football/soccer team lists: draw a pitch, place starters by formation, and put reserves in a side panel.
  • Journey maps: use columns or swimlanes, not a single horizontal chain.
  • System architecture: use grouped zones and data-flow arrows, not one flat row if the system has layers.
  • Research summaries: use sections, callouts, and evidence blocks.

For these cases, make the visual explanation the artifact. The diagram should teach at a glance, not merely list facts.

Read references/visual-layouts.md for pattern-specific guidance, references/quality-gate.md before delivering any composed visual, references/official-excalidraw.md when you need official Excalidraw APIs, import/export behavior, Mermaid conversion, or web-link caveats, and references/authoring-rules.md before writing custom scene-generation code.

For football/soccer roster diagrams, prefer ready web-link generation:

bash
python3 ~/.codex/skills/excalidraw/scripts/create_tactical_roster.py - --name brazil-2026 --web-link

Pass the roster spec through stdin. The template enforces exactly 11 starters, short readable field labels, side-panel roster cards, SVG preview generation, and optional Excalidraw Web upload.

For landmark/building elevation diagrams, prefer ready web-link generation:

bash
python3 ~/.codex/skills/excalidraw/scripts/create_building_elevation.py - --name empire-state --web-link

Pass the building spec through stdin or reuse a spec from <workspace>/excalidraw/specs/. The template creates a composed elevation, fact panel, callouts, SVG preview, validation, and optional Excalidraw Web upload.

Create a compact spec JSON:

json
{
  "title": "Checkout Flow",
  "direction": "LR",
  "nodes": [
    {"id": "buyer", "label": "Buyer"},
    {"id": "web", "label": "Storefront"},
    {"id": "pay", "label": "Payment API"}
  ],
  "edges": [
    {"from": "buyer", "to": "web", "label": "Selects item"},
    {"from": "web", "to": "pay", "label": "Authorizes"}
  ]
}

Then run:

bash
python3 ~/.codex/skills/excalidraw/scripts/generate_excalidraw.py spec.json output.excalidraw

For a Claude-style handoff with a visible preview and browser page, run:

bash
python3 ~/.codex/skills/excalidraw/scripts/generate_excalidraw.py spec.json output.excalidraw --preview

For the default web-link handoff, pass the spec through stdin:

bash
python3 ~/.codex/skills/excalidraw/scripts/create_web_diagram.py - --name checkout-flow

The command prints JSON containing url, preview_svg, preview_html, excalidraw, spec, element_count, and temporary_dir. In the default mode, url is a ready https://excalidraw.com/#json=... link and preview_html contains an Open in Excalidraw button pointing to it. Use this command for normal user requests so Codex does not need to create temp files manually.

After generation, persist the latest diagram for follow-up edits:

bash
python3 ~/.codex/skills/excalidraw/scripts/session_state.py save \
  --scene /path/to/output.excalidraw \
  --preview /path/to/output-preview.svg \
  --html /path/to/output-preview.html \
  --url "https://excalidraw.com/#json=..." \
  --request "original user request" \
  --template "template-or-custom"

For local-only/offline output, skip the upload:

bash
python3 ~/.codex/skills/excalidraw/scripts/create_web_diagram.py spec.json --name checkout-flow --no-web-link

If the user does not want files saved in their workspace, do not use apply_patch or manual file creation for /private/tmp. Use create_web_diagram.py, which handles staging safely.

This creates:

  • output.excalidraw: the editable Excalidraw scene.
  • output-preview.svg: a lightweight preview that can be embedded in chat.
  • output-preview.html: a local preview card with buttons to download the .excalidraw file and open Excalidraw Web.
  • By default, the preview HTML button points to the ready https://excalidraw.com/#json=... link, so the diagram opens already loaded in Excalidraw Web.
  • With --no-web-link, the preview HTML falls back to a local-only button that can attempt browser-side upload on click.

Note: the default web-link flow uploads an encrypted, compressed copy of the diagram to Excalidraw's public JSON storage. The decryption key stays in the URL fragment. If network permission is refused, keep the no-upload preview fallback.

MCP-Style Behavior

If the user asks for Claude-like Excalidraw behavior, explain the required moving parts:

  1. A tool such as read_me to expose the supported Excalidraw JSON schema.
  2. A tool such as create_view to validate elements and render a host-native widget.
  3. A checkpoint store to persist the scene after every create/edit operation.
  4. A way to read back manual widget edits before applying chat-requested changes.
  5. A hosted or encoded scene URL for opening Excalidraw Web with the diagram preloaded.

In Codex without that MCP/widget integration, produce the best available fallback: .excalidraw plus preview SVG/HTML, and keep the spec JSON so future edits can be regenerated.

Supported spec fields:

  • title: optional title shown at the top of the canvas.
  • direction: LR for left-to-right or TB for top-to-bottom. Default is LR.
  • nodes: required list of objects with id and label.
  • edges: optional list of objects with from, to, and optional label.
  • groups: optional list of objects with label and nodes to draw a light frame around related nodes.

Editing Existing Files

When editing a supplied .excalidraw file:

  1. Parse the JSON and preserve unknown fields.
  2. Modify only the relevant elements.
  3. Preserve files entries and image references.
  4. Keep element IDs stable unless replacing an element.
  5. Increment version or versionNonce for edited elements when practical.
  6. Prefer restore-style repair semantics: missing defaults, stale bindings, and text dimensions should be repaired instead of blindly preserved when they break rendering.
  7. Re-parse the saved JSON before handing it back.

Read references/format.md when direct JSON edits are needed.

Style Guidance

  • Use clear labels, short lines, and generous spacing.
  • Prefer rectangles for components, diamonds only for decisions, and arrows for direction.
  • Use restrained colors: dark strokes, light fills, and one accent color for emphasis.
  • Avoid embedding long paragraphs in shapes; create note text near the diagram instead.
  • Do not export an image unless the user specifically asks for a PNG/SVG/PDF.
  • Never put long names plus metadata inside small shapes. Put short labels in the shape and move detail to a side panel, legend, or note.
  • Optimize for readability at chat-preview scale, not just at full zoom in Excalidraw.
  • For custom scripts, import scene_primitives.py and use keyword arguments for optional text settings to avoid positional-argument mistakes.

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 làm được gì?

Create, inspect, and edit Excalidraw diagrams as editable `.excalidraw` JSON files. Use when Codex needs to turn architecture sketches, process flows, user journeys, system diagrams, workshop notes, whiteboard-style visuals, or Mermaid-like node-and-edge specs into an Excalidraw file; modify existing Excalidraw scenes; or prepare diagram files that the user can open and continue editing in Excalidraw.

Vì sao nên dùng Excalidraw 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 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 trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/fabricioartur/codex-excalidraw-skill/tree/main/skill. 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?

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 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 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 có miễn phí không?

Có. Kỹ năng này được fabricioartur 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 👇