Skip to content

Add Draft with your agent: a diagram from words, drafted by any agent - #93

Merged
raj-khan merged 1 commit into
mainfrom
fl-90-draft
Sep 27, 2026
Merged

raj-khan merged 1 commit into
mainfrom
fl-90-draft

Conversation

@raj-khan

Copy link
Copy Markdown
Owner

FL-90, criterion 1 of 2.

  • Draft with your agent (menu, command palette): describe a diagram in words, then copy the prompt or open it already filled in at Claude or ChatGPT. Paste the answer back; it is checked as you paste (line errors, or "4 shapes and 4 connections, ready") and Use this diagram draws it as one undoable change. isketch sends nothing anywhere.
  • src/domain/draft.js: draftPrompt teaches the format (rules, every shape from the registry, a valid example) and asks for one fenced block; readDraft takes the first fenced block of an answer, or the whole answer.
  • Tried on a real model: claude -p --model haiku with the prompt for a URL shortener returned valid .flow first time (8 shapes, 7 connections, every part named).

Criterion 2, a built-in version, is your call (asked on the task): the person's own API key in the browser (no cost to you), or a call through the isketch server with your key (simplest for them, costs you per diagram, needs rate limits).

Tests: draft.spec.js (6), e2e/draft.spec.js. vitest 311, e2e 145, lint and typecheck.

A prompt that teaches the .flow format, copied or opened in Claude or
ChatGPT, and the answer pasted back and drawn as one undoable change.
@raj-khan
raj-khan merged commit a9c9571 into main Sep 27, 2026
4 checks passed
@raj-khan
raj-khan deleted the fl-90-draft branch September 27, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant