PluginBench
Skill
Fail
Audit score 45

tldraw-skill

agents365-ai/365-skills

How to install tldraw-skill

npx skills add https://github.com/agents365-ai/365-skills --skill tldraw-skill
Claude Code
Cursor
Windsurf
Cline
Full instructions (SKILL.md)

Source of truth, from agents365-ai/365-skills.


name: tldraw-skill description: Use when user requests diagrams, flowcharts, architecture charts, or visualizations. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Generates .tldr JSON files and exports to PNG/SVG locally using @kitschpatrol/tldraw-cli. license: MIT homepage: https://github.com/Agents365-ai/tldraw-skill compatibility: Requires Node.js + @kitschpatrol/tldraw-cli on PATH (macOS/Linux/Windows). Self-check step requires a vision-enabled model (e.g., Claude Sonnet/Opus); gracefully skipped if unavailable. platforms: [macos, linux, windows] metadata: {"openclaw":{"requires":{"bins":["tldraw"]},"emoji":"πŸ“","os":["darwin","linux","win32"],"install":[{"id":"npm-tldraw","kind":"npm","package":"@kitschpatrol/tldraw-cli","global":true,"bins":["tldraw"],"label":"Install tldraw-cli via npm"}]},"hermes":{"tags":["tldraw","diagram","flowchart","architecture","whiteboard","visualization"],"category":"design","requires_tools":["tldraw"],"related_skills":["drawio","mermaid","excalidraw","plantuml"]},"author":"Agents365-ai","version":"1.2.1"}

tldraw Whiteboard Diagrams

Overview

Generate modern whiteboard-style diagrams as .tldr JSON files and export to PNG/SVG using @kitschpatrol/tldraw-cli. tldraw produces clean hand-drawn aesthetic diagrams with rich shape libraries and smooth arrow routing β€” well-suited for casual or whiteboard-style visualizations.

Format: .tldr JSON Export: PNG, SVG (via @kitschpatrol/tldraw-cli) Aesthetic: Hand-drawn whiteboard style by default; switchable to clean fonts via font prop.

When to Use

Explicit triggers: user says "diagram", "flowchart", "draw", "visualize", "whiteboard diagram", "tldraw diagram", "architecture diagram", "sketch this out".

Proactive triggers:

  • Explaining a system with 3+ interacting components
  • Describing a multi-step process, data flow, or pipeline
  • Showing relationships between services/modules
  • Architecture overviews, sequence flows, decision trees, ML model layers

Skip when: a simple list or table suffices, the user wants a polished business-presentation diagram (prefer drawio-skill), or the user is in a quick Q&A flow.

