web-video-presentation
Converts articles, voiceover scripts, or pre-sliced comic panels into click-driven 16:9 web presentations that look like videos, automatically synthesizing voiceover audio by default once HTML verification passes. Workflow: Source article / voiceover script / panels manifest → **one-shot generation** of voiceover script + outline dev plan → user **aligns once** on script / outline / assets / dev mode → web development (chapter-by-chapter / sequential / parallel) → automated audio synthesis (defaulting to Volcengine/Doubao TTS, Liu Fei 2.0). Phase 1 scriptwriting exclusively references `references/CODE-GARDEN-VOICEOVER.md`; no other writing rules are used. Comic Panels Mode is designed for motion comic HTML videos based on `manifest.json + panel_*.png`: each panel can be split into 1–N steps featuring camera zooms, focal punch-ins, dialogue/subtitles, and transitions. Best suited for: web videos, animated slide decks, motion comic HTML editions, technical tutorials, and talk demo screen recordings. The default visual anchor is the d2-editorial-grid paper archive editorial style; users can explicitly switch to other themes.
1How It Works & Mechanism
The final deliverable is a 'screen-recordable video disguised as a webpage': a Vite + React + TS project paired with chapter-sliced audio, triggering automatic voiceover synthesis by default after HTML verification passes.
把一篇文章或口播稿,一步步做成可录屏的"伪装成网页的视频",HTML 验证完成后默认直接合成口播音频。产出物 = Vite + React + TS 项目 + 按章节切分的音频。
narrations.ts serves as the single source of truth for step counts and audio synthesis: the maximum step referenced in chapter code + 1 must strictly equal narrations.length.
> **关键**:`narrations.ts` 是 step 数和音频合成的**唯一真相源**。
Enforces a mandatory self-check protocol across three artifacts (script.md, outline.md, and single-chapter implementations), requiring failed checks to be resolved before reporting.
下面三个产出,每一个**完成后必须走自检 → 修复 → 再汇报 / 推进**:
The outline deliberately omits animation specifics: hardcoding animations degrades chapter agents into translation engines, whereas creative leeway produces genuine video pacing.
> **outline 不写动画的理由**:写死动画 = chapter agent 退化为翻译机;
The Checkpoint Plan acts as a hard milestone: script, outline, assets, and development mode are aligned in a single pass; default theme is d2-editorial-grid.
## Checkpoint Plan —— 4 件事一次对齐(**硬节点**)
Chapter 1 enforces main-thread execution and user sign-off: it establishes the initial baseline for CHAPTER-CRAFT guidelines under the chosen theme/topic and serves as the visual code anchor for subsequent chapters.
**第 1 章无论哪种模式都必须主线程做完 + 用户验收**(强制 anchor)。
Phase 3 proceeds directly to audio synthesis without pausing to ask: once all HTML passes verification, audio synthesis initiates automatically, halting only under four exceptions (explicit user refusal, missing auth, or switching to local TTS).
**默认不要停下来问是否合成音频**。Phase 2 全部 HTML 已完成且验证通过后, agent 直接进入本阶段。
Default TTS configuration is hardcoded to Volcengine/Doubao: engine=volcengine, seed-tts-2.0, voice_type zh_male_liufei_uranus_bigtts, speed 1.2, speech_rate 20.
engine=volcengine resource_id=seed-tts-2.0 voice_type=zh_male_liufei_uranus_bigtts voice_name=刘飞 2.0 speed=1.2 speech_rate=20
Phase 4 defaults to automated CDP screen recording and explicitly prohibits using screencli (which launches AI agents and burns tokens).
默认不要用 screencli 做本流程:它会启动 AI agent、消耗 tokens
Visuals are guided by an index of ten one-sentence principles (fixed 16:9 stage, global step counter, full-screen step occupancy, voiceover beat = step, content-driven animation, progressive reveal, dual-source principle, etc.).
| 10 | 双源原则 | script 定节拍,**article 定画面密度**(落到信息池) |
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| cli | npm / Vite 脚手架与依赖安装(npm create vite、npm install、npm install --save-dev tsx puppeteer-core、npx tsc --noEmit) |
| api | 火山/豆包语音合成(默认引擎;鉴权仅从环境变量读,curl 调 unidirectional 接口) |
| api | MiniMax CLI(可选 TTS 路径,走 mmx auth login --api-key;key 在平台获取) |
| cli | MeloTTS 本地路径(可选:调 ../../.venv-tts/bin/melotts 生成 wav 再用 ffmpeg 转 mp3) |
| package | puppeteer-core + 本机 Chrome(CDP 录屏与字幕烧录;headless 启动参数不含任何反自动化绕过) |
| network | Google Fonts(主题 CSS 引用,浏览器端/录屏期拉取)与本地 dev server 端口 |
4Recommended Governance & Evidence
- scripts/: Executes local scripts or commands: bash scripts/scaffold.sh <target> [--theme=…] (npm create vite + npm install)
- scripts/ 或 SKILL.md: Declares dynamic installation of external language package dependencies
- 网络端点: Declares outbound network access: https://openspeech.bytedance.com/api/v3/tts/unidirectional (default Volcengine/Doubao TTS, POST)
- 本地工作目录: File read/write and artifact output: generated presentation/ project (complete Vite + React + TS source code, package.json, vite.config.ts, tsc)
5Second-Pass Verification
- [ok] TTS 凭证读取与外发是否真实(橙档关键证据) — synthesize-audio.sh 原文:'# 2. DOUBAO_TTS_API_KEY or VOLCENGINE_TTS_API_KEY for default Volcengine/Doubao TTS';'DEFAULT_VOLCENGINE_ENV_FILE="$HOME/.config/doubao-tts/env"';缺失时 source 该文件;取到后作为鉴权头 curl 到 https://openspeech.bytedance.com/api/v3/tts/unidirectional。调用点与降级说明(AUDIO.md 的「缺少 API Key 时不要假装合成成功」)一致。
- [ok] 是否存在反自动化绕过或安全降级(红档排除) — record-cdp-screencast.mjs 的 puppeteer.launch 只有 headless: true 与 args=[--autoplay-policy=no-user-gesture-required, --hide-scrollbars, --window-size=…],无 AutomationControlled、无 remote-allow-origins=*、无 webdriver 伪装;全目录 grep --no-verify / --sandbox / dangerouslyDisableSandbox 零命中。CDP 只连本机回环页面(默认 http://127.0.0.1:5175/?auto=1&record=1&autostart=1)。
- [discrepancy] 「默认不停下问」会不会导致未经同意的付费合成 — [判定:设计取舍,非缺陷]SKILL.md 明写 '**默认不要停下来问是否合成音频**。Phase 2 全部 HTML 已完成且验证通过后,agent 直接进入本阶段。',并列出四种收口例外(用户说不要/鉴权缺失/换本地 TTS)。即:默认路径会消耗 TTS 账号额度且不再二次确认——属有意的流程设计(音频是一镜到底前提),但使用者应在开始前知情并配好额度与凭证。
- [ok] 脚手架是否真的安装 puppeteer-core(录屏能力来源) — scripts/scaffold.sh 内含 `npm install >/dev/null 2>&1` 与 `npm install --save-dev tsx puppeteer-core >/dev/null 2>&1`,随后跑 `npx tsc --noEmit` 自检;即录屏/字幕脚本的依赖由脚手架负责安装,而非假定全局存在。
- [unlocatable] 并行章节开发(模式 C)带来的风格与质量分散 — 文档声称主题 token 兜底、章节 CSS 物理隔离、风格不一致等于「人手写视频的呼吸感」;但 pin 仓库内没有多章并行产出的成品或验收记录可用于验证该主张,本次只读侦查不运行生成,故仅作「文档声明」记录,不当作已核事实。
- [ok] 「?auto=1 一镜到底」的机制描述是否与代码一致 — AUDIO.md 与 build-master-audio.mjs 的描述一致:分段合成后拼成 master.mp3 + timeline.json,运行时 Auto 模式优先播 master 音轨并按 timeline 驱动 HTML 节点;RECORDING.md 的 CDP 路径以 --audio=<normalized master> 复用同一条母版,避免分段交接造成尾字截断。
6Verdict & Scenarios
6c6b9cedf0142114…