BookMorph Magic
Use this skill as a publishable template for book-to-content orchestration. It is not a private, fixed workflow.
What this template does
- - Takes one book or one episode-style request
- Produces a package of multi-format content
- Bundles the final outputs into a stable episode directory with a manifest
Typical outputs:
- - one video
- one audio file
- three cover images (
3:4, 4:3, 1:1) - one INLINECODE3
Important constraints
- - This is a template, not a turnkey SaaS workflow.
- To run end to end, you must provide 3 adapters:
-
book selector
-
longform content generator
-
cover generator
- - If you already have existing skills or scripts for those adapters, wire them to the contracts in
references/integration-template.md.
Inputs
- - A book file path, or
- A request containing one episode identifier such as
ep38, EP38, episode 38, or INLINECODE11
Output contract
- - Output root is configurable
- Episode directory prefix is configurable; default is INLINECODE12
- Stable output filenames:
-
epNN-video.<ext>
-
epNN-audio.<ext>
-
epNN-cover-3x4.<ext>
-
epNN-cover-4x3.<ext>
-
epNN-cover-1x1.<ext>
- INLINECODE18
Workflow
- 1. Parse the episode identifier with
scripts/episode_bundle.py parse-episode. - Create or reset the target episode directory with
prepare-dest. - Run your
book selector adapter until it chooses exactly one source book. - Run your
longform content generator adapter to produce a video and an audio output. - Run your
cover generator adapter to produce 3:4, 4:3, and 1:1 images. - Run
bundle to copy the final artifacts into the episode directory and write manifest.json.
Adapter requirements
Book selector
Must return enough information to identify one selected source:
- - book title
- author
- local source file path
- selection round or attempt count
- optional selector checkpoint path
Longform content generator
Must return:
- - video file path
- audio file path
- attempt count
- optional generator checkpoint path
Cover generator
Must return:
- - image path for INLINECODE29
- image path for INLINECODE30
- image path for INLINECODE31
- attempt count
- optional prompt archive path
- optional generator checkpoint path
Failure rules
- - If the episode number cannot be parsed, fail immediately.
- If no source book can be selected, stop and write a failed manifest.
- If longform media is incomplete, stop and write a failed or partial manifest.
- If any required cover image is missing, stop and write a failed or partial manifest.
Commands
CODEBLOCK0
References
- - Adapter contracts: INLINECODE32
- Manifest fields: INLINECODE33
BookMorph 魔法
将此技能作为可发布的书籍到内容编排模板使用。它不是一个私有的固定工作流。
此模板的功能
- - 接收一本书或一个剧集类请求
- 生成多格式内容包
- 将最终输出打包到稳定的剧集目录中,并附带清单文件
典型输出:
- - 一个视频
- 一个音频文件
- 三张封面图片(3:4、4:3、1:1)
- 一个 manifest.json 文件
重要约束
- - 这是一个模板,而非交钥匙式 SaaS 工作流。
- 要完整运行,您必须提供 3 个适配器:
- 书籍选择器
- 长内容生成器
- 封面生成器
- - 如果您已有针对这些适配器的技能或脚本,请将其连接到 references/integration-template.md 中的契约。
输入
- - 书籍文件路径,或
- 包含一个剧集标识符的请求,例如 ep38、EP38、episode 38 或 第38期
输出契约
- - 输出根目录可配置
- 剧集目录前缀可配置;默认为 episode-
- 稳定的输出文件名:
- epNN-video.
- epNN-audio.
- epNN-cover-3x4.
- epNN-cover-4x3.
- epNN-cover-1x1.
- manifest.json
工作流程
- 1. 使用 scripts/episode_bundle.py parse-episode 解析剧集标识符。
- 使用 prepare-dest 创建或重置目标剧集目录。
- 运行您的 书籍选择器 适配器,直到它精确选择一本源书籍。
- 运行您的 长内容生成器 适配器,生成视频和音频输出。
- 运行您的 封面生成器 适配器,生成 3:4、4:3 和 1:1 图片。
- 运行 bundle 将最终产物复制到剧集目录并写入 manifest.json。
适配器要求
书籍选择器
必须返回足够信息以识别所选源:
- - 书名
- 作者
- 本地源文件路径
- 选择轮次或尝试次数
- 可选的选择器检查点路径
长内容生成器
必须返回:
- - 视频文件路径
- 音频文件路径
- 尝试次数
- 可选的生成器检查点路径
封面生成器
必须返回:
- - 3:4 图片路径
- 4:3 图片路径
- 1:1 图片路径
- 尝试次数
- 可选的提示存档路径
- 可选的生成器检查点路径
失败规则
- - 如果无法解析剧集编号,立即失败。
- 如果无法选择源书籍,停止并写入失败清单。
- 如果长内容媒体不完整,停止并写入失败或部分清单。
- 如果缺少任何必需的封面图片,停止并写入失败或部分清单。
命令
bash
python3 {baseDir}/scripts/episode_bundle.py parse-episode --text 制作ep38内容 --output-root /abs/output/root
python3 {baseDir}/scripts/episode_bundle.py prepare-dest --episode 38 --clear-existing --output-root /abs/output/root
python3 {baseDir}/scripts/episode_bundle.py bundle --episode 38 --video /abs/video.mp4 --audio /abs/audio.m4a --image-3x4 /abs/3x4.png --image-4x3 /abs/4x3.png --image-1x1 /abs/1x1.png --book-title 示例书籍 --author 示例作者 --book-path /abs/book.epub --selector-adapter my-book-selector --selector-reference round-1 --selection-round 1 --longform-attempts 1 --cover-attempts 1 --prompt-archive /abs/prompts.md --output-root /abs/output/root
python3 {baseDir}/scripts/episode_bundle.py bundle --episode 38 --selection-round 3 --longform-attempts 0 --cover-attempts 0 --status failed --failure selector=no valid source book --output-root /abs/output/root
参考
- - 适配器契约:references/integration-template.md
- 清单字段:references/manifest-schema.md