tldraw-offline
Skill này làm gì
Skill để agent đọc và thay đổi một canvas trong ứng dụng tldraw offline trên máy tính thông qua giao diện cục bộ của ứng dụng. Phù hợp với người muốn sơ đồ, wireframe hoặc canvas tương tác do agent xây dựng.
Khi nào nên dùng
- ✓Khi bạn đang mở tldraw offline và muốn một sơ đồ hoặc wireframe được dựng.
- ✓Khi bạn muốn bản vẽ có hành vi tương tác như nút bấm hoặc hoạt ảnh.
- ✓Khi bạn muốn bố cục canvas được tạo bằng code thay vì vẽ tay.
Liên kết skill
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/creative/tldraw-offline/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Khi tldraw offline đang mở, hãy dựng một wireframe quy trình đăng nhập của chúng tôi trên canvas.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent gửi lệnh đến giao diện cục bộ của ứng dụng trên máy bạn, thường bằng curl. Agent ghi các hình thông qua code và có thể nhúng một script chạy khi file được tải.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
tldraw offline Skill
Work with the tldraw offline desktop app (offline.tldraw.com): read the open
canvas, make edits, and write document scripts — JavaScript embedded in a
.tldraw file that runs on load and gives the file durable behavior. The app
runs a local HTTP API (default localhost:7236) that a coding agent drives
with plain curl from its terminal — this is exactly how the app's own homepage
demo (Codex editing a canvas live) works. The agent does NOT use computer-use /
GUI clicking, and does NOT hand-edit the .tldraw file directly. Keep tldraw
offline open while you work.
When to Use
- The user has tldraw offline open and asks you to build or modify a canvas (diagrams, wireframes, layouts).
- You want to add durable behavior to a drawing (reactive shapes, interactive buttons, animation, connection logic) via an embedded document script.
Do NOT hand-place shapes to imitate a drawing — write the code that generates them. Agents are far better at scripting the canvas than at drawing on it.
Prerequisites
- tldraw offline installed and running, with a document open. Releases:
https://github.com/tldraw/tldraw-offline/releases/latest (macOS DMG, Windows
x64/Arm64, Linux
x86_64/arm64AppImage or amd64/arm64.deb). - Agent skills installed in the app:
Develop → Install Agent Skills. The app writes its own tldraw skill into~/.codex/skills/,~/.claude/skills/,~/.cursor/skills/, and~/.gemini/skills/— teaching that agent thecurlrecipes below. (This Hermes skill mirrors that guidance for Hermes.) - The local control API. On launch the app writes
server.jsonto its config dir (Linux~/.config/tldraw/, macOS~/Library/Application Support/tldraw/, Windows%APPDATA%\tldraw\) withport(default7236), a bearertoken,pid, andstartedAt. Every request exceptGET /needsAuthorization: Bearer <token>. A clean quit removesserver.json; if it's present but the port doesn't answer, the app quit uncleanly — treat as not running. - Re-read port + token on EVERY shell call. Each terminal call is a fresh
shell, so an
exported token does not persist — "export once and reuse" sends an empty token and 401s. Read both inline at the top of each call:PORT=$(jq -r .port <server.json>); TOKEN=$(jq -r .token <server.json>). - No account or network needed for local editing.
How to Run
Two distinct workflows. Pick by whether the change must survive a reload.
A. One-off canvas edits (/exec) — layout, generating shapes, cleanup. This
is a live edit, not saved script:
BASE=http://localhost:7236
TOKEN=$(python -c "import json;print(json.load(open('$HOME/.config/tldraw/server.json'))['token'])")
# find the focused document id
DOC=$(curl -s "$BASE/api/search" -X POST -H 'content-type: application/json' \
-H "Authorization: Bearer $TOKEN" \
-d '{"code":"return (await api.getFocusedDoc()).id"}' | python -c "import sys,json;print(json.load(sys.stdin)['result'])")
# run code with the live `editor` + `helpers` in scope
curl -s "$BASE/api/doc/$DOC/exec" -X POST -H 'content-type: application/json' \
-H "Authorization: Bearer $TOKEN" \
-d '{"code":"const {createShapeId,toRichText}=await import(\"tldraw\"); editor.createShape({id:createShapeId(),type:\"geo\",x:0,y:0,props:{geo:\"rectangle\",w:200,h:100,color:\"blue\",fill:\"solid\",richText:toRichText(\"hello\")}}); return editor.getCurrentPageShapes().length"}'
B. Durable behavior (script/main.js) — reactive/interactive logic that must
survive reload. Edit the file on disk; the app's watcher applies it:
# get the live script file path for the doc
curl -s "$BASE/api/doc/$DOC/script-workspace" -X POST \
-H "Authorization: Bearer $TOKEN" # -> result.mainJsPath, result.isDefaultScript
# edit result.mainJsPath with read_file / patch / write_file (see scripts/main.js)
# then confirm the watcher applied it:
curl -s "$BASE/api/doc/$DOC/script-status" -H "Authorization: Bearer $TOKEN"
The ready-to-adapt document script is scripts/main.js.
Quick Reference
The document-script contract (verified against the app's bundled
script-context.d.ts):
import { createShapeId, toRichText } from 'tldraw' // primitives: import, not globals
export default function ({ editor, helpers, signal }) {
editor.run(() => { // batch = one undo step
helpers.createShapeIfMissing({ //
Câu hỏi thường gặp
Ứng dụng có cần đang mở không?
Có. Skill nói hãy giữ tldraw offline mở trong lúc agent làm việc.
Agent có chỉnh sửa trực tiếp file không?
Không. Skill nói rằng nó không sửa tay file .tldraw và không dùng thao tác nhấp chuột trên màn hình.
Tôi lấy ứng dụng ở đâu?
Skill chỉ đến trang phát hành tldraw offline trên GitHub, có bản dựng cho macOS, Windows và Linux.
Chi tiết
Mô tả gốc của tác giả
Drive and script tldraw offline canvases with an agent.
Độ phổ biến
- Sao GitHub
- 260k
- Vị trí xếp hạng
- #479
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-merge-conflict-arbiter
260kGiải quyết xung đột merge git giữa nhánh của hai agent với vai trò bên trung lập, tạo ra một kết quả merge duy nhất cho repo.
antigravity-cli
260kHướng dẫn bạn cài đặt, cập nhật và khắc phục sự cố công cụ dòng lệnh Antigravity, gồm plugin, đăng nhập và sandbox.
blackbox
260kCho phép agent của bạn giao một tác vụ lập trình cho công cụ dòng lệnh Blackbox AI, công cụ chạy nhiều mô hình và chọn kết quả tốt nhất.
dynamic-workflow
260kDạy agent của bạn chạy các đợt công việc tương tự lớn như một script đã lưu, để chỉ kết quả đã kiểm chứng mới quay về cuộc trò chuyện chính.
Skill tương tự
canvas
394kCho phép agent của bạn hiện một widget trực quan được lưu trữ trên bảng Mac đã kết nối, rồi ẩn bảng hoặc chuyển nó sang trang khác.
control-ui
394kGiúp agent của bạn sắp xếp và khắc phục sự cố Control UI của OpenClaw, gồm các phiên, bảng điều khiển và Gateway đã kết nối.
diagram-maker
394kGiúp agent của bạn vẽ sơ đồ rõ ràng dạng SVG, HTML hoặc Excalidraw có thể sửa, cho quy trình, kiến trúc hệ thống và bản phác bảng trắng.