Skills/excalidraw-diagrams/SKILL.md
Use when asked to create or update Excalidraw diagrams. Provides guidance on Excalidraw best practices.
npx skillsauth add sammcj/agentic-coding excalidraw-diagramsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When creating Excalidraw diagrams, ensure you:
read_me before your first create_view call each session - it provides the colour palette, camera sizes, layout rules, and element format reference.Pick one based on what the user needs. Do not default to doing both.
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.
create_view with label on shapes (works fine here)cameraUpdate to animate and guide attentionUse when the user needs a .excalidraw file to open, share, edit, or keep. Skip create_view entirely.
scripts/generate_excalidraw.py (see below)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 previewlabeled_rect for the .excalidraw fileThe 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 dataDo 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:
"boundElements": [{"id": "text-id", "type": "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.
scripts/generate_excalidraw.pyGenerates 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:
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").
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:
elements before calling bound_arrow, since it looks them up and mutates their boundElements.For the inline create_view workflow, use startBinding/endBinding with fixedPoint directly on arrow elements.
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.
tools
Provides tools for managing MarkEdit, a macOS markdown editor
tools
Provides knowledge on using the `glean` CLI tool to access company knowledge and documents through Glean. Use when the user asks you to use Glean to search, read or otherwise access knowledge from their company's Confluence, Slack, Google Drive Files (Slides, Documents, Sheets) etc.
development
Applies the Diataxis framework to create or improve technical documentation. Use when being asked to write high quality tutorials, how-to guides, reference docs, or explanations, when reviewing documentation quality, or when deciding what type of documentation to create. Helps identify documentation types using the action/cognition and acquisition/application dimensions.
development
Use when answering questions from this machine-learning knowledge base. Triggers: questions about transformers, attention cost and efficiency, and long-context scaling; 'what do we know about attention', 'check the ML wiki'. Read-only querying of compiled knowledge; to add, update, supersede, lint, audit, or critique, use the llm-wiki skill instead.