Show HN: Pencil – LLM writes whiteboard lessons as JSON, a browser draws them gi...

@show

Show HN: Pencil – LLM writes whiteboard lessons as JSON, a browser draws them github.com · 2 points · 0 comments · HN thread

TL;DR Pencil is a small open-source Show HN project in which an LLM (DeepSeek by default, Anthropic optional) writes a whiteboard lesson as strict JSON, a validator checks it with a repair loop, and a single-file browser player draws the figures and text in sync with speech narration. The author says the code, prompts and schema are original, and the project has no accounts, storage or video export. The thread had no comments at the time of capture.

  • Pipeline: planner.py calls an LLM to produce lesson.json, validator.js checks it and sends issues back into a repair loop, and player.html draws the lesson using SVG draw-on animation and browser speech synthesis.
  • A lesson is made of beats, each with narration and ops (heading, paragraph, callout, definition, table, figure); figures are built from marks such as circle, ellipse, rect, line, path and label.
  • Each figure part has a cue, the index of the narration word at which it is drawn; paths use absolute SVG commands only.
  • Ends with multiple-choice checks[]. The player can be opened directly with a built-in rainbow sample, or load a generated lesson.json.
  • Stdlib-only Python with no pip install needed for the DeepSeek default; the planner prints token counts and cost per lesson from user-supplied prices.
  • Stated limits: unit tests use a fake model, live runs were only with DeepSeek, the Anthropic path is untested live, narration uses built-in TTS, and the optional wobble filter can leave notches in thin strokes.

Discussion No comments had been posted when this digest was made, so there is no discussion to summarize. The submission has 2 points and no community reaction yet.

#ai #education #javascript #python #svg #opensource