When NOT to use it β€” route elsewhere:

  • Logos / solid-color graphics / filled icons: tldraw has no opaque fill (solid = light tint; white-on-dark can't be reproduced) β†’ use the drawio skill or the original vector file.
  • Precise vector geometry or strict (hollow-arrow) UML β†’ drawio (or plantuml for UML).
  • Auto-layout of many nodes β†’ mermaid (tldraw needs manual coordinates).
  • A pixel-faithful copy of an existing image β†’ not a diagram-skill task.

Prerequisites

# Install tldraw-cli
npm install -g @kitschpatrol/tldraw-cli

# Verify
tldraw --version

Works identically on macOS, Windows, and Linux.

First-export note: tldraw export renders through a pinned Chrome build via puppeteer. The first export can fail with Could not find Chrome (ver. <x>). The error names the exact version it needs β€” install it once, then exports work:

# The error message names the version; substitute it here
npx puppeteer browsers install chrome@<version-from-error>

(Installs to ~/.cache/puppeteer; only needed once per CLI version.)

Workflow

Before starting, assess whether the user's request is specific enough. If key details are missing, ask 1-3 focused questions:

  • Diagram type β€” which preset? (Architecture, Flowchart, Sequence, ML/DL, ERD, UML, or general)
  • Output format β€” PNG (default), SVG?
  • Output location β€” default is the user's working dir; honor any explicit path the user gives (e.g. "put it in ./artifacts/"). Don't ask if they didn't mention one.
  • Scope/fidelity β€” how many components? Any specific technologies or labels?

Skip clarification if the request already specifies these details or is clearly simple (e.g., "draw a flowchart of X").

  1. Check deps β€” verify tldraw --version succeeds; if missing, run npm install -g @kitschpatrol/tldraw-cli.
  2. Plan β€” identify shapes (geo type per node), connections (arrows with source/target), and layout (TB or LR, group by tier/role). Sketch a coordinate grid before writing JSON.
  3. Generate β€” write the .tldr JSON file. Default output dir is the user's working dir; if the user specified a path or directory (e.g. ./artifacts/), mkdir -p it first and write there. Apply the same dir choice to PNG/SVG exports in steps 4 and 7.
  4. Export draft β€” run CLI to produce a PNG for preview.
  5. Self-check β€” use the agent's built-in vision capability to read the exported PNG, catch obvious issues, auto-fix before showing the user (requires a vision-enabled model such as Claude Sonnet/Opus). If vision is unavailable, skip this step.
  6. Review loop β€” show image to user, collect feedback, apply targeted JSON edits, re-export, repeat until approved.
  7. Final export β€” export the approved version to all requested formats; report file paths for both the .tldr source and exported image(s).

Step 5: Self-Check

After exporting the draft PNG, use the agent's vision capability (e.g., Claude's image input) to read the image and check for these issues before showing the user. If the agent does not support vision, skip self-check and show the PNG directly.

tldraw's own AI agent flags exactly three structural defects β€” text overflow (a box too small for its label), overlapping text, and friendless arrows (an arrow with an unbound end). The first three rows below target those; size boxes correctly up front (see "Sizing boxes to fit labels") and they rarely occur.

CheckWhat to look forAuto-fix action
Text overflowLabel spills past the shape's border, or the box looks taller than you set (tldraw auto-grows an undersized box)Increase w/h to fit the label β€” see the sizing formula below
Overlapping textTwo text-bearing shapes' labels touch or overlap, hurting legibilityShift shapes apart by β‰₯200px
Friendless arrowAn arrow with one end not connected to a shape (floats loose)Bind both ends: every arrow's start and end need a boundShapeId matching an existing shape
Off-canvas shapesShapes at negative coordinates or far from the main groupMove to positive coordinates near the cluster
Arrow-shape overlapAn arrow visually crosses through an unrelated shapeAdjust bend value or move endpoints to a different normalizedAnchor side
Stacked arrowsMultiple arrows overlap each other on the same pathDistribute normalizedAnchor across the shape perimeter (use different x/y values)
  • Max 2 self-check rounds β€” if issues remain after 2 fixes, show the user anyway.
  • Re-export after each fix and re-read the new PNG.

Step 6: Review Loop

After self-check, show the exported image and ask the user for feedback.

Targeted edit rules β€” for each type of feedback, apply the minimal JSON change:

User requestJSON edit action
Change color of XFind shape by props.text matching X, update props.color
Add a new nodeAppend a new shape record with next available index, position near related nodes
Remove a nodeDelete the shape record and any arrow records bound to it
Move shape XUpdate the shape's x/y fields
Resize shape XUpdate props.w/props.h
Add arrow from A to BAppend a new arrow record binding to A and B's shape ids
Change label textUpdate props.text on the matching shape or arrow
Change layout directionFull regeneration β€” replan the grid and rebuild

Rules:

  • For single-element changes: edit the existing JSON in place β€” preserves layout tuning from prior iterations.
  • For layout-wide changes (e.g., swap LR↔TB, "start over"): regenerate full JSON.
  • Overwrite the same {name}.png each iteration β€” do not create v1, v2, v3 files.
  • After applying edits, re-export and show the updated image.
  • Loop continues until user says approved / done / LGTM.
  • Safety valve: after 5 iteration rounds, suggest the user open the .tldr file in tldraw.com or the desktop app for fine-grained adjustments.

