Visualize
Pick the form the content supports, build it on the surface that fits, and look at the result before calling it done. A table that answers the question beats a diagram that decorates it.
Choose the form
| What the nodes are | Form | Writer |
|---|---|---|
| Existing vault notes to navigate | JSON Canvas (.canvas) |
direct file write; schema in references/canvas.md |
| Free shapes with no backing note: architecture, data flow, mind map, sketch, annotated figure | Excalidraw (.excalidraw.md) |
plugin CLI, or scripts/draw.py offline |
| A small structural diagram inside a note's prose | Pele (a mermaid fence) |
the note edit itself |
If the request names a form, that form is the answer unless it cannot carry the content; say so before switching. Do not deliver a Canvas because Excalidraw looked tedious, nor an Excalidraw of note titles when the reader should click through to notes. For a Canvas, every file node and wikilink target must resolve in the destination vault; a plausible name is not a resolved one.
Ground every box and arrow in inspected evidence (files at a pinned revision, note contents, measured values). Label declared configuration as declared. A reference image supplies visual language only, never services or numbers.
A drawing carries what prose cannot: position, grouping, order and proportion. Keep each label to a keyword or a value, and put any sentence that explains, qualifies or tells the reader how to read the drawing in the note beside it. A section that needs a paragraph to be understood has the wrong arrangement, so change the arrangement.
Follow-up questions on the same subject extend the same drawing as numbered sections, because one surface shows relations that separate files hide. When a new answer shares an axis with an existing section (the same stages, the same timeline), add it there as another lane or row. Start a new drawing when the subject changes.
Canvas
A .canvas file is JSON Canvas 1.0, written directly as a file; no plugin or CLI is required. Open references/canvas.md for the node, edge, color and ID schema and its validation checklist, references/canvas-operations.md before changing a canvas that already holds user data, and references/canvas-examples.md for complete documents. Existing IDs, unrelated nodes and edges, unknown keys and node order survive an edit; a duplicate or dangling ID is reported, never repaired silently.
Excalidraw
Open references/excalidraw-design.md to choose the drawing's pattern, palette and spacing before placing anything; its fidelity check (each stated relationship is one arrow, labels in the user's language) and its sketch guidance apply to every drawing. The common case is a loop of two scripts, so references/excalidraw-plugin.md is needed only to edit an existing drawing or for a plugin edge case.
Update first. Keep the Excalidraw plugin on its latest version: python3 scripts/update-plugin.py --vault <name> (prints plugin, before, after). The CLI has no update command; if the script fails, use Settings → Community plugins → Check for updates. If obsidian-excalidraw-plugin:* commands return "not found" while the plugin is enabled, run obsidian vault=<name> plugin:reload id=obsidian-excalidraw-plugin once.
Write, then look:
python3 scripts/draw.py <spec.json|-> [<out.excalidraw.md> [--replace]]
python3 scripts/export.py <vault-relative drawing> [--out <abs path outside vault>] --vault <name> [--max-width 1600] [--scale 1] [--placeholder-images] [--source auto|live|disk]export.py writes the PNG outside the vault, deletes its vault copy even on failure, and prints one JSON line with drawing, png, width, height, bytes. View the PNG, fix defects, rerun. The plugin documents its own CLI: obsidian vault=<name> obsidian-excalidraw-plugin:skill and :schema action=<create|export|apply|read>.
- Probe.
obsidian vault=<name> obsidian-excalidraw-plugin:statusandschema action=<cmd>. If the plugin or CLI is absent, make a new drawing withdraw.py, the only offline writer; never install or enable a plugin to make a drawing work. Editing an existing drawing without the app is an unmet prerequisite: report it, write nothing. - Palette. Take colours from the palette the user or the vault's policy names, else from the running app's theme, else the built-in palette; the design reference's Palette section maps them. Report which source the drawing used.
- Create. Native
createwith a newpath: skeleton elements, Lucideicons, frames, sticky notes, arrows bound bystart/end. It never overwrites. Choose coordinates from the pattern; the reply'sdata.idMapholds the real ids. - Edit. Fix in place, never delete and recreate:
open,read source=livefor therevision, thenapplywithexpectedRevision. A stale revision changes nothing; re-read and rebuild. - Export and look.
scripts/export.pywrites the image outside the vault; view it. Fix every defect listed in the design reference's render loop (an arrow over or touching a non-endpoint box or frame title counts), re-export, repeat until you would show it unqualified. An export that was not looked at is not render QA. - Clean up. Close tabs you opened;
export.pyleaves no export in the vault. - Save.
:applysaves itself; any other live edit reaches disk only viapython3 scripts/save.py <drawing> --vault <name>. Afterdraw.pywrites a file run it with--open; beforedraw.pyrewrites an open drawing run it with--close(saves first, closes only if saved and clean). An existing drawing may hold the owner's hand edits: change it with:apply, and usedraw.py --replaceonly on new drawings or ones it accepts as unedited (--forceoverrides, never by default).
Offline, or for a plain boxes-and-arrows graph, scripts/draw.py (usage above) lays out and writes the file. It writes a new file and prints one JSON line with path, sha256, elements, by_type, crossings, warnings. Non-empty warnings means look at the drawing. Unknown spec keys are ignored and named there. If it warns about crossings, do not rerun hoping for better: draw by hand through native create with chosen coordinates and a pattern from the design reference. --replace redoes only this script's own output; any other existing file is refused. With no output path it writes nothing and prints the scene colours (ink, background, palette as [fill, stroke]) to use in native create.
- Top level:
direction(LR,TB),title,frames[{id,label}],nodes,edges,palette{name: "#rrggbb"}or{name: [fill, stroke]},ink,background,dark(truewhen the colours were read from a dark theme). - Node:
id,label(required),shape(rectangle,ellipse,diamond,text,note),color(blue,green,yellow,red,purple,gray,note, or apalettename),frame,group,link,icon(URL),roughness0/1/2,strokeStylesolid/dashed/dotted. - Edge:
from,to(required),label,dashed,head(arrow,triangle,bar,dot,none).
node scripts/inspect.mjs lint <file> checks a plain file's ids, two-way bindings and overlaps; it refuses compressed-json, which the plugin writes once a drawing has been opened.
What the CLI cannot do (elbow arrows, Mermaid-to-elements, embedded notes and pages, frontmatter keys) goes through a trusted EA script, as excalidraw-plugin.md describes, only in a disposable or approved vault. obsidian eval is synchronous: start an async call that stores its result on window, then read it in a second call. Opening a drawing makes the plugin re-save it compressed, so never hand-edit the compressed block.
Give every node that names a recognizable thing its image beside the label, unasked: a product, app, service or company gets its official logo or app icon, a public figure a public photo, a character its official art; a private person gets only an image already in the vault. Look first for a PNG on the thing's own site (apple-touch-icon.png, icon.png) or its GitHub organization avatar (https://github.com/<org>.png); keep a URL only after fetching it shows an image of that exact thing, never its maker's personal avatar or an unrelated favicon. When none is found, leave the node without one and list it as skipped with the reason; never draw a stand-in.
Give every node that stands for a source the reader can open (an article, a video, a repository, a documentation page) that source's own preview image and a link to it, unasked: the picture makes the source recognizable at a glance and the link turns the drawing into a way back to the evidence. python3 scripts/thumbnail.py <url>... prints the preview image each page declares; a page that declares none, or whose preview fails to decode at export, stays text with its link. A video or page worth watching or reading in place goes in as a web embed in a closing section of its own, since an embed plays only inside Obsidian and exports as an empty frame.
python3 scripts/place.py <vault-relative drawing> <items.json|-> --vault <name>place.py puts images and web embeds on an existing drawing by URL, each with its link; excalidraw-plugin.md has the item fields. Save with save.py afterwards.
Images: an external image (logo, icon, web screenshot) stays a URL in the drawing's Embedded Files (icon in the spec); never download it into the vault, and tell the user it loads from a third party on first open. To check layout without the network use export.py --placeholder-images, otherwise a live export. If export fails with ASSETS_UNAVAILABLE on remote images (seen with SVG logos from cdn.simpleicons.org), do not retry or download them: rerun export.py --placeholder-images to check layout and tell the user to confirm the logos by opening the drawing in Obsidian. Only images already in the vault are referenced as vault files.
A note shows a drawing by embedding the drawing itself (![[name.excalidraw]]). Leave no exported image in the vault unless the user asks for one: a copy goes stale on the next edit.
Pele
A diagram inside a note is a mermaid fence. Pele draws it, so correct syntax is the work and a probe only confirms it. Obsidian 1.15.0+ only; earlier apps are out of scope.
- Probe commands and the
loadMermaidstep are inreferences/pele.md. - When a block fails, check the "Syntax pitfalls" section of that file;
references/pele-catalog.mdhas copy-ready blocks for the rest.
Extras (the excalidraw-extras companion plugin) adds two things to a drawing: Mermaid converted to editable elements, when the user wants to hand-edit a Mermaid diagram, and LaTeX for math. Otherwise use a Pele fence. Its absence is normal; install it only when asked. Details are in excalidraw-plugin.md; pele.md does not own them.
Evidence ladder
Report the highest level actually reached; a lower one never stands in for a higher one.
| Level | Proves | Produced by |
|---|---|---|
| A static | Structure is sound: unique ids, mirrored bindings, finite geometry, grammar by the rules | inspect.mjs lint, draw.py's own readback, the schema, reading the source |
| B readback | The intended bytes are at the intended path and parse | read source=disk, re-reading the file after the write; the write alone is not B |
| C runtime load | The running app loaded it and counts match | CLI read, getSceneFromFile, pele.render |
| D rendered | The picture is legible and was looked at | native export viewed, a preview tab inspected |
"Written and read back" is a complete result at B; "renders correctly" is not.
Native procedure
For any change to an existing drawing, Canvas or note:
- Resolve the exact path and the effect the task authorized; with no target path, stay read-only.
- Read its current bytes (
read, or the file) and keep therevision. applyonly the selected ids, so unrelated elements, frontmatter and prose stay as they were.- Use the least destructive surface that does it:
applyover recreate,createfor a new path, never an overwrite. - Read back the persisted result, not the live scene.
- Report the level reached, plugin and app versions, and anything unmet.
- Leave a runtime fact unknown when neither the docs nor the installed version settles it.
Done when
- The form matches the table and the reason is stated.
- Every claim traces to evidence; every
fileand wikilink target resolves. - A drawing was exported and looked at (D), or the report names the level it stopped at.
- Every product and person node has its image or is listed as skipped with the reason; every source node has its link, and its preview image when one is usable; no sentence sits in the drawing that the note could carry.