papermorph

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Papermorph

Papermorph

Make the picture explain the idea through change: rearrange, split, balance, count, compare. Each chapter is one 1600×900 SVG stage plus controls; beats pair narration clips with timed actions. Quick checks and final practice happen inside the picture. Templates supply mechanics; choose the visual argument for the content.
Follow the pipeline forward, entering at the requested stage for existing work. User requests override defaults. Default to code/SVG artwork; record any other asset choices in the book's conventions. Re-create explanations, examples and drawings; keep source PDFs, page images and extracted text outside the static output folder and out of version control (
.gitignore
:
*.pdf
,
books/*/pages/
). Deliver a self-contained book folder with a cover, contents, chapters and local preview instructions.
让画面通过变化来解释概念:重排、拆分、平衡、计数、比较。每一章由一个 1600×900 的 SVG 舞台和一组控件组成;beats 将旁白音频片段与定时动作配对。快速检查和最终练习都嵌在画面中。模板提供交互机制;你只需为内容选择合适的视觉化论证方式。
沿流水线向前推进;对于已有工作,从用户指定的阶段开始。用户请求优先于默认设置。默认使用代码/SVG 图形素材;其他素材选择应记录在书籍约定中。重新制作讲解、示例和插图;源 PDF、页面图像和提取的文本必须放在静态输出文件夹之外,并且不得纳入版本控制(
.gitignore
:
*.pdf
、
books/*/pages/
)。交付一个包含封面、目录、章节和本地预览说明的自包含书籍文件夹。

Project layout

项目结构

books/<book>/
  book.pdf, sections.json      source and page map (private)
  pages/chNN/text.md, *.png    extracted reference material (private)
  BOOK.md                     current scope, conventions, helper index
  chapters.md                 chapter map and status
  chapters/chNN.md            brief storyboard, relevant errata and feedback
content/<book>/chNN/           narration.<lang>.json and TTS cache
tools/<book>/                 targeted tests when needed
site/                          static output; private sources stay outside
  <book>/index.html            cover + contents        (assets/templates/book.html)
  <book>/unit-art.js           unit sketches           (assets/templates/unit-art.js)
  <book>/lib/engine.js, .css   this book's engine copy (assets/engine/)
  <book>/chNN/index.html       a lesson                (assets/templates/chapter.html)
  <book>/chNN/audio/<lang>/    beat MP3s + timings.js
SKILL
means this skill's absolute folder;
<book>
is the book slug,
<lang>
its primary language code. Existing books keep their paths. Needs:
uv
,
ffmpeg
/
ffprobe
, Edge TTS network access and Playwright Chromium (
uv run --with playwright playwright install chromium
). Preview:
python3 -m http.server 8765 -d site
.
books/<book>/
  book.pdf, sections.json      source and page map (private)
  pages/chNN/text.md, *.png    extracted reference material (private)
  BOOK.md                     current scope, conventions, helper index
  chapters.md                 chapter map and status
  chapters/chNN.md            brief storyboard, relevant errata and feedback
content/<book>/chNN/           narration.<lang>.json and TTS cache
tools/<book>/                 targeted tests when needed
site/                          static output; private sources stay outside
  <book>/index.html            cover + contents        (assets/templates/book.html)
  <book>/unit-art.js           unit sketches           (assets/templates/unit-art.js)
  <book>/lib/engine.js, .css   this book's engine copy (assets/engine/)
  <book>/chNN/index.html       a lesson                (assets/templates/chapter.html)
  <book>/chNN/audio/<lang>/    beat MP3s + timings.js
SKILL
指此 skill 的绝对文件夹;
<book>
是书籍 slug,
<lang>
是其主要语言代码。现有书籍保留其原有路径。依赖项:
uv
、
ffmpeg
/
ffprobe
、Edge TTS 网络访问和 Playwright Chromium(
uv run --with playwright playwright install chromium
)。预览:
python3 -m http.server 8765 -d site
。

Pipeline

流水线

Resolve intake, book map and pilot decisions with the user; reuse answers and approvals already given.
  1. Intake. Choose a slug; create
    books/<book>/BOOK.md
    from the template. Record readers, tone, primary language, scope and assets/guide. Ask for missing decisions together, with defaults.
  2. Split. Run
    uv run --with pymupdf SKILL/scripts/outline.py books/<book>/book.pdf
    ; use
    --level N -o books/<book>/sections.json
    at chapter depth. For a PDF without bookmarks, inspect
    split_pages.py … --pages 1-12 --out books/<book>/pages
    , then write the map from its contents (schema:
    outline.py --help
    ). Match the map to the contents; extract chapter text with
    split_pages.py … --sections books/<book>/sections.json --out books/<book>/pages --text-only
    .
  3. Book map. Read contents and chapter openings; inspect more text where the scope is unclear. Create
    chapters.md
    with columns
    # | Title | Unit | Minutes | Status
    (planned, ready, user-approved); put colours and candidate recurring visual models in BOOK.md. Confirm the list and visual approach with the user.
  4. Initialize. Follow site.md to copy the book engine, cover/contents and chapter skeleton before making the pilot.
  5. Pilot. Make chapter 1 through the chapter loop. Deliver it for the user's review and record approved conventions in BOOK.md. Implement helpers as needed; share one when another chapter uses it.
  6. Remaining chapters and finish. Produce chapters sequentially (see Context). Complete cover text, contents and unit sketches using site.md. Deliver the static book folder, its entry URL for local preview and any unresolved issues for human review; reuse each chapter's delivery results.
与用户确定接收信息、书籍映射和试点决策;复用此前已提供的答案和批准结果。
  1. 接收。 选择 slug;根据模板创建
    books/<book>/BOOK.md
    。记录读者对象、语气、主要语言、范围以及素材/指南。一次性询问所有缺失决策,并同时给出默认值。
  2. 拆分。 运行
    uv run --with pymupdf SKILL/scripts/outline.py books/<book>/book.pdf
    ;在章节层级使用
    --level N -o books/<book>/sections.json
    。对于没有书签的 PDF,先通过
    split_pages.py … --pages 1-12 --out books/<book>/pages
    检查内容,然后根据其目录编写映射(schema:
    outline.py --help
    )。让映射与目录保持一致;使用
    split_pages.py … --sections books/<book>/sections.json --out books/<book>/pages --text-only
    提取章节文本。
  3. 书籍映射。 阅读目录和章节开头;对于范围不明确的章节,进一步检查更多文本。创建
    chapters.md
    ,列为
    # | Title | Unit | Minutes | Status
    (planned、ready、user-approved);将配色和候选的复用视觉模型记录在
    BOOK.md
    中。与用户确认章节列表和视觉方案。
  4. 初始化。 按照 site.md 复制书籍引擎、封面/目录和章节骨架,然后制作试点章节。
  5. 试点。 通过章节循环完成第 1 章。交付给用户审阅,并将批准的约定记录到
    BOOK.md
    。根据需要实现辅助函数;如果其他章节也会使用某个辅助函数,则共享它。
  6. 其余章节与收尾。 按顺序制作各章节(见上下文)。使用 site.md 完成封面文案、目录和单元草图。交付静态书籍文件夹、本地预览入口 URL,以及需要人工审核的未解决问题;复用各章节的交付结果。

Chapter loop