File Format

Complete .tldr Skeleton

{
  "tldrawFileFormatVersion": 1,
  "schema": {
    "schemaVersion": 1,
    "storeVersion": 4,
    "recordVersions": {
      "asset": {"version": 1, "subTypeKey": "type", "subTypeVersions": {"image": 2, "video": 2, "bookmark": 0}},
      "camera": {"version": 1},
      "document": {"version": 2},
      "instance": {"version": 17},
      "instance_page_state": {"version": 3},
      "page": {"version": 1},
      "shape": {"version": 3, "subTypeKey": "type", "subTypeVersions": {"group": 0, "embed": 4, "bookmark": 1, "image": 2, "text": 1, "draw": 1, "geo": 7, "line": 0, "note": 4, "frame": 0, "arrow": 1, "highlight": 0, "video": 1}},
      "instance_presence": {"version": 4},
      "pointer": {"version": 1}
    }
  },
  "records": [
    {"id": "document:document", "typeName": "document", "gridSize": 10, "name": "", "meta": {}},
    {"id": "page:page1", "typeName": "page", "name": "Page 1", "index": "a1", "meta": {}}
    /* shapes and arrows go here */
  ]
}

Critical rules:

  • document:document and page:page1 records are ALWAYS required.
  • All shapes go in the records array after the page record.
  • All shapes have "parentId": "page:page1".
  • Shape IDs use format "shape:xxx" with unique suffix (e.g., "shape:s1", "shape:a1").
  • index values are fractional-index keys. Use "a" + one base-62 character, in order: "a0"–"a9", then "aA"–"aZ", then "aa"–"az" (62 ordered keys β€” enough for any normal diagram).
  • Do not append a second character: "a10" is invalid. And never use a leading "b"/"c" ("b1", "c1", "b0") β€” those encode a longer integer part, so they are malformed fractional keys and trigger invalidRecords. Stick to the single-character "a*" keys above.

Geo Shape Record

{
  "id": "shape:s1",
  "typeName": "shape",
  "type": "geo",
  "parentId": "page:page1",
  "index": "a1",
  "x": 100,
  "y": 100,
  "rotation": 0,
  "isLocked": false,
  "opacity": 1,
  "meta": {},
  "props": {
    "w": 180,
    "h": 60,
    "geo": "rectangle",
    "color": "blue",
    "labelColor": "black",
    "fill": "semi",
    "dash": "draw",
    "size": "m",
    "font": "draw",
    "text": "API Gateway",
    "align": "middle",
    "verticalAlign": "middle",
    "growY": 0,
    "url": ""
  }
}

Geo Types

geo valueUse for
rectangleservices, modules, components
ellipsedatabases, start/end nodes
ovalpill-shaped start/end terminators (flowcharts)
diamonddecision points
cloudexternal services, infrastructure
hexagonevent hubs, message buses
trianglegateways, load balancers
starhighlights, key features
pentagonstages, milestones
octagonstop / terminal / blocking states
trapezoidmanual operations, transforms
rhombus / rhombus-2parallelograms β€” I/O steps (left/right slant)
arrow-right / arrow-left / arrow-up / arrow-downdirectional flow blocks, data movement
x-boxfailed / invalid / rejected states (box with βœ•)
check-boxpassed / validated / done states (box with βœ“)
heartaccents (rarely needed for technical diagrams)

All 20 geo values are valid; the above are the useful subset for technical diagrams.

Color Palette

colorUse for
blueclients, core services
greensuccess, databases, storage
orangequeues, event buses, warnings
redexternal APIs, errors, alerts
light-redsoft alerts, secondary warnings
violetgateways, security, auth
yellowdecisions, caches
greyneutral, background, legacy
light-bluesecondary services, metadata
light-violetsoft auth/security, secondary gateways
light-greensoft success, secondary storage
whiteblank/empty nodes, placeholders (pair with fill: solid)
blacktitles, emphasis

