Skip to content

feat(skills): add tldraw-offline agent scripting skill - #66896

Merged
teknium1 merged 2 commits into
mainfrom
feat/tldraw-offline-skill
Jul 23, 2026
Merged

feat(skills): add tldraw-offline agent scripting skill#66896
teknium1 merged 2 commits into
mainfrom
feat/tldraw-offline-skill

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Adds an optional skill that teaches Hermes to drive the tldraw offline desktop app through its local HTTP control API — the same curl-based path the app itself installs for Codex/Claude Code/Cursor/Gemini — to read a canvas, make live edits, and author embedded document scripts.

Changes

  • optional-skills/creative/tldraw-offline/SKILL.md — the skill: the local HTTP API (/api/search, /api/doc/:id/exec, /api/doc/:id/script-workspace, /api/doc/:id/script-status; bearer token from server.json, re-read per shell call), the ({ editor, helpers, signal }) document-script contract, the shape-prop schema, packaging a self-running .tldraw (manifest digest + trust store), and pitfalls.
  • scripts/main.js — diagram-generation example (idempotent boxes + bound arrows).
  • scripts/counter.js — interactive-UI example (MINUS/RESET/PLUS buttons driving live state).
  • scripts/validate_shapes.mjs — offline schema check against @tldraw/tlschema.
  • tests/skills/test_tldraw_offline_skill.py — 15 tests (structure, ctx contract, HTTP-API coverage, prop-table/validator consistency, interactive example).

Grounding & validation

Everything is grounded in the app's own bundled script-context.d.ts and agent playbook (extracted from the v1.11.0 release), and in the real tldraw SDK v5 schema — not reconstructed API.

Result
Shape records vs @tldraw/tlschema v5 3/3 valid + survive JSON round-trip
Skill test suite 15/15 passing
Click→state logic (counter) via /api/doc/:id/exec dispatch 0 → 1 → 2 → 1 → 0

Honest verification boundary

The counter's click→state logic was verified using tldraw's own documented method — a simulated editor.dispatch click + state read via /exec — not a real GUI mouse. Two caveats are documented in the skill: (a) the script only runs once the app's file-watcher applies it (an inotify-starved host shows state: "not-watching" and the script never executes — a host limit, not a script bug); (b) Chromium/Electron reject synthetic background clicks, so computer-use no-focus automation cannot drive the canvas (irrelevant to the real product path, which is /exec, but noted so nobody tries to "verify" via background GUI clicks).

Infographic

tldraw-offline-skill

Optional skill for driving the tldraw offline desktop app via its local
HTTP control API (the same curl-based path the app's own agent skills use
for Codex/Claude Code/Cursor/Gemini) — read the canvas, make live edits,
and write embedded document scripts.

Grounded in the app's bundled script-context.d.ts and agent playbook, and
in the real tldraw SDK v5 shape schema:
- document-script contract: export default function ({ editor, helpers, signal })
- HTTP API: /api/search, /api/doc/:id/exec, /api/doc/:id/script-workspace,
  /api/doc/:id/script-status (bearer token from server.json, re-read per call)
- shape schema table validated against @tldraw/tlschema (scripts/validate_shapes.mjs, 3/3)
- interactive-UI example (scripts/counter.js) + diagram-generation (scripts/main.js)
- honest verification boundary: click->state logic verified via /exec dispatch
  (0->1->2->1->0), with documented host caveats (inotify watcher, Electron
  background-click rejection)

Tests: tests/skills/test_tldraw_offline_skill.py (15 passing).
@alt-glitch alt-glitch added type/feature New feature or request tool/skills Skills system (list, view, manage) P3 Low — cosmetic, nice to have labels Jul 18, 2026
The skill claimed Chromium/Electron 'reject synthetic clicks' so computer-use
can't drive the canvas. The Cua team disproved this on the exact v1.11.0
AppImage (Linux/X11): background delivery returns background_unavailable, but
that's the first rung, not a wall — cua-driver returns escalation:'foreground'
and its X11 XTest path (x11_xtest_fg) with delivery_mode:'foreground' clicks
through, dismissing the consent dialog and landing canvas clicks.

Corrected the note to say: climb to foreground on background_unavailable, don't
conclude Electron is unclickable. Ref: #67052.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants