Communitygithub.com

liangdabiao/whiteboard-teacher-video

图文讲解视频 skill:把知识讲解/科普/推导做成「手绘会动的画面」讲解视频——图形由代码逐笔绘出、文字逐字写出、讲到哪画到哪(音画对齐)。五套风格可选(白板/黑板/书卷/暖色插画/科技深色),29 个现成组件(图表、流程、仪表、终端、3D),本地 Chrome 渲染、零生图 API 成本、任何改动秒级重渲。当用户要做知识讲解视频、概念科普、图解动画,或要求「手绘动画」「讲动画」「图文视频」「explainer」「animación」时使用。触发词:讲解视频、科普视频、图解视频、手绘动画、讲动画、逐笔绘制、图文并茂的视频、explainer video、whiteboard teacher。

whiteboard-teacher-video 是什么?

whiteboard-teacher-video is a Claude Code agent skill that 图文讲解视频 skill:把知识讲解/科普/推导做成「手绘会动的画面」讲解视频——图形由代码逐笔绘出、文字逐字写出、讲到哪画到哪(音画对齐)。五套风格可选(白板/黑板/书卷/暖色插画/科技深色),29 个现成组件(图表、流程、仪表、终端、3D),本地 Chrome 渲染、零生图 API 成本、任何改动秒级重渲。当用户要做知识讲解视频、概念科普、图解动画,或要求「手绘动画」「讲动画」「图文视频」「explainer」「animación」时使用。触发词:讲解视频、科普视频、图解视频、手绘动画、讲动画、逐笔绘制、图文并茂的视频、explainer video、whiteboard teacher。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add liangdabiao/whiteboard-teacher-video

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Whiteboard Teacher Video

Turns a script into a video that "draws itself." The visuals are not generated images — they are code that draws line by line — so they can be re-rendered, fine-tuned, and have zero image generation cost.

Engine Contract (Understand This First)

The entire video is a pure function of time. ENGINE.renderAt(t) renders the frame at second t, independent of what played before.

This enables four capabilities, which are also the fundamental reason you must follow the discipline:

CapabilityRelies On
Changing one page only re-renders affected segmentsSegment cache key = sha1(engine + that page code)
12 browsers render in parallelEach segment is independent
Preview can jump to any pointNo need to play from start
Deterministic validationSame frame rendered twice, compare pixels

Red line: Page code must NOT use Math.random() / Date.now() / CSS transitions / rAF. Random must use PV.rng(seed), time must use P.c(i) / P.cw(i,'word'). Violating this breaks all four capabilities above.

Workflow (Follow Steps, Don't Skip)

User: "Make a 90-second video about relativity"
  ↓
① Read references/storyboard-method.md → write storyboard.json
② ★★★ STOP, read the storyboard to the user for confirmation ★★★   ← only mandatory human gate
③ Write script.js (voiceover, fill cues per storyboard)
④ python scripts/ftnew.py <project> --title "..." --style whiteboard
⑤ python scripts/ftvoice.py <project>        → voice.js + subtitles.srt
⑥ Write pages/pNN.js one by one              ← main creative work
⑦ python scripts/ftcheck.py <project>         → lint + snapshot per page
⑧ Open out/snap/pNN.jpg in Read, review page by page   → fix targeted issues, **no more than 2 rounds**
⑨ python scripts/ftrender.py --fps 24 --skip-subs   → **first rough cut**
⑩ ★ Deliver rough cut to user ★                     ← don't hoard it
⑪ Do one round of fixes from feedback → ftrender.py    → deliver final version

Step ② is NOT optional. If the storyboard is wrong, everything that follows is just a pretty slideshow. The original project made this a promise gate for a reason.

★★ Step ⑩ is equally important: ship first, polish later

The user wants a video, not a perfect video. Delivery cadence matters more than final polish.

  • In step ⑧, quality-check only until there are no obvious errors (lint errors gone, text not hidden, NaN resolved to 0). Don't chase perfect composition.
  • First render with --fps 24 --skip-subs (40% faster), give the user a watchable version first.
  • Don't finish all rounds of fixes before delivering. The user can only give real feedback on a rough cut.
  • Want to change style, add pages, adjust content? Just edit and re-render – segment caching makes the second round fast (1 minute per changed page in practice).

Real-world lesson: When making that 95-second, 8-page video, I agonized over whether lint-reported issues were worth fixing, did two rounds before delivering, and the user got impatient. Correct approach: Fix lint errors and obvious bugs, ship the rough cut, then fix the rest in one round.

★ Lint all green ≠ frame is correct

lint is a machine check; it only catches hard errors like off-canvas, overlap, or font size. Whether the composition looks good, elements are cramped, or text is hidden by a color block — you can only tell by looking at the snapshot.

Real-world lesson: Page 07 had 0 lint errors and all-green quality check, but the snapshot revealed that the word "microseconds" was completely hidden by a highlighter, leaving only the red "7" — the viewer couldn't read the unit.

Hard Rules

★ Cadence (Most Important)

  • The user wants a video, not a perfect video. A rough cut is still a video; hoarding it is the same as not having done anything.
  • Quality-check only until there are no obvious errors, don't chase perfect composition.
  • First render with --fps 24 --skip-subs (40% faster), ship the watchable version first.
  • Then do one round of fixes and deliver the final version. Segment caching makes the second round fast (1 minute per changed page in practice).

Visuals

  • Content area: x 140–1780, y 180–880. y > 900 is the subtitle strip, never place content there.
  • ★ Centered text must use w + align:'c' — without w, x is the left edge not the center. This is the most frequent mistake.
  • ★ On pages with P.push(), place elements toward the center of the frame — after zoom-in, edge text will overflow the canvas (lint reports off-canvas).
  • Body text font size ≥ 32px (< 24px fails lint).
  • At most 8 Chinese characters per screen.
  • Use only semantic color names: ink soft muted faint blue orange red green purple yellow; append F for light fill (blueF). NEVER hardcode hex — wrong names are logged by the engine and reported in the quality check.
  • One idea per page, 2–3 spoken sentences, with something new appearing every 2–4 seconds.

Animation

  • P.c(i, dt) = start of sentence i + dt seconds.
  • P.cw(i, 'word', dt) = when speaker reaches a specific word in sentence i + dt seconds (use for key numbers: the number appears exactly when spoken).
  • P.ce(i) = end of that sentence; P.endT = end of this page.
  • Use pen techniques for emphasis (ring, underline, mark highlighter, cross, check), NOT special effects.
  • At page transitions, there must be something on the page — never a blank frame.

Iteration

  • Change one page → only re-render that page (ftcheck.py --only pNN), not the whole thing.
  • If lint reports errors, don't render — fix them first.
  • Even if lint passes, still review the snapshot — lint only checks hard errors; it doesn't judge composition or occlusion.
  • ftcheck.py will report NaN — this is a fatal issue that lint can't always catch (the graphic silently disappears).
  • If you can't fix everything, mark it as "needs attention" and move on. Don't stall (max 2 rounds before shipping a video).

Reference Timings (local test, 8 pages, 87-second video)

StageTime
Create project + write 8 page drawing code~10 min (human creative time)
Voiceover for 26 sentences~1.5 min
Quality check (lint + 8 page snapshots)~1 min
Render (first time, 12 workers)~2 min 45 sec
Render (after changing one page, cache hit)~1 min
Render (--fps 24 --skip-subs fast mode)~1 min 40 sec

So from project creation to first rough cut: about 15 minutes total. Iteration on a single page takes one minute — so don't hoard all changes before delivering.

Three High-Frequency Pitfalls in the Engine API

// ① Centering text: without `w`, `x` is the left edge, not the center
P.text('Platform', { x: 420, y: 640, w: 280, align: 'c', size: 46 });   // ✓ center is at 420

// ② The third argument of check/cross is "size", not a config object (passing wrong type gives NaN without an error)
P.cross(970, 716, 64, { color: 'red', at: t });   // ✓
P.cross(970, 716, { color: 'red', at: t });      // ✗ sz = [object Object]

// ③ Don't name the callback parameter of liveRough 'R'; also R only has four methods: box/circle/line/path
const R = 1400;                                    // ← will be shadowed by callback parameter
P.liveRough((lt, R) => (xL + R) / 2);              // ✗ NaN
P.liveRough((lt, rough) => [rough.box(x, y, w, h, { color: 'ink' })]);  // ✓

Watch the console for NaN during rendering — it doesn't throw an exception, lint may not report it, but the corresponding graphic simply won't draw.

Full reference: references/page-api.md.

Can Do / Cannot Do

Can do: knowledge explanations, concept introductions, process walkthroughs, data charts & graphs, product demos (with real screenshots embedded), GitHub project walkthroughs; five visual styles; landscape/portrait; Chinese/English voiceover; auto-generated subtitles; videos from 20 seconds to 10 minutes.

Cannot do:

  • Photorealistic / 3D live-action style (for that quality, use a generative image tool)
  • Automatic background music and sound effects (page.sfx exists, but you must supply your own audio files)
  • Generative-style hand-drawn illustrations (all components are code-drawn vector graphics)
  • Generate dozens of pages at once (each page requires code; ≤ 12 pages recommended)

Difference from whiteboard-explainer

whiteboard-explainerframetell-video (this skill)
VisualsPixel-level stroke growthrough.js stylized drawing
StyleSingle (whiteboard, hardcoded background color)Five styles, including dark
ComponentsAll hand-written29 pre-built
Quality checkOwnership check onlylint + snapshot + deterministic
Best forMath derivation, strong hand-drawn feelScience explainers, chart-heavy, multiple styles

Need "true hand-drawn feel / element-by-element growth" → use whiteboard-explainer. Need "multiple styles / complex charts / component reuse / strong quality checks" → use this skill.

Documentation Index

When to readWhich doc
First time using this skillassets/example-relativity/ (complete source of a real finished video: 8 pages, read it and you'll understand)
Before drawing any pagereferences/page-api.md (drawing API quick reference + three high-frequency pitfalls)
When writing storyboard / voiceoverreferences/storyboard-method.md (five-act structure + taboos)
When choosing style / unsure about colorsreferences/style-packs.md (five styles + syntax card summary)
When script.js fields are unclearreferences/script-format.md
When voiceover fails / want to change TTSreferences/tts-backends.md (includes note that edge-tts is blocked)
When you don't understand engine errorsreferences/troubleshooting.md (indexed by symptom)

First Time Use

If scripts/ reports "engine not ready" or missing dependencies, run setup first:

python scripts/setup.py                                    # cross-platform
powershell -ExecutionPolicy Bypass -File scripts/setup.ps1  # Windows

Requirements: Node.js ≥ 22.19, Git, local Chrome/Edge, Python 3.9+

First time takes about 2–4 minutes: pulls the engine from GitHub (approx 16MB, sparse checkout only packages/engine) + npm install dependencies (approx 130MB).

If Git is not installed: manually download https://github.com/sitor-ai/frametell, copy packages/engine into the skill root as engine/, then run setup again.

Dependency list and sizes are in README.md; licensing info is in vendor/ATTRIBUTION.md.

相关技能