draw-tldraw
Create .tldr files from shape descriptions
SKILL.mddraw-tldraw/SKILL.md
GitHubGoal
Create a .tldr file from a drawing or diagram description
Scope
- Generate JSON per the tldraw schema
- Supports shapes: geo, text, draw, arrow, line, note
- Creates files openable in the tldraw app or VS Code extension
Execute
1. Parse Description
Goal: Understand the drawing
- Take the description from the user
- Identify the shapes and text to create
- Set the page size and positions
- If complex → create a simple layout first
2. Generate Schema
Goal: Build the JSON per tldraw
- Use the schema:
{ "tldrawFileFormatVersion": 1, "schema": { "schemaVersion": 2, "sequences": { "com.tldraw.store": 5, "com.tldraw.page": 1, "com.tldraw.shape.geo": 11, "com.tldraw.shape.text": 4, "com.tldraw.shape.arrow": 8, "com.tldraw.shape.draw": 4, "com.tldraw.shape.line": 5, "com.tldraw.shape.note": 10, "com.tldraw.shape.group": 0 } }, "records": [] } - Create records for
document,page, and each shape - Each shape record must have
id,typeName: "shape",parentId,pageId,index,type,x,y,props
3. Save File
Goal: Save the file
- Save as
<name>.tldr - Validate the JSON
- Report the path
Rules
1. Schema
- Must have
tldrawFileFormatVersion,schema,records schemaVersionshould be 2recordsmust containdocument,page, and shapes
2. Shape Types
geofor rectangle, ellipse, triangle, diamondtextfor labelsarrowfor connecting shapesdrawfor freehandnotefor sticky notes
3. Simple First
Create a simple drawing first
Add detail gradually if the user wants it
Use /draw-excalidraw if needed
Expected Outcome
- A
.tldrfile openable in tldraw - Contains complete records
- JSON valid and schema-correct