章节循环

  1. Read this chapter's
    pages/chNN/text.md
    ; render its pages with
    split_pages.py … --only chNN
    when diagrams or missing text need images. Select the ideas and examples to teach.
  2. Storyboard in
    chapters/chNN.md
    : beat list, visual changes, narration triggers and questions. Use authoring.md for content conventions; verify the examples and answers used in the finished chapter.
  3. Narration: write
    content/<book>/chNN/narration.<lang>.json
    , then
    uv run --with edge-tts SKILL/scripts/tts.py content/<book>/chNN/narration.<lang>.json site/<book>/chNN/audio/<lang>
    .
  4. Beats: implement the storyboard in
    site/<book>/chNN/index.html
    ; API and replay invariants are in engine.md. Use the book's approved look and interactions.
  5. Delivery pass: follow review.md once for loading, opening blanks, overlap/cropping, text density and colour consistency. Correct clear defects locally, recheck the affected part, then deliver; report unresolved problems. The user reviews overall aesthetics, pacing and teaching effectiveness.
  6. Register: add the ready chapter to
    UNITS
    , set the previous chapter's
    CHAPTER.next
    , update its row in
    chapters.md
    and notes in
    chapters/chNN.md
    . Promote new shared decisions to BOOK.md. The coordinator owns this step when using subagents.
  1. 阅读 本章的
    pages/chNN/text.md
    ;当需要查看图示或缺失文本对应的图像时,使用
    split_pages.py … --only chNN
    渲染本章页面。选择需要讲解的概念和示例。
  2. 分镜:在
    chapters/chNN.md
    中记录 beat 列表、视觉变化、旁白触发点和问题。使用 authoring.md 了解内容约定;验证最终章节中使用的示例和答案。
  3. 旁白:编写
    content/<book>/chNN/narration.<lang>.json
    ,然后运行
    uv run --with edge-tts SKILL/scripts/tts.py content/<book>/chNN/narration.<lang>.json site/<book>/chNN/audio/<lang>
    。
  4. Beats:在
    site/<book>/chNN/index.html
    中实现分镜;API 和重放不变量见 engine.md。使用书籍已批准的视觉风格和交互方式。
  5. 交付检查:按照 review.md 执行一次检查,涵盖加载、打开时出现空白、元素重叠/裁剪、文本密度和配色一致性。修复明确的缺陷,重新检查受影响的部分,然后交付;报告未解决的问题。用户负责审核整体美学、节奏和教学效果。
  6. 登记:将就绪章节添加到
    UNITS
    ,设置上一章的
    CHAPTER.next
    ,更新
    chapters.md
    中的相应行和
    chapters/chNN.md
    中的说明。将新的共享决策提升到
    BOOK.md
    。使用 subagent 时,该步骤由协调器负责。

Context

上下文

  • Keep the pilot in the main conversation. Afterwards, use one fresh subagent per chapter sequentially when available; otherwise use the same chapter loop in the current agent with file-based state.
  • Brief with chapter number, relevant map row, book/source/output paths, Skill path and current user requests. Pass these instead of full conversation history where the host supports fresh context. Worker reads BOOK.md and its chapter notes, completes steps 1–5, and returns files, delivery result, errata and new helpers/decisions in a few lines. Coordinator registers it.
  • Read only the reference needed for the current step. Use the engine API and inspect individual functions when needed; copy assets rather than reading their full source as instructions.
  • Keep BOOK.md to current conventions and the helper index. Chapter status, errata and historical feedback stay in their own files; read only relevant entries.
  • Write from the storyboard in one pass. Use contact sheets and short command summaries; retain failure details. Run targeted interaction tests when the engine or grading changes, as described in review.md.
  • 将试点保留在主对话中。之后,如可用,每章按顺序使用一个全新的 subagent;否则在当前 Agent 中使用同一章节循环,并通过文件维护状态。
  • 使用章节编号、相关映射行、书籍/源文件/输出路径、Skill 路径和当前用户请求进行简报。在宿主支持全新上下文时,传递这些信息,而不是完整对话历史。Worker 读取
    BOOK.md
    和章节说明,完成步骤 1–5,并用几行返回文件、交付结果、勘误以及新的辅助函数/决策。协调器负责登记。
  • 只阅读当前步骤所需的参考资料。必要时使用引擎 API 并检查单个函数;复制素材,而不是将完整源码作为说明来阅读。
  • 将
    BOOK.md
    保持为当前约定和辅助函数索引。章节状态、勘误和历史反馈保留在各自文件中;只读取相关条目。
  • 根据分镜一次性完成编写。使用接触印相表(contact sheets)和简短命令摘要;保留失败详情。当引擎或评分逻辑发生变化时,按照 review.md 的说明运行定向交互测试。