tldraw-json-to-tldr
✓CleanGenerate and repair VS Code-compatible tldraw `.tldr` files from diagram JSON. Use when asked to build or update architecture diagrams from JSON, fix blank tldraw canvas issues in VS Code, or enforce current tldraw schema compatibility.
Install Command
npx skills add MOZARTINOS/claude-code-skill-tldraw-diagramSKILL.md
---
name: tldraw-json-to-tldr
description: Generate and repair VS Code-compatible tldraw `.tldr` files from diagram JSON. Use when asked to build or update architecture diagrams from JSON, fix blank tldraw canvas issues in VS Code, or enforce current tldraw schema compatibility.
---
# tldraw-json-to-tldr
## Setup
The generator script `gen-tldr.mjs` must be present in the user's project. Typical locations:
- `scripts/gen-tldr.mjs` (if repo was cloned directly)
- `skills/tldraw-json-to-tldr/scripts/gen-tldr.mjs` (if installed as a subdirectory)
Before running commands, locate `gen-tldr.mjs` in the project with a file search.
## Quick Workflow
1. Locate `gen-tldr.mjs` in the project directory.
2. If not found, run bootstrap:
- `node skills/tldraw-json-to-tldr/scripts/bootstrap-project.mjs --target .`
- `node "$HOME/.claude/skills/tldraw-json-to-tldr/scripts/bootstrap-project.mjs" --target .` (Bash/Zsh)
- `node "$env:USERPROFILE/.claude/skills/tldraw-json-to-tldr/scripts/bootstrap-project.mjs" --target .` (PowerShell)
3. Locate input JSON (default: `.diagrams/diagram.json`).
4. Run the generator script.
5. Validate that output is valid JSON.
6. If blank canvas is reported, run doctor (bootstrap + workspace cache reset):
- `node "$env:USERPROFILE/.claude/skills/tldraw-json-to-tldr/scripts/doctor-vscode-tldraw.mjs" --target . --reset-workspace-cache` (PowerShell)
- `node "$HOME/.claude/skills/tldraw-json-to-tldr/scripts/doctor-vscode-tldraw.mjs" --target . --reset-workspace-cache` (Bash/Zsh)
7. Re-open file in VS Code and verify shapes are visible.
## Commands
Use the actual path where `gen-tldr.mjs` was found. Examples for each layout:
```bash
# Bootstrap current project if script/config is missing:
node skills/tldraw-json-to-tldr/scripts/bootstrap-project.mjs --target .
node "$HOME/.claude/skills/tldraw-json-to-tldr/scripts/bootstrap-project.mjs" --target . # Bash/Zsh
node "$env:USERPROFILE/.claude/skills/tldraw-json-to-tldr/scripts/bootstrap-project.mjs" --target . # PowerShell
# If canvas is still blank in this workspace:
node "$env:USERPROFILE/.claude/skills/tldraw-json-to-tldr/scripts/doctor-vscode-tldraw.mjs" --target . --reset-workspace-cache # PowerShell
node "$HOME/.claude/skills/tldraw-json-to-tldr/scripts/doctor-vscode-tldraw.mjs" --target . --reset-workspace-cache # Bash/Zsh
# If scripts/ is at project root:
node scripts/gen-tldr.mjs --in .diagrams/diagram.json --out .diagrams/diagram.tldr
node scripts/gen-tldr.mjs --smoke --out .diagrams/smoke-test.tldr
# If installed as a subdirectory:
node skills/tldraw-json-to-tldr/scripts/gen-tldr.mjs --in .diagrams/diagram.json --out .diagrams/diagram.tldr
```
## Input Format
- `title: string` â diagram title
- `nodes: [{ id, label, group }]` â nodes with group-based column layout
- `edges: [{ from, to, label }]` â arrows between nodes
## Output Contract
The generated `.tldr` file uses:
- `tldrawFileFormatVersion: 1`
- `schema.schemaVersion: 2`
- `props.richText` (ProseMirror format, NOT legacy `props.text`)
- Full `schema.sequences` with all `com.tldraw.*` migration keys
- Required base records: `document:document`, `page:page`, `camera:page:page`
## Troubleshooting
1. Generate smoke file and open it first.
2. If smoke file is visible but main diagram is blank, regenerate main output from JSON.
3. If both are blank, use VS Code `Developer: Reload Window` and re-open.
4. Never use legacy `props.text` â always use `props.richText`.
5. Never reduce `schema.sequences` to empty â all keys are required.
6. Keep `.diagrams/diagram.json` in UTF-8 (without BOM) and standard double quotes.
## Shape Property Reference
### `geo` shape props
`geo, dash, url, w, h, growY, scale, labelColor, color, fill, size, font, align, verticalAlign, richText`
### `arrow` shape props
`kind, labelColor, color, fill, dash, size, arrowheadStart, arrowheadEnd, font, start, end, bend, richText, labelPosition, scale, elbowMidPoint`
### `text` shape props
`richText, size, font, textAlign, color, w, scale, autoSize`
Similar Skills
Generate PlantUML diagrams from text descriptions and convert them to PNG/SVG images. Use when asked to "create a diagram", "generate PlantUML", "convert puml to image", "extract diagrams from markdown", or "prepare markdown for Confluence". Supports all PlantUML diagram types including UML (sequence, class, activity, state, component, deployment, use case, object, timing) and non-UML (ER diagrams, Gantt charts, JSON/YAML visualization, mindmaps, WBS, network diagrams, wireframes, and more).
npx skills add SpillwaveSolutions/plantumlCreating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.
npx skills add chrisvoncsefalvay/claude-d3js-skillComplete Zod validation library documentation. Use when working with Zod schema validation, TypeScript type inference, form validation, API validation, error handling, or data parsing. Covers schema definition, refinements, transforms, error customization, and ecosystem integrations.
npx skills add leonaaardob/lb-zod-skillOptimize oversized CLAUDE.md files using progressive disclosure. Analyzes content tiers, detects encryption constraints, creates sub-documents, and rewrites the main file with a Sub-Documentation Table. Triggers: optimize CLAUDE.md, reduce CLAUDE.md size, CLAUDE.md too long, apply progressive disclosure to CLAUDE.md
npx skills add wrsmith108/claude-md-optimizer