Full palette (13): black, grey, light-violet, violet, blue, light-blue, yellow, orange, green, light-green, light-red, red, white.

Style Options

PropertyValuesNotes
fillsemi, solid, none, patternsemi = tinted fill (recommended)
dashdraw, solid, dashed, dotteddraw = hand-drawn default
sizes, m, l, xlm = default
fontdraw, sans, serif, monodraw = default whiteboard style

Arrow Record

{
  "id": "shape:a1",
  "typeName": "shape",
  "type": "arrow",
  "parentId": "page:page1",
  "index": "aG",
  "x": 0,
  "y": 0,
  "rotation": 0,
  "isLocked": false,
  "opacity": 1,
  "meta": {},
  "props": {
    "dash": "draw",
    "size": "m",
    "fill": "none",
    "color": "black",
    "labelColor": "black",
    "bend": 0,
    "start": {
      "type": "binding",
      "boundShapeId": "shape:s1",
      "normalizedAnchor": {"x": 0.5, "y": 1},
      "isExact": false
    },
    "end": {
      "type": "binding",
      "boundShapeId": "shape:s2",
      "normalizedAnchor": {"x": 0.5, "y": 0},
      "isExact": false
    },
    "arrowheadStart": "none",
    "arrowheadEnd": "arrow",
    "text": "",
    "font": "draw"
  }
}

Arrow Connection Rules

  • Arrow record x and y are always 0, 0.
  • Use "type": "binding" with boundShapeId to connect to a specific shape.
  • normalizedAnchor specifies WHERE on the target shape the arrow connects (0–1 range):
    • {x: 0.5, y: 0} = top center
    • {x: 0.5, y: 1} = bottom center
    • {x: 0, y: 0.5} = left center
    • {x: 1, y: 0.5} = right center
    • {x: 0.5, y: 0.5} = center
  • Add "text": "label" in arrow props for labeled connections.
  • Use "bend": 20 (or -20) for slight curves to avoid overlap with other arrows.
  • For dashed/dotted arrows (e.g., async flows, optional links), set "dash": "dashed" or "dotted".
  • Set "spline": "cubic" for a smooth curved arrow (default "line" is straight/elbow). Useful for skip connections and back-edges.

Arrowheads

arrowheadStart and arrowheadEnd each accept any of these 9 values (all render in @kitschpatrol/tldraw-cli):

ValueLooks likeUse for
none(no head)start of a one-way arrow
arrowopen Vdefault flow direction
trianglefilled β–ΆUML inheritance / "is-a"
diamondfilled β—†UML composition / aggregation (on the owner end)
dot●sequence-diagram message endpoints
squareβ– terminal / fixed endpoint
bar|"stop" / boundary marker
pipe||alternative boundary marker
invertedhollow Vde-emphasized direction

Default arrows use "arrowheadStart": "none", "arrowheadEnd": "arrow". For bidirectional links set both ends to "arrow".

Distributing Arrows on a Shape

When multiple arrows connect to the same shape, assign different normalizedAnchor points to prevent stacking:

PositionxyUse when
Top center0.50connecting to node above
Top-left0.2502nd connection from top
Top-right0.7503rd connection from top
Right center10.5connecting to node on right
Bottom center0.51connecting to node below
Left center00.5connecting to node on left

Rule: if a shape has N connections on one side, space them evenly (e.g., 3 connections on bottom β†’ x = 0.25, 0.5, 0.75).

Multiple Arrows Between the Same Two Nodes

The anchor-distribution rule above spreads arrows going to different nodes. When N arrows connect the same pair (e.g., bidirectional request/response, or several relationships A↔B), anchors can't separate them β€” instead spread the bend values symmetrically so the arrows fan out into distinct arcs:

  • Pick a max bend amount (β‰ˆ 30–60; larger for nodes that are far apart).
  • Assign the N arrows bends evenly spaced from βˆ’amount to +amount:
    • 2 arrows β†’ bend: -amount, bend: +amount
    • 3 arrows β†’ bend: -amount, 0, +amount
    • General: bend[i] = -amount + i * (2*amount / (N-1)) for i = 0..N-1
  • A straight arrow plus a single curved one (bend: 0 and bend: 40) reads cleanly for a request/response pair.

