Tldraw Canvas Editor

Tldraw

by danielmiessler · MIT license · ★ 19,269 on GitHub · v1.0.1

Tldraw cover

Read, create, and edit tldraw .tldr canvas files deterministically — sketch hand-drawn-register diagrams (boxes, arrows, sticky notes, frames, text) directly into a canvas file the user opens in any tldraw surface, and read a rough…

---
name: Tldraw
version: 1.0.1
description: Read, create, and edit tldraw .tldr canvas files deterministically — sketch hand-drawn-register diagrams (boxes, arrows, sticky notes, frames, text) directly into a canvas file the user opens in any tldraw surface, and read a rough canvas back as structured data to organize it. USE WHEN tldraw, .tldr file, whiteboard, canvas, sketch a diagram, hand-drawn diagram, draw this on a canvas, put this on the whiteboard, structure my canvas, organize my whiteboard, read my canvas, cluster my sticky notes. NOT FOR polished static images, infographics, or mermaid diagrams (use Art), web UI design (use Webdesign), programmatic video (use Remotion).
---

# Tldraw

Deterministic read/write for tldraw canvases. The `.tldr` format is plain JSON (`{tldrawFileFormatVersion: 1, schema, records}`); `Tools/Tldr.ts` writes records that pass tldraw's own validator, so generated files open cleanly in the tldraw web editor, the VS Code tldraw extension, or the desktop app. Two directions: model → canvas (sketch diagrams) and canvas → model (read and structure a human's rough thinking).

## Customization

**Before executing, check for user customizations at:**
`~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Tldraw/`

If this directory exists, load and apply any PREFERENCES.md found there (default canvas directory, preferred colors/register, default open surface). If not, proceed with defaults.

## Voice Notification

Overview

Deterministic read/write for tldraw canvases. The .tldr format is plain JSON ({tldrawFileFormatVersion: 1, schema, records}); Tools/Tldr.ts writes records that pass tldraw's own validator, so generated files open cleanly in the tldraw web editor, the VS Code tldraw extension, or the desktop app. Two directions: model → canvas (sketch diagrams) and canvas → model (read and structure a human's rough thinking).

Manual install (npx, ZIP)
Claude Codenpx skills add danielmiessler/LifeOS --skill Tldraw -g -a claude-code
Claude Code (degit)npx degit danielmiessler/LifeOS/LifeOS/install/skills/Tldraw#main ~/.claude/skills/tldraw
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md5.5 KB
Read SKILL.md here
danielmiessler/main1 file shown
SKILL.md
Show the full text90 lines

Tldraw

Deterministic read/write for tldraw canvases. The .tldr format is plain JSON ({tldrawFileFormatVersion: 1, schema, records}); Tools/Tldr.ts writes records that pass tldraw's own validator, so generated files open cleanly in the tldraw web editor, the VS Code tldraw extension, or the desktop app. Two directions: model → canvas (sketch diagrams) and canvas → model (read and structure a human's rough thinking).

Customization

Before executing, check for user customizations at: ~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Tldraw/

If this directory exists, load and apply any PREFERENCES.md found there (default canvas directory, preferred colors/register, default open surface). If not, proceed with defaults.

Voice Notification

When executing a workflow, do BOTH:

  1. Send voice notification:

    curl -s -X POST http://localhost:31337/notify \
      -H "Content-Type: application/json" \
      -d '{"message": "Running WORKFLOWNAME in Tldraw"}' \
      > /dev/null 2>&1 &
    
  2. Output text notification:

    Running **WorkflowName** in **Tldraw**...
    

Workflow Routing

Workflow Trigger File
SketchDiagram "sketch a diagram", "draw this on a canvas", "tldraw diagram" Workflows/SketchDiagram.md
StructureCanvas "structure my canvas", "organize my whiteboard", "read my canvas" Workflows/StructureCanvas.md

Quick Reference

  • Tool: bun ~/.claude/skills/Tldraw/Tools/Tldr.ts <create|inspect|add|remove|move|settext|validate> <file.tldr> [flags]
  • Record shapes, spec format, coordinate conventions: References/TldrFormat.md
  • Vendored schema (tldraw 5.2.5): References/SchemaSnapshot.json

Examples

Example 1: Diagram for a post

User: "Sketch the three-stage pipeline as a hand-drawn diagram"
→ Invokes SketchDiagram workflow
→ Writes spec JSON, runs Tldr.ts create + add, validates
→ Returns the .tldr path and how to open it; user nudges shapes and exports

Example 2: Organize an ideation canvas

User: "I dumped ideas on my canvas — structure them"
→ Invokes StructureCanvas workflow
→ Tldr.ts inspect --json reads every shape's text and position
→ Clusters related items, adds frames + arrows, moves shapes into groups
→ User reopens the same file and sees the organized version

Gotchas

  • zsh echo mangles spec JSON — it expands \n inside strings into real newlines, breaking JSON. Write the spec to a file (or use printf '%s') and pass --spec <file>; the tool also accepts --spec - on stdin, but only feed it from something that doesn't reinterpret escapes.
  • Text is richText, never a plain string — labels on geo/text/note/arrow shapes are ProseMirror doc JSON ({"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"..."}]}]}). A bare string prop is rejected by tldraw's validator. Tldr.ts builds this for you; never hand-write a text prop.
  • Arrow bindings require terminal: "start"|"end" — tldraw's own ArrowBindingUtil.getDefaultProps() omits it, but the schema validator rejects a binding without it (verified against tldraw 5.2.5). The tool sets it; if you hand-edit bindings, keep it.
  • Raw records need every prop — records written to the file bypass editor defaulting, so a missing prop (e.g. growY on geo) fails validation on load. Always go through Tldr.ts add; don't append hand-rolled records.
  • Fractional index strings order shapes — index values (a1, a2, …) are base62 lexicographic and must never end in 0. The tool generates them; duplicates cause z-order glitches in the editor.
  • The desktop-app .tldraw format is a different thing — the tldraw desktop app's native save is a zip (sqlite + assets + scripts), not this JSON. This skill targets portable .tldr JSON, which the web editor, the VS Code extension, and the desktop app can all open/import.
  • Editors hold files in memory — if the user has the canvas open while you edit it on disk, their surface may not reload (or may overwrite your change on save). Edit while closed, or tell the user to reopen after your write.

Opening a canvas

  • VS Code / Cursor: the official tldraw extension opens .tldr files in-editor — fully local, right choice for private content.
  • tldraw.com: File → Open. Content goes to a third-party web app — only for content already public-destined.
  • Export to image: from any tldraw surface, select all → Export as SVG/PNG. (No headless export path ships with this skill.)

Execution Log

After completing any workflow, append a single JSONL entry:

echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"Tldraw","workflow":"WORKFLOW_USED","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' >> ~/.claude/LIFEOS/MEMORY/SKILLS/execution.jsonl
1---
2name: Tldraw
3version: 1.0.1
4description: Read, create, and edit tldraw .tldr canvas files deterministically — sketch hand-drawn-register diagrams (boxes, arrows, sticky notes, frames, text) directly into a canvas file the user opens in any tldraw surface, and read a rough canvas back as structured data to organize it. USE WHEN tldraw, .tldr file, whiteboard, canvas, sketch a diagram, hand-drawn diagram, draw this on a canvas, put this on the whiteboard, structure my canvas, organize my whiteboard, read my canvas, cluster my sticky notes. NOT FOR polished static images, infographics, or mermaid diagrams (use Art), web UI design (use Webdesign), programmatic video (use Remotion).
5---
6 
7# Tldraw
8 
9Deterministic read/write for tldraw canvases. The `.tldr` format is plain JSON (`{tldrawFileFormatVersion: 1, schema, records}`); `Tools/Tldr.ts` writes records that pass tldraw's own validator, so generated files open cleanly in the tldraw web editor, the VS Code tldraw extension, or the desktop app. Two directions: model → canvas (sketch diagrams) and canvas → model (read and structure a human's rough thinking).
10 
11## Customization
12 
13**Before executing, check for user customizations at:**
14`~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Tldraw/`
15 
16If this directory exists, load and apply any PREFERENCES.md found there (default canvas directory, preferred colors/register, default open surface). If not, proceed with defaults.
17 
18## Voice Notification
19 
20**When executing a workflow, do BOTH:**
21 
221. **Send voice notification**:
23 ```bash
24 curl -s -X POST http://localhost:31337/notify \
25 -H "Content-Type: application/json" \
26 -d '{"message": "Running WORKFLOWNAME in Tldraw"}' \
27 > /dev/null 2>&1 &
28 ```
29 
302. **Output text notification**:
31 ```
32 Running **WorkflowName** in **Tldraw**...
33 ```
34 
35## Workflow Routing
36 
37| Workflow | Trigger | File |
38|----------|---------|------|
39| **SketchDiagram** | "sketch a diagram", "draw this on a canvas", "tldraw diagram" | `Workflows/SketchDiagram.md` |
40| **StructureCanvas** | "structure my canvas", "organize my whiteboard", "read my canvas" | `Workflows/StructureCanvas.md` |
41 
42## Quick Reference
43 
44- Tool: `bun ~/.claude/skills/Tldraw/Tools/Tldr.ts <create|inspect|add|remove|move|settext|validate> <file.tldr> [flags]`
45- Record shapes, spec format, coordinate conventions: `References/TldrFormat.md`
46- Vendored schema (tldraw 5.2.5): `References/SchemaSnapshot.json`
47 
48## Examples
49 
50**Example 1: Diagram for a post**
51```
52User: "Sketch the three-stage pipeline as a hand-drawn diagram"
53→ Invokes SketchDiagram workflow
54→ Writes spec JSON, runs Tldr.ts create + add, validates
55→ Returns the .tldr path and how to open it; user nudges shapes and exports
56```
57 
58**Example 2: Organize an ideation canvas**
59```
60User: "I dumped ideas on my canvas — structure them"
61→ Invokes StructureCanvas workflow
62→ Tldr.ts inspect --json reads every shape's text and position
63→ Clusters related items, adds frames + arrows, moves shapes into groups
64→ User reopens the same file and sees the organized version
65```
66 
67## Gotchas
68 
69- **zsh `echo` mangles spec JSON** — it expands `\n` inside strings into real newlines, breaking JSON. Write the spec to a file (or use `printf '%s'`) and pass `--spec <file>`; the tool also accepts `--spec -` on stdin, but only feed it from something that doesn't reinterpret escapes.
70- **Text is `richText`, never a plain string** — labels on geo/text/note/arrow shapes are ProseMirror doc JSON (`{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"..."}]}]}`). A bare string prop is rejected by tldraw's validator. `Tldr.ts` builds this for you; never hand-write a `text` prop.
71- **Arrow bindings require `terminal: "start"|"end"`** — tldraw's own `ArrowBindingUtil.getDefaultProps()` omits it, but the schema validator rejects a binding without it (verified against tldraw 5.2.5). The tool sets it; if you hand-edit bindings, keep it.
72- **Raw records need every prop** — records written to the file bypass editor defaulting, so a missing prop (e.g. `growY` on geo) fails validation on load. Always go through `Tldr.ts add`; don't append hand-rolled records.
73- **Fractional index strings order shapes** — `index` values (`a1`, `a2`, …) are base62 lexicographic and must never end in `0`. The tool generates them; duplicates cause z-order glitches in the editor.
74- **The desktop-app `.tldraw` format is a different thing** — the tldraw desktop app's native save is a zip (sqlite + assets + scripts), not this JSON. This skill targets portable `.tldr` JSON, which the web editor, the VS Code extension, and the desktop app can all open/import.
75- **Editors hold files in memory** — if the user has the canvas open while you edit it on disk, their surface may not reload (or may overwrite your change on save). Edit while closed, or tell the user to reopen after your write.
76 
77## Opening a canvas
78 
79- **VS Code / Cursor**: the official tldraw extension opens `.tldr` files in-editor — fully local, right choice for private content.
80- **tldraw.com**: File → Open. Content goes to a third-party web app — only for content already public-destined.
81- **Export to image**: from any tldraw surface, select all → Export as SVG/PNG. (No headless export path ships with this skill.)
82 
83## Execution Log
84 
85After completing any workflow, append a single JSONL entry:
86 
87```bash
88echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"Tldraw","workflow":"WORKFLOW_USED","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' >> ~/.claude/LIFEOS/MEMORY/SKILLS/execution.jsonl
89```
90 
View all files on GitHub →

Details

Version
1.0.1
License
MIT
Stars on the repo
★ 19,269
Checked
Source
danielmiessler/LifeOS ↗
Creator
danielmiessler · 63 listings
View creator

Similar skills

See all →
SkillAnimated Slide Deck Builderzarazhangrui/frontend-slides · by zarazhangruiCreate stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.★ 30.3k GitHub starsSkillSVG Diagram CreatorJimLiu/baoyu-skills · by JimLiuCreate professional, dark-themed SVG diagrams of any type — architecture diagrams, flowcharts, sequence diagrams, structural diagrams, mind maps, timelines, illustrative/conceptual diagrams, and more. Use this skill whenever the user asks for any kind of technical or conceptual diagram, visualization of a system, process flow, data flow, component relationship, network topology, decision tree, org chart, state machine, or any visual representation of structure/logic/process. Also trigger when the user says "画个图" "画一个架构图" "diagram" "flowchart" "sequence diagram" "draw me a ..." or uploads content and asks to visualize it. Output is always a standalone .svg file.★ 26.6k GitHub starsSkillVisual Explainernicobailon/visual-explainer · by nicobailonGenerate self-contained HTML visual explanations for systems, code changes, plans, data, and technical concepts. Use for diagrams, architecture overviews, diff or plan reviews, project recaps, comparison tables, slide decks, animated explainers, and other visual explanations.★ 10.2k GitHub starsSkillHTML Presentation Studiolewislulu/html-ppt-skill · by lewisluluHTML PPT Studio — author professional static HTML presentations in many styles, layouts, and animations, all driven by templates. Use when the user asks for a presentation, PPT, slides, keynote, deck, slideshow, "幻灯片", "演讲稿", "做一份 PPT", "做一份 slides", a reveal-style HTML deck, a 小红书 图文, or any kind of multi-slide pitch/report/sharing document that should look tasteful and be usable with keyboard navigation. Triggers include keywords like "presentation", "ppt", "slides", "deck", "keynote", "reveal", "slideshow", "幻灯片", "演讲稿", "分享稿", "小红书图文", "talk slides", "pitch deck", "tech sharing", "technical presentation".★ 8.6k GitHub starsSkillLogo Designerkaankiziltug/logo-design-skill · by kaankiziltugProfessional logo and brand-mark design, from brief to production files. Guides discovery and the design brief, concept generation, choosing a mark type (wordmark, monogram, letterform, pictorial, abstract, emblem, mascot, combination), building clean geometric SVG logos, optical refinement, colour and typography, testing (16 px, one-colour, reversed, shelf test), client presentation, delivery variants and brand guidelines. Includes a searchable library of 1,400+ real-world SVG logos classified by type, technique, geometry and industry, plus scripts that audit SVGs and generate test sheets, presentation boards and export variants. Use this skill whenever the user wants a logo, logotype, wordmark, monogram, brand mark, symbol, app icon or favicon designed, redesigned, refreshed, critiqued or compared; asks for logo ideas or concepts; needs a design brief, logo guidelines, lockups or an identity system; or mentions branding a new company, product, app or project — even if they don't say the word "logo".★ 2.8k GitHub starsSkillPR Lenscoldteadotai/pr-lens · by coldteadotaiWHAT: Draws a code change or part of a codebase as an animated architecture or data-flow diagram, on its own or in a pull request. WHEN: asked to diagram, visualise or explain a change or a system, or when a pull request should carry a diagram. KEYWORDS: PR Lens, diagram, architecture, data flow, visualise, visualize, pull request★ 1.9k GitHub stars

More from danielmiessler

SkillScope Oscillation Analyzerdanielmiessler/LifeOS · by danielmiessler3-pass scope oscillation that holds a question constant while shifting zoom — narrow/tactical, wide/strategic, then synthesis — to surface design tensions, scope recommendations, and coherence assessments invisible at any single zoom level. USE WHEN aperture oscillation, oscillate scope, zoom in and out, tactical vs strategic, scope framing, design tension, system coherence check, local vs global design, wrong scope, scope negotiation. NOT FOR lens rotation across angles (use IterativeDepth).★ 19.3k GitHub starsSkillAphorism Library Managerdanielmiessler/LifeOS · by danielmiesslerCurated aphorism collection with CRUD — content-based matching, themed search, thinker research, DB maintenance. Quotes organized by author/theme/context/usage to prevent repetition. Four workflows: FindAphorism, AddAphorism, ResearchThinker, SearchAphorisms. Themes: Stoicism, Wisdom, Truth-seeking, Excellence, Resilience, Curiosity. USE WHEN aphorism, quote, find a quote, research thinker, add aphorism, quote for newsletter, what did X say about, quote bank. NOT FOR creative writing or social posts.★ 19.3k GitHub starsSkillSocial Platform Scraperdanielmiessler/LifeOS · by danielmiesslerScrapes social platforms, business data, and e-commerce via Apify actors — Instagram, LinkedIn, TikTok, YouTube, Facebook, Google Maps, Amazon, and web crawls — filtering in code. USE WHEN scrape Instagram, scrape LinkedIn, scrape TikTok, scrape YouTube, scrape Facebook, Google Maps leads, Amazon reviews, business intelligence, multi-platform social listening, competitive analysis, lead generation, social monitoring, Apify actors, web crawl, extract contacts. NOT FOR X/Twitter account operations like posting, threads, or bookmarks (those need a dedicated X API client), 4-tier progressive scraping with proxy escalation (use BrightData), or real-Chrome bot bypass and computer use (use Interceptor).★ 19.3k GitHub starsSkillVisual Content Generatordanielmiessler/LifeOS · by danielmiesslerStatic visual content across 20+ formats — diagrams, mermaid, infographics, D3 dashboards, comics, icons, wallpaper — via Nano Banana Pro (default), Nano Banana, and Flux. USE WHEN art, illustration, diagram, flowchart, infographic, header image, blog social thumbnail, visualize, generate image, mermaid, architecture diagram, comic, icon, blog art, framework diagram, D3 chart, remove background, wallpaper. NOT FOR locked house-style YouTube/channel/video thumbnails, video or animation (use Remotion), or web UI design and integrated frontend layout (use Webdesign).★ 19.3k GitHub starsSkillArXiv Paper Finderdanielmiessler/LifeOS · by danielmiesslerSearch and retrieve arXiv academic papers by topic, category, or paper ID — with AlphaXiv-enriched AI-generated overviews. Uses arXiv Atom API across cs.AI/cs.LG/cs.CL/cs.CR/cs.MA/cs.SE/cs.IR. Three workflows: Latest, Search, Paper. USE WHEN arxiv, papers, latest papers, research papers, recent ML papers, paper lookup, summarize paper, latest LLM papers, AI safety papers, cs.AI latest. NOT FOR general research (Research), URL parsing, or annual reports.★ 19.3k GitHub starsSkillFiller Removal Audio Editordanielmiessler/LifeOS · by danielmiesslerAI audio editing pipeline: Whisper word-level transcription → Claude segment classification (KEEP/CUT_FILLER/CUT_FALSE_START/CUT_STUTTER/CUT_DEAD_AIR) → ffmpeg with 40ms qsin crossfades and room-tone fill → optional Cleanvoice cloud polish; plus GateScan/GateRepair for noise-gate ticking artifacts. Modes: --preview, --aggressive, --polish. Workflow: Clean. USE WHEN clean audio, edit audio, remove filler words, clean podcast, remove ums, cut dead air, polish audio, trim recording, cut stutters, ticking audio, clicking audio, audio clicks, gate artifacts, popping audio. NOT FOR video composition (use Remotion).★ 19.3k GitHub stars