К основному содержанию
скилл CX Codex

excalidraw-diagrams — скилл для Claude Code: что делает

Скилл excalidraw-diagrams создаёт и обновляет схемы Excalidraw через интерактивный просмотр MCP или локальный Python-скрипт.

Apache-2.0 ★ 173 обновлён 2026-10-24

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add sammcj/agentic-coding --skill excalidraw-diagrams -a claude-code
Открыть на GitHub

Что делает excalidraw-diagrams

Скилл регламентирует построение диаграмм Excalidraw внутри Claude Code. Для чата используется вызов create_view через Excalidraw MCP (https://excalidraw-mcp-app.vercel.app/mcp), а для сохранения схем в файл — вспомогательный скрипт scripts/generate_excalidraw.py. При интерактивном просмотре агент задействует cameraUpdate для навигации по узлам.

Команда export_to_excalidraw теряет подписи внутри фигур из-за ошибки формата, поэтому экспортировать файлы напрямую из интерактивного режима нельзя. Для сохранения файла .excalidraw генератор создаёт связанные текстовые контейнеры вручную. Между связанными фигурами требуется отступ от 60 пикселей, иначе стрелки ломаются при рендере.

Какие задачи решает

  • собрать архитектурную схему прямо в чате с интерактивным просмотром
  • сгенерировать валидный файл .excalidraw с привязанными текстами и стрелками
  • исправить съехавшие связи между блоками на готовой диаграмме

Примеры запросов агенту

  • Нарисуй схему авторизации пользователя и сохрани её в auth-flow.excalidraw
  • Покажи интерактивное превью пайплайна данных без сохранения в файл
  • Сгенерируй файл архитектуры сервиса через generate_excalidraw.py

Как установить excalidraw-diagrams

1Через Skills CLI (Vercel)

npx skills add sammcj/agentic-coding --skill excalidraw-diagrams -a claude-code

2Вручную: положить файлы

~/.claude/skills/excalidraw-diagrams/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/excalidraw-diagrams/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об excalidraw-diagrams

Как установить excalidraw-diagrams в Claude Code?

Выполните команду npx skills add sammcj/agentic-coding --skill excalidraw-diagrams -a claude-code в терминале.

Что делает excalidraw-diagrams?

Направляет модель при создании схем Excalidraw, помогая выбрать между встроенным просмотром в диалоге и генерацией файла .excalidraw через Python-скрипт.

Почему текст пропадает при ручном экспорте?

Параметр label работает только в create_view. Для файла .excalidraw текст должен быть отдельным связанным элементом с набором обязательных полей, что и делает встроенный скрипт.

Исходный текст

SKILL.md · Apache-2.0
---
name: excalidraw-diagrams
description: Use when asked to create or update Excalidraw diagrams. Provides guidance on Excalidraw best practices.
disable-model-invocation: true
argument-hint: "Thing you want to do"
---

# Creating Excalidraw Diagrams

When creating Excalidraw diagrams, ensure you:

- Generate the layout with correct spacing
- Make consistent and logical use of colours, fonts, and shapes
- Text is correctly added within shapes, not as separate text elements (unless desired)
- Arrows and lines are correctly anchored / connected to shapes (not floating) so that when objects are moved any connections remain intact
- You save the Excalidraw diagram content to a file and link the file path
- Call `read_me` before your first `create_view` call each session - it provides the colour palette, camera sizes, layout rules, and element format reference.
- If the user has asked you to create Excalidraw diagrams but you do not have the Excalidraw MCP enabled, you should ask them to add it for you, they can configured it by using the HTTP MCP URL of: https://excalidraw-mcp-app.vercel.app/mcp and they can view the MCP documentation here: https://github.com/excalidraw/excalidraw-mcp

## Choose your workflow

Pick one based on what the user needs. Do not default to doing both.

### Inline preview only (`create_view`)

Use when the diagram is for the conversation only - the user wants to see it in the chat and does not need a file.

- Use `create_view` with `label` on shapes (works fine here)
- Use `cameraUpdate` to animate and guide attention
- No file output needed

### File output only (Python script)

Use when the user needs a `.excalidraw` file to open, share, edit, or keep. Skip `create_view` entirely.

- Generate the file with `scripts/generate_excalidraw.py` (see below)
- Provide the file path to the user
- Files can be opened by dragging into excalidraw.com, the Excalidraw desktop app, or VS Code with the Excalidraw extension

### Both (inline preview + file)

Use when the user wants to see the diagram in the chat AND keep a file. Note: these are built independently with different element formats. There is no data bridge between them - you define the diagram structure once conceptually but render it twice.

- `create_view` with `label` for the inline preview
- Python script with `labeled_rect` for the `.excalidraw` file

## Critical: text does not survive export

The `label` property on shapes is a `create_view` convenience only. It does NOT work in:
- `export_to_excalidraw` uploads (shapes render, text is invisible)
- `.excalidraw` files written from `create_view` checkpoint data

Do NOT use `export_to_excalidraw` for shareable diagrams. It seems to have a bug that can silently drop all text.

Native Excalidraw represents text inside shapes as two linked elements:
1. Shape: `"boundElements": [{"id": "text-id", "type": "text"}]`
2. Text: `"containerId": "shape-id"`, `"textAlign": "center"`, `"verticalAlign": "middle"`

The text element requires fields the `label` shorthand omits: `fontFamily` (1), `width`, `height`, `originalText`, `lineHeight` (1.25), `autoResize` (true).

All elements in .excalidraw files also need: `angle`, `seed`, `version`, `versionNonce`, `isDeleted`, `groupIds`, `frameId`, `updated`, `link`, `locked`.

Hand-writing this JSON is error-prone. Use the Python script instead.

## Python script: `scripts/generate_excalidraw.py`

Generates native .excalidraw files with all required fields. Can be used inline in a bash heredoc or imported as a library.

Key functions:

| Function | Returns | Purpose |
|----------|---------|---------|
| `labeled_rect(id, x, y, w, h, bg, stroke, label, ...)` | `[rect, text]` | Shape with centred bound text (handles all binding and field generation) |
| `rect(id, x, y, w, h, bg, stroke, ...)` | element | Rectangle without text |
| `txt(id, x, y, w, h, text, size, ...)` | element | Standalone or bound text |
| `bound_arrow(id, elements, start_id, start_point, end_id, end_point, ...)` | element | Arrow anchored to two shapes (mutates shapes' boundElements) |
| `arrow(id, x, y, w, h, points, ...)` | element | Unbound/floating arrow (use `bound_arrow` instead when connecting shapes) |
| `ellipse(...)` / `diamond(...)` | element | Other shape types |
| `write_scene(elements, path)` | writes file | Wraps in scene structure and saves |

Example:

```bash
python3 << 'PYEOF'
import sys, random
sys.path.insert(0, "/Users/samm/.claude/skills/excalidraw-diagrams/scripts")
from generate_excalidraw import *

random.seed(42)
elements = []
elements.append(txt("t1", 200, 10, 300, 30, "My Diagram", 24))
elements.extend(labeled_rect("a", 50, 60, 200, 70, "#a5d8ff", "#4a9eed", "Step One"))
elements.extend(labeled_rect("b", 350, 60, 200, 70, "#b2f2bb", "#22c55e", "Step Two"))
elements.append(bound_arrow("a1", elements, "a", [1, 0.5], "b", [0, 0.5]))
write_scene(elements, "/path/to/output.excalidraw")
PYEOF
```

For shapes without the `labeled_rect` convenience, pair `rect(..., bound_text="tid")` with `txt(..., container="rid", align="center", valign="middle")`.

## Arrow anchoring

By default, arrows float free - moving a shape leaves the arrow behind. Use `bound_arrow` instead of `arrow` to anchor arrows to shapes. It handles the bidirectional binding automatically (arrow references shapes, shapes list the arrow in `boundElements`).

`fixedPoint` values for connection points on shapes: top=`[0.5, 0]`, right=`[1, 0.5]`, bottom=`[0.5, 1]`, left=`[0, 0.5]`. Any `[fx, fy]` value works where 0,0 is the shape's top-left corner and 1,1 is bottom-right.

**Important**:
- Shapes must already exist in `elements` before calling `bound_arrow`, since it looks them up and mutates their `boundElements`.
- **Minimum 60px between connected shapes.** Excalidraw recalculates bound arrow geometry at render time. When shapes are too close together (under ~60px gap), arrows overlap and pass through boxes instead of connecting at edges. The script warns if this threshold is violated. Plan layouts with adequate spacing.
- **Avoid large background rectangles that overlap connectable shapes.** Excalidraw's binding resolution can misfire when a bound arrow's endpoint falls inside a background rect that overlaps the intended target shape. If you need section backgrounds, add them after all bound arrows, or use standalone text labels and colour-coded boxes instead.

For the inline `create_view` workflow, use `startBinding`/`endBinding` with `fixedPoint` directly on arrow elements.

## Privacy

Note that if the diagram contains potentially sensitive information (e.g. detailed network diagrams, identifiable information etc...) and the user asks you to upload the diagram to excalidraw.com - you should first warn them that this will make the diagram publicly accessible and ask if they want to proceed.

© sammcj · Apache-2.0 · sammcj/agentic-coding

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

Все скиллы по теме «Дизайн» →
excalidraw Agents365-ai Рисует диаграммы, блок-схемы и схемы архитектуры в файлах .excalidraw и выгружает их в PNG или SVG. Визуализирует системы, которые сложно описать текстом. CX Codex +1 4 700установок excalidraw-skill lingzhi227 Скилл даёт агенту инструменты для рисования и правки диаграмм Excalidraw на живом канвасе, с экспортом в файлы и картинки. CX Codex +1 1 600установок hand-drawn-diagrams muthuishere Скилл hand-drawn-diagrams для Claude Code рисует схемы, блок-схемы, вайрфреймы и визуальные объяснения в Excalidraw. Подключается к запросам на диаграмму, карту мыслей или макет страницы. CX Codex +1 675установок excalidraw-mcp-server reason-machines Учит агента собирать MCP-серверы, которые отдают интерактивные диаграммы Excalidraw в стиле от руки, с потоковой дорисовкой и управлением областью просмотра. CX Codex +1 235установок excalidraw-diagram-generator официальный github Скилл excalidraw-diagram-generator для GitHub Copilot превращает описание на обычном языке в диаграмму Excalidraw. Показывает процессы, связи между объектами и устройство системы. CX Codex +1 31 639установок excalidraw-diagram coleam00 Скилл excalidraw-diagram для Claude Code: генерирует .excalidraw JSON-файлы схем архитектуры и процессов. Наглядно разбирает структуру системы или алгоритм без ручного рисования. CX Codex +1 8 900установок

Из того же набора73

Весь набор →
piper-tts-training Скилл piper-tts-training для Claude Code готовит датасеты, запускает дообучение и экспортирует голоса Piper в ONNX. Голоса предназначены для синтеза речи на микрокомпьютерах вроде Raspberry Pi. CX Codex +1 ★ 173звёзд репо html-design-examples Скилл html-design-examples для Claude Code создаёт одностраничные HTML-материалы по образцам из галереи. Он создаёт планы, отчёты, прототипы и другие материалы для чтения в браузере. CX Codex +1 ★ 173звёзд репо step-back Субагент step-back для проверки, не перегружён ли текущий подход избыточными абстракциями. Анализирует код или дизайн и выносит вердикт: продолжать, упрощать или переделать с нуля. CX Codex ★ 173звёзд репо reframe-voice Скилл reframe-voice для Claude Code задаёт стиль доказательных колонок с переосмыслением привычных идей. Помогает разбирать сложные темы в лонгридах без рекламного пафоса. CX Codex +1 ★ 173звёзд репо idrive-backup Помогает проверять и менять настройки iDrive Backup на macOS, включая пути резервного копирования и исключения. При изменениях инструмент автоматически сохраняет копии конфигурации. CX Codex +1 ★ 173звёзд репо ghostty-config Скилл ghostty-config помогает настраивать терминал Ghostty: подсказывает синтаксис config.ghostty, валидирует параметры и учитывает отличия macOS и Linux. CX Codex +1 ★ 173звёзд репо release-debrief Скилл release-debrief для Claude Code сравнивает свежий релиз поддерживаемого инструмента с последней сохранённой сводкой. Разбирает изменения в Claude Code, OpenCode, llama-swap и llama.cpp. CX Codex +1 ★ 173звёзд репо pptx-to-md Скилл pptx-to-md для Claude Code превращает PPTX в Markdown: один файл на слайд, с текстом, позициями изображений и описанием диаграмм и скриншотов. CX Codex +1 ★ 173звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой