An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
feat(skill): engine.py syncs from the latest major release, engine-v2
yzrec9ed7482de7
diff --git a/.claude/skills/papermorph/assets/templates/style.json b/.claude/skills/papermorph/assets/templates/style.jsonindex a96c7e7..df72a84 100644--- a/.claude/skills/papermorph/assets/templates/style.json+++ b/.claude/skills/papermorph/assets/templates/style.json@@ -14,7 +14,7 @@},"voice": { "engine": "edge", "voice": "en-US-AndrewMultilingualNeural", "rate": "-4%" },"pacing": { "minutes": [6, 10], "checks": "one or two quick checks inside the lesson, practice at the end" },- "engine": { "source": "DozenTwelve/Papermorph", "ref": "main" },+ "engine": { "source": "DozenTwelve/Papermorph", "ref": "engine-v2" },"models": { "extract": "claude-haiku-5-5", "narration": "claude-sonnet-5-5", "picture": "claude-opus-5-5", "checks": "claude-haiku-5-5", "review": "claude-sonnet-5-5", "rework": "claude-opus-5-5", "register": "claude-haiku-5-5" },"scenes": {"art": "pixel scenes on a dark board, characters about a third of the stage tall",diff --git a/.claude/skills/papermorph/references/engine.md b/.claude/skills/papermorph/references/engine.mdindex d3aa5b2..b8abfe3 100644--- a/.claude/skills/papermorph/references/engine.md+++ b/.claude/skills/papermorph/references/engine.md@@ -2,7 +2,7 @@A chapter page loads the engine and its `audio/<lang>/timings.js`, defines `CHAPTER` (including `language` when different from `en`: the audio folder), drawing helpers, `BEATS` and questions, then calls `boot()`. The engine provides the stage, drawing, timeline, question types, guide and player. Use the code's signatures if they differ from this reference. The interface text (buttons, help, cover, finish card) follows `<html lang>`: English, Russian, Chinese and Japanese are in the engine's `TRANSLATIONS`; another language needs a block there.-Every book keeps a copy of the shared engine in `lib/` (`engine.*`, `math.js`, `volume.*`, `contents.*`, `units.*`), so the book runs on its own. The engine is not part of this skill: it lives in the `engine/` folder of the Papermorph repository (or a fork). `python3 SKILL/scripts/engine.py site` copies it into every book from the repository's `engine/` when it is at hand, otherwise from GitHub (`--check` lists copies that differ, `--from DIR|OWNER/REPO@REF` picks the source, a tag or commit pins it: `engine-v1` is the last engine with the maths helpers inside `engine.js`); a book's copy is not edited by hand. An engine bug is fixed at the source, then synced. The book's own settings and style overrides live in `lib/book.css`, imported by `engine.css` and never overwritten: `--math-font` for numbers and formulas, `--progress-key` when the cover uses a key other than the default.+Every book keeps a copy of the shared engine in `lib/` (`engine.*`, `math.js`, `volume.*`, `contents.*`, `units.*`), so the book runs on its own. The engine is not part of this skill: it lives in the `engine/` folder of the Papermorph repository (or a fork). `python3 SKILL/scripts/engine.py site` copies it into every book from the repository's `engine/` when it is at hand, otherwise from GitHub (`--check` lists copies that differ, `--from DIR|OWNER/REPO@REF` picks the source, by default the latest major release, `engine-v2`; `@main` takes the newest, a tag or commit pins it, and `engine-v1` is the last engine with the maths helpers inside `engine.js`); a book's copy is not edited by hand. An engine bug is fixed at the source, then synced. The book's own settings and style overrides live in `lib/book.css`, imported by `engine.css` and never overwritten: `--math-font` for numbers and formulas, `--progress-key` when the cover uses a key other than the default.The maths helpers (number lines, tiles, fraction rows, planes, chance objects, the number-set diagram, `pickPoint`, `sorter`) are in `lib/math.js`. A chapter that uses one loads `<script src="../lib/math.js"></script>` right after `engine.js`: it reads the engine's globals as it loads, so never before it and never `async`. `lint.py` names a chapter that uses one without loading it. Use the helpers that fit; draw the rest in the chapter, and move what several chapters use into the book's element library (`lib/<name>.js`, [assets.md](assets.md)) rather than into the engine copy.diff --git a/.claude/skills/papermorph/scripts/engine.py b/.claude/skills/papermorph/scripts/engine.pyindex 9723074..36695d2 100644--- a/.claude/skills/papermorph/scripts/engine.py+++ b/.claude/skills/papermorph/scripts/engine.py@@ -5,12 +5,13 @@python3 engine.py site # every book in site/ (each folder with lib/engine.js)python3 engine.py site --check # report copies that differ; exit status 1 if anypython3 engine.py site --from ../my-engine # a local engine folder (a fork, or one being fixed)- python3 engine.py site --from you/fork@v2 # engine/ of a GitHub repo at a tag, branch or commit+ python3 engine.py site --from you/fork@main # engine/ of a GitHub repo at a tag, branch or commitpython3 engine.py site/stats --latex # also MathJax, for a book whose chapters use TX()-The engine is not part of this skill: it is the engine/ folder of a repository, versioned by tags, and anyone may-fork it. Without --from, the engine/ folder here or above the target is used (a checkout of that repository),-otherwise DEFAULT; the source used is printed.+The engine is not part of this skill: it is the engine/ folder of a repository, versioned by tags (engine-v2,+engine-v2.0.1, ...; a new major number means books may need a change), and anyone may fork it. Without --from, the+engine/ folder here or above the target is used (a checkout of that repository), otherwise DEFAULT, the latest major+release; the source used is printed.Each book keeps a full copy in lib/, so it runs on its own; fix the engine at its source and sync, never edit thecopies. lib/book.css holds the book's own settings and overrides; it is created from the default and neveroverwritten. MathJax (engine/vendor/mathjax) goes only into books that ask for it with --latex; after that, a book@@ -19,7 +20,7 @@ with lib/mathjax.js keeps it in step like the rest.import argparse, filecmp, io, shutil, sys, tarfile, tempfile, urllib.requestfrom pathlib import Path-DEFAULT = 'DozenTwelve/Papermorph@main'+DEFAULT = 'DozenTwelve/Papermorph@engine-v2' # moves only with a major releaseOWN = 'book.css'LATEX = {'vendor/mathjax/tex-svg-full.js': 'mathjax.js', 'vendor/mathjax/LICENSE': 'mathjax-LICENSE.txt'}diff --git a/README.md b/README.mdindex e6031b3..4417a12 100644--- a/README.md+++ b/README.md@@ -74,7 +74,7 @@ python3 .claude/skills/papermorph/scripts/engine.py sitepython3 .claude/skills/papermorph/scripts/engine.py site --from you/your-fork@main```-Engine versions are tagged. Since `engine-v2` the maths helpers (number lines, tiles, planes, the number-set diagram) are in `lib/math.js`: a chapter that uses them loads `../lib/math.js` right after `engine.js`, and `lint.py` names the chapters that need it. `--from DozenTwelve/Papermorph@engine-v1` keeps the earlier engine.+Engine versions are tags (`engine-v2`, then `engine-v2.0.1` for fixes); a new major number means a book may need a change, described in its [release notes](https://github.com/DozenTwelve/Papermorph/releases). Outside this repository, `engine.py` syncs from the latest major release, now `engine-v2`. Since `engine-v2` the maths helpers (number lines, tiles, planes, the number-set diagram) are in `lib/math.js`: a chapter that uses them loads `../lib/math.js` right after `engine.js`, and `lint.py` names the chapters that need it. `--from DozenTwelve/Papermorph@engine-v1` keeps the earlier engine.## Video and LMS export