Container & Annotation Shapes

Beyond geo and arrow, two more shape types are useful for technical diagrams.

Frame (labeled container β€” tiers, subsystems, swimlanes)

A frame is a native rectangular container with a title. Use it to group a tier or subsystem with a visible boundary; stack several frames to approximate swimlanes.

{
  "id": "shape:frame1", "typeName": "shape", "type": "frame",
  "parentId": "page:page1", "index": "a1",
  "x": 60, "y": 60, "rotation": 0, "isLocked": false, "opacity": 1, "meta": {},
  "props": { "w": 360, "h": 220, "name": "Backend Tier", "color": "black" }
}
  • props.name is the title shown at the frame's top-left.
  • Child shapes set "parentId": "shape:frame1" (not page:page1), and their x/y are relative to the frame's top-left corner, not the page. A child at x: 40, y: 60 sits 40px in and 60px down from the frame's origin.
  • Frames render as a clean (non-hand-drawn) rectangle β€” good for structural grouping. Arrows can still bind across frames normally.

Note (sticky-note annotation / callout)

A note is a sticky note β€” ideal for TODOs, callouts, and comments layered onto a diagram.

{
  "id": "shape:n1", "typeName": "shape", "type": "note",
  "parentId": "page:page1", "index": "a4",
  "x": 480, "y": 80, "rotation": 0, "isLocked": false, "opacity": 1, "meta": {},
  "props": { "color": "yellow", "size": "m", "text": "TODO: add retry\nlogic here",
    "font": "draw", "align": "middle", "verticalAlign": "middle",
    "growY": 0, "fontSizeAdjustment": 0, "url": "", "scale": 1, "labelColor": "black" }
}
  • A note has no w/h β€” it's a fixed square (~200px) that auto-grows for longer text. Don't add w/h.
  • yellow is the classic sticky color; any palette color works.
  • Use notes sparingly β€” for annotations about the diagram, not as primary nodes (use geo for those).

Index Ordering Rules

Indices control z-order (stacking). Use this sequence:

a1, a2, a3, a4, a5, a6, a7, a8, a9,
aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM,
aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ,
aa, ab, ac, ... az          ← continue here past aZ; never "a10"
  • Geo shapes first: a1 through aF (or as many as needed).
  • Arrow shapes after: aG, aH, etc.
  • Every shape must have a unique index.

Layout Tips

Spacing β€” scale with complexity:

Diagram complexityNodesHorizontal gapVertical gap
Simple≀5200px150px
Medium6–10280px200px
Complex>10350px250px

Sizing boxes to fit labels (do this up front, not in self-check): the draw font is wide. Compute w/h from the label so text never clips. Approximate per-character width and line height for the default draw font:

sizechar width (px)line height (px)
s1118
m (default)1528
l2240
xl3256

With padding = 16 on each side:

  • w = ceil(longest_line_chars * char_width + 2*padding), then round up to the next multiple of 10.
  • h = ceil(num_lines * line_height + 2*padding), rounded up to a multiple of 10.

Example: a size-m box labeled "API Gateway" (11 chars, 1 line) β†’ w β‰ˆ 11*15 + 32 = 197 β†’ 200, h β‰ˆ 28 + 32 = 60. Multi-line labels (with \n) count the longest line for w and the line count for h. Err slightly large β€” extra padding looks fine, a too-narrow box hard-wraps a word mid-letters.

