Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

obsidian-excalidraw

БесплатноЗапускает вложенные скриптыНе проверен

This skill should be used when the user asks to "create an excalidraw diagram", "generate a diagram in Obsidian", "add a diagram to my vault", "embed a…

sjunglingот sjungling★ 15 звёзд на GitHub

Об этом скилле

Obsidian Excalidraw

Generate .excalidraw files programmatically and embed them in Obsidian markdown notes.

Quick start

Write a generator script to $TMPDIR, make it executable, and run it. The PEP 723 header pins the SDK and the shebang self-invokes through uv — no venv, no install.

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = ["excaligen==0.11.14"]
# ///
import sys
sys.path.insert(0, "${CLAUDE_PLUGIN_ROOT}/skills/obsidian-excalidraw/scripts")

from obsidian_preset import fit, new_scene, styled

scene = new_scene()
user = styled(scene.ellipse("User").size(*fit("User", shape="ellipse")).center(0, 0), "active")
api = styled(scene.rectangle("API Gateway").size(*fit("API Gateway")).center(340, 0), "active")
scene.arrow("request").bind(user, api)
print(scene.json())
chmod +x "$TMPDIR/gen-diagram.py"
"$TMPDIR/gen-diagram.py" > "$TMPDIR/diagram.excalidraw"

The generated script runs as a standalone process, so ${CLAUDE_PLUGIN_ROOT} must be expanded to a literal absolute path when you write the script — a shell variable won't resolve there. Get it with echo "$CLAUDE_PLUGIN_ROOT"; if unset, locate the installed plugin directory (e.g. find ~/.claude/plugins -path "*/obsidian-excalidraw/skills/obsidian-excalidraw/scripts" 2>/dev/null | head -1).

bind() computes edge-to-edge geometry, bidirectional bindings, and bound text labels automatically. Pass shape objects to bind() — never coordinates.

Size every shape with fit(label). excaligen neither wraps a label nor grows its shape (the default is 130×80), so a long label overflows it. fit returns a width and height that hold the label (pass shape="ellipse" or "diamond" for those), never below 120×60. Call .size(*fit(label)) before .center(x, y).

Labels must be single-line with no ", tab or backslash characters: the Obsidian CLI corrupts them. obsidian_preset raises InvalidLabelError at construction rather than letting a corrupt write through. Put longer explanations in a separate scene.text(...) near the shapes.

Full library API: https://milanpiskla.github.io/excaligen/

Embed in any Obsidian note:

!diagram.excalidraw

How Obsidian stores Excalidraw files

Write .excalidraw JSON → Obsidian converts it to .excalidraw.md. The original .excalidraw disappears. The .excalidraw.md format wraps compressed JSON with a plaintext text-elements section (for Obsidian search/backlinks). On a filesystem-writable vault, no need to produce this format — write plain JSON and let the plugin convert.

iCloud vaults are the exception. Vaults under ~/Library/Mobile Documents/ cannot be written on the filesystem (macOS blocks the process — see "Writing to the vault" below). There you must write the .excalidraw.md form through the Obsidian CLI.

!name.excalidraw embeds resolve to name.excalidraw.md automatically.

A live scaffold example of the converted format is in references/obsidian-file-format.md.

See references/obsidian-file-format.md for the full format breakdown and decompression instructions.

Updating a diagram — always update in place

Do not delete a .excalidraw.md file and recreate it. Write a new .excalidraw to the same base filename and Obsidian overwrites the existing .excalidraw.md:

# Correct: same base name → Obsidian converts and overwrites .excalidraw.md
./gen-diagram.py > /vault/FolderName/diagram.excalidraw

# Wrong: breaks iCloud sync tracking, loses undo history,
# and leaves dangling !diagram.excalidraw embeds in other notes
rm /vault/FolderName/diagram.excalidraw.md   # ❌

Use the Write tool when saving from Claude — it overwrites in place without deleting.

But Route A diagrams can't be read back. Once Obsidian converts a .excalidraw to .excalidraw.md, the ## Drawing block is compressed-json — excaligen has no decoder. To "update" one: ask the user to run Obsidian's "Decompress current Excalidraw file", or regenerate the diagram from its description rather than reading the old one back.

Layout

  • Space shapes 20 to 30 px apart or more; prefer fewer, larger shapes.
  • fontsize 16 or more for labels, 20 or more for titles.
  • Draw order is z-order: create containers first, arrows after the shapes they join.
  • Group related shapes behind a dashed secondary rectangle with a white fill, created first.
  • No emoji in labels.

references/element-format.md has the underlying element shape (bound text, arrow bindings, sizes) and a quick jq check for a generated file.

Status color system

Use stroke color + style to show state. Always keep fills white — colored fills render dark in Obsidian's embedded preview regardless of the file content.

State strokeColor backgroundColor strokeWidth strokeStyle
Active / normal #1d4ed8 (blue) #ffffff 2 solid
Lapsed / cancelled #dc2626 (red
Полный SKILL.md на GitHub

Установить obsidian-excalidraw в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/example.pyreferences/element-format.mdreferences/icloud-vaults.mdreferences/obsidian-file-format.mdreferences/pitfalls.mdscripts/obsidian_preset.pyscripts/write_to_vault.py

FAQ

Что делает скилл obsidian-excalidraw?

This skill should be used when the user asks to "create an excalidraw diagram", "generate a diagram in Obsidian", "add a diagram to my vault", "embed a diagram", "make a flowchart", "visualize relationships", "draw a network diagram", or wants to programmatically generate .excalidraw files for an Obsidian vault. Also use when the user asks to update or regenerate an existing diagram file.

Как установить скилл obsidian-excalidraw?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл obsidian-excalidraw запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить obsidian-excalidraw с