Logo : Tldraw Skill

Tldraw Skill

Communauté
Agents365-ai
tldraw-skill

À utiliser lorsque l’utilisateur demande des diagrammes, des organigrammes, des schémas d’architecture ou des visualisations. À utiliser également de manière proactive pour expliquer des systèmes comportant au moins 3 composants, des flux de données complexes ou des relations qui gagneraient à être représentés visuellement. Génère des fichiers JSON .tldr et les exporte localement au format PNG/SVG à l’aide de @kitschpatrol/tldraw-cli.

Add to TypingMind

Présentation

ÉditeurAgents365-ai
Dépôt365-skills
Nom de la compétencetldraw-skill
Étoiles
99
Forks
16
Fichiers inclus
Instructions uniquement
LicenceMIT
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Tout dans les instructions

    Tout ce dont le modèle a besoin se trouve dans les instructions : aucun fichier supplémentaire à synchroniser.

  • Open source

    Publiée par Agents365-ai sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Tldraw Skill dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/Agents365-ai/365-skills/tree/main/plugins/tldraw/skills/tldraw-skill
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Agents365-ai/365-skills.git /tmp/365-skills
mkdir -p .claude/skills
cp -r /tmp/365-skills/plugins/tldraw/skills/tldraw-skill .claude/skills/tldraw-skill
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Tldraw Skill dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Tldraw Skill dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Tldraw Skill n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

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

bash
# 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:

bash
# 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

json
{
  "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

json
{
  "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

json
{
  "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.

json
{
  "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.

json
{
  "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

bash
# 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

Foire aux questions

À quoi sert la compétence IA Tldraw Skill ?

À utiliser lorsque l’utilisateur demande des diagrammes, des organigrammes, des schémas d’architecture ou des visualisations. À utiliser également de manière proactive pour expliquer des systèmes comportant au moins 3 composants, des flux de données complexes ou des relations qui gagneraient à être représentés visuellement. Génère des fichiers JSON .tldr et les exporte localement au format PNG/SVG à l’aide de @kitschpatrol/tldraw-cli.

Pourquoi utiliser Tldraw Skill sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Tldraw Skill se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Tldraw Skill dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/Agents365-ai/365-skills/tree/main/plugins/tldraw/skills/tldraw-skill. TypingMind lit le fichier SKILL.md et l’installe sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Tldraw Skill ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Tldraw Skill ?

Autant que vous le souhaitez. Vous pouvez utiliser Tldraw Skill avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Tldraw Skill est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par Agents365-ai sous licence MIT. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