Why this matters: if a box is too short for its text, tldraw silently grows it taller on render (it sets the shape's growY) β€” so the box ends up bigger than the h you wrote and collides with whatever you placed below it. Sizing correctly up front keeps growY at 0 and your layout intact. This is the single most common cause of "the diagram looks cramped / boxes overlap" after export.

Routing corridors: between shape rows/columns, leave an extra ~80px empty corridor where arrows can route without crossing other shapes. Never place a shape in a gap that arrows need to traverse.

Grid alignment: snap all x, y, w, h values to multiples of 10 β€” this matches tldraw's default gridSize: 10 and makes manual editing easier.

General rules:

  • Plan the grid before assigning x/y coordinates β€” sketch node positions mentally first.
  • Group related nodes in the same horizontal or vertical band.
  • Place heavily-connected "hub" nodes centrally so arrows radiate outward instead of crossing.
  • For wide shapes (like an API Gateway spanning multiple downstream services), set w to cover the full span.
  • Center-align a child node under its parent (same center x) to avoid diagonal routing.
  • Event bus pattern: place the bus (hexagon) in the center of the service row, not below β€” services on either side reach it with short horizontal arrows (normalizedAnchor.x = 1 left side, 0 right side), eliminating crossings.
  • Horizontal connections never cross vertical nodes in the same row; use them for peer-to-peer and publish connections.

Avoiding arrow-shape overlap:

  • Before finalizing coordinates, trace each arrow path mentally β€” if it must cross an unrelated shape, either move the shape or use bend to curve around.
  • For tree/hierarchical layouts: assign nodes to layers (rows), connect only between adjacent layers to minimize crossings.
  • For star/hub layouts: place the hub center, satellites around it β€” arrows stay short and radial.

Diagram Type Presets

When the user requests a specific diagram type, apply the matching preset below for shapes, colors, and layout conventions.

Architecture Diagram

ElementgeocolorNotes
Client (web/mobile)rectangleblueTop row, label by client type
Service / modulerectangleblueMid rows, group by tier
DatabaseellipsegreenBottom row, one per service
CacheellipseyellowSits beside its owning service
Queue / event bushexagonorangeCenter of service row for hub pattern
Gateway / load balancertrianglevioletAbove services
External APIcloudredEdge of canvas, dashed arrows in
Auth / securityrectanglevioletOften near gateway

Layout: TB or LR by tier count; β‰₯4 tiers β†’ TB. Hub nodes centered. Spacing scales with complexity (see table above).

Flowchart

ElementgeocolorNotes
Start / EndellipsegreenAlways at top and bottom
Process steprectangleblueDefault action box
DecisiondiamondyellowAlways label outgoing arrows (Yes / No)
I/Orectangle (with dash: dashed)orangeDistinguish from process via dashed border
SubprocessrectanglevioletIndicates a callable sub-flow

Layout: TB, ~200px vertical gap. Decisions branch left/right, then merge back to center. Always label decision branches in the arrow's props.text.

Sequence Diagram

tldraw doesn't have native lifeline shapes. Approximate with:

ElementgeocolorNotes
Actor / object headerrectangleblueTop of column
Lifelinerectangle (w: 2, fill: solid, color: grey)greyThin vertical line under each actor header
Sync messagearrow with arrowheadEnd: arrowblackSolid horizontal arrow
Async messagearrow with dash: dashedblackDashed horizontal arrow
Return messagearrow with dash: dashed, color: greygreyGrey dashed

Layout: LR for actors (200–280px apart), TB for time. Each message is a horizontal arrow between two lifelines at increasing y.

ML / Deep Learning Model Diagram

For neural network architecture diagrams β€” useful for paper figures and explainers.

ElementgeocolorNotes
Input / OutputrectanglegreenTop and bottom of stack
Conv / PoolingrectangleblueStandard layer block
Attention / TransformerrectanglevioletDistinct color for self-attention blocks
RNN / LSTM / GRUrectangleyellowRecurrent layers
FC / LinearrectangleorangeDense projection layers
Loss / ActivationrectangleredFinal loss / softmax / activation
Skip connectionarrow with bend: 30, dash: dashedgreyCurved dashed bypass

Tensor shape annotation: include the dimensions in props.text on a second line. tldraw renders \n literally inside JSON strings, so use a real newline (the JSON encoder will write \n):

"text": "Conv2D\n(B, 64, 32, 32)"

Layout: TB (data flows top β†’ bottom), layers ~150px apart. Skip connections curve around the main stack.

ER Diagram (ERD)

tldraw lacks native table/row shapes. Approximate each entity as a tall rectangle with multi-line text.

ElementgeocolorNotes
Entityrectangle (fill: solid, color: light-blue)light-blueTitle + columns as one multi-line text label
Column listembedded in props.text with \n between rowsβ€”Mark PK with * prefix, FK with >
Relationshiparrow with arrowheadStart: arrow, arrowheadEnd: arrowblackBoth ends arrowed for many-to-many
Optional / weak relationshiparrow with dash: dashedgreyDashed for optional FK

Label the arrow with cardinality (e.g., 1..*, 0..1) via props.text.

Layout: TB or grid; entities spaced β‰₯300px apart to leave room for column lists.

UML Class Diagram

ElementgeocolorNotes
Classrectangle (fill: solid, color: light-blue)light-blueTitle + attributes + methods as one multi-line text
Inheritancearrow with arrowheadEnd: triangleblacktldraw renders a filled triangle arrowhead β€” point it at the parent class
Compositionarrow with arrowheadStart: diamond, arrowheadEnd: noneblacktldraw renders a filled diamond head β€” put it on the owner (whole) end
Aggregationarrow with arrowheadStart: diamondblackSame diamond head; distinguish from composition via a label or note
Associationarrow with arrowheadEnd: arrowblackStandard arrow

Note: tldraw's triangle/diamond arrowheads are filled, whereas strict UML uses hollow triangles (inheritance) and either filled/hollow diamonds (composition/aggregation). The shapes read correctly for sketches and explainers; for publication-grade UML with hollow heads, drawio-skill (separate skill) is a better fit.

Layout: TB, classes ~250px apart, interfaces above implementations.


Export Commands

# Check CLI version
tldraw --version

# PNG at 2x scale (recommended) β€” outputs diagram.png in ./
tldraw export diagram.tldr -f png --scale 2 -o ./

# SVG β€” outputs diagram.svg in ./
tldraw export diagram.tldr -f svg -o ./

# Transparent background
tldraw export diagram.tldr -f png --scale 2 --transparent -o ./

# Dark theme
tldraw export diagram.tldr -f png --scale 2 --dark -o ./

# Custom output directory (e.g. CI artifacts dir) β€” create if missing, then export there
mkdir -p ./artifacts && tldraw export diagram.tldr -f png --scale 2 -o ./artifacts/

Note: -o is an output directory, not a file path. The output file is named after the input file (diagram.tldr β†’ diagram.png).

Auto-launch after export

Offer to open the .tldr file in the user's default tldraw viewer/editor:

OSCommand
macOSopen diagram.tldr
Linuxxdg-open diagram.tldr
Windowsstart diagram.tldr

Or upload to https://tldraw.com (drag-and-drop the .tldr file) for browser editing.


Common Mistakes

MistakeFix
tldraw command not foundRun npm install -g @kitschpatrol/tldraw-cli
Could not find Chrome (ver. X) on exportInstall the pinned build: npx puppeteer browsers install chrome@X (use the exact version from the error)
invalidRecords on exportUse single-character a keys (a1…a9, aA…aZ, aa…az); a10, b1, c1 are malformed fractional-index keys
Blank/empty exportVerify document:document and page:page1 records are present
Output file not found-o is a directory; file name matches input: tldraw export foo.tldr -o ./ β†’ ./foo.png
Arrow doesn't appearUse "type": "binding" with boundShapeId; set arrow x/y to 0,0
Shapes overlapPlan a 200px+ grid before assigning x/y; scale spacing with complexity
Box taller than expected / collides belowLabel overflowed an undersized box, so tldraw auto-grew it (growY). Size w/h to the label up front using the sizing formula
Text not visibleCheck props.text is set; if fill: "none", ensure text color contrasts
Index collisionAll shapes must have unique index values
Shape ID clashUse unique IDs: "shape:s1", "shape:s2", "shape:a1", etc.
Export failsEnsure the .tldr file is valid JSON: python3 -m json.tool file.tldr > /dev/null
Multi-line labelUse a real newline character inside the JSON string ("text": "Line1\nLine2"); tldraw respects \n
Arrow crosses shapeUse bend to curve around, or move endpoint to a different normalizedAnchor
Iteration loop never endsAfter 5 rounds, suggest the user open .tldr in tldraw.com for fine-tuning

Fallback Chain

When tools are unavailable, degrade gracefully:

ScenarioBehavior
tldraw-cli missingGenerate .tldr JSON only; instruct user to drag-and-drop into https://tldraw.com or install the CLI
Vision unavailable for self-checkSkip self-check (step 5); proceed directly to showing user the exported PNG
Export failsValidate JSON with python3 -m json.tool; deliver the .tldr file and suggest opening in tldraw.com

Related skills

More from agents365-ai/365-skills and the wider catalog.

DR

drawio-skill

agents365-ai/365-skills

Use when the user requests diagrams, flowcharts, architecture diagrams, ER diagrams, UML / sequence / class diagrams, network topology, ML/DL model figures (Transformer/CNN/LSTM), mind maps, or any visualization. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Best suited when the diagram needs custom styling, rich shape vocabulary, swimlanes, or exportable images (PNG/SVG/PDF/JPG). Generates .drawio XML and exports locally via the native draw.io desktop CLI.

3.7k installsAudited
CR

creating-mermaid-diagrams

agents365-ai/365-skills

Generate Mermaid diagrams (.mmd) and export to PNG/SVG/PDF using mmdc CLI or Kroki API. USE THIS SKILL when user mentions diagram, flowchart, sequence diagram, class diagram, ER diagram, state machine, architecture, visualize, git graph, η”»ε›Ύ, ζžΆζž„ε›Ύ, 桁程图, 既序图. PROACTIVELY USE when explaining ANY system with 3+ components, API flows, authentication sequences, class hierarchies, database schemas, or state machines. Supports 11+ diagram types with fully automatic layout.

1.9k installsAudited
EX

excalidraw

agents365-ai/365-skills

Use when user requests diagrams, flowcharts, architecture charts, or visualizations. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Generates .excalidraw files and exports to PNG/SVG via Kroki API or locally using excalidraw-brute-export-cli.

1.8k installs
PL

plantuml-skill

agents365-ai/365-skills

Use when user requests diagrams, flowcharts, sequence diagrams, class diagrams, component diagrams, ER diagrams, architecture charts, or visualizations β€” including generating a diagram from existing source code, or rendering/extracting PlantUML embedded in a Markdown file to images (e.g. preparing docs for Confluence/Notion). Also use proactively when explaining systems with 3+ components, APIs, data flows, or class hierarchies. Generates .puml files and exports to PNG/SVG via Kroki API (no local install required).

1.6k installs
SE

semanticscholar-skill

agents365-ai/365-skills

Use when searching academic papers, looking up citations, finding authors, or getting paper recommendations using the Semantic Scholar API. Triggers on queries about research papers, academic search, citation analysis, or literature discovery.

1.4k installs
PA

paper-fetch

agents365-ai/365-skills

Use whenever the user wants to obtain, download, or fetch a paper's PDF β€” given a DOI, an arXiv id, a paper title, a citation, or a list of DOIs. Trigger on phrases like "download this paper", "find the PDF for [DOI]", "grab me the [Nature/bioRxiv/arXiv] paper on X", "get the open-access version", "I need this article", or any bulk/batch paper download request, even when the user doesn't explicitly say "PDF" or "DOI". Resolves via Unpaywall β†’ Semantic Scholar β†’ arXiv β†’ PubMed Central β†’ bioRxiv/medRxiv β†’ publisher direct (institutional opt-in) β†’ Sci-Hub mirrors as last-resort fallback.

1.3k installs