From short-video-director
Queries dreamina video generation task status, downloads completed videos, handles failures with auto-retry or interactive user input. Invoke via /check-video ep01 [--auto].
npx claudepluginhub wddxh/shortvideodirectorThis skill is limited to using the following tools:
```
Creates cron-scheduled tasks to monitor video generation status from tasks.json, download completed videos, retry parallel-limit failures. Auto-stops on completion. Use /auto-video [ep|all].
Tracks Kling AI video generation task status via polling, batch tracking, timeouts. For dashboards, batch jobs, debugging stuck tasks on text2video/image2video endpoints.
Guides Video Generator CLI commands: npm run generate for fresh video renders, resume for interrupted jobs, segment for assembly fixes. Use after crashes or for script-based video workflows.
Share bugs, ideas, or general feedback.
/check-video ep01 # 交互模式,失败任务询问用户
/check-video ep01 --auto # 自动模式,只处理可自动重试的失败,跳过需人工介入的
/check-video all --auto # 自动模式,检查所有集
--auto):只处理可自动重试的失败任务,需人工介入的仅输出提示,不询问用户。由 auto-video 定时调用scripts/ 目录下的现有脚本。scripts/xxx.sh 找不到,使用 Glob 工具搜索 **/scripts/xxx.sh 找到插件目录下的脚本绝对路径。文件路径:story/episodes/{集数}/videos/tasks.json
每条记录包含以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| shot | number | 镜头编号(主键,从 1 开始) |
| submit_id | string | dreamina 返回的任务 ID(未提交时为 "") |
| status | string | pending(已登记未提交)/ submitted(等待结果)/ done(视频已下载)/ failed(生成失败) |
| prompt | string | 提交时使用的完整 prompt 文本 |
| images | string | 逗号分隔的参考图片路径列表 |
| duration | number | 视频时长(秒) |
| fail_reason | string | 失败原因(成功时为 "") |
完整示例(含所有 status):
[
{"shot": 1, "submit_id": "0a7fdfa1711442ee", "status": "done", "prompt": "### 镜头 1\n- **镜头类型:** 特写\n...", "images": "assets/images/characters/林知意.png,assets/images/locations/郊外泥地.png", "duration": 15, "fail_reason": ""},
{"shot": 2, "submit_id": "ba99c56731e2bf2a", "status": "submitted", "prompt": "### 镜头 2\n- **镜头类型:** 中景\n...", "images": "assets/images/characters/林知意.png", "duration": 15, "fail_reason": ""},
{"shot": 3, "submit_id": "", "status": "failed", "prompt": "### 镜头 3\n...", "images": "assets/images/characters/林知意.png", "duration": 15, "fail_reason": "ExceedConcurrencyLimit"}
]
写入规则:
$ARGUMENTS 中解析集数(如 ep01 或 all)和模式(是否有 --auto)all → 使用 Glob 扫描 story/episodes/*/videos/tasks.json;否则读取指定集的 tasks.jsonall 模式下 Glob 无匹配):
/generate-video {集数} 提交任务",结束--auto 模式:按"异常时的 JSON 输出"章节要求输出 JSON 摘要(recoverable=false,error 描述文件缺失),然后结束。不要仅输出人类可读的提示而跳过 JSON若 tasks.json 中存在 status 为 pending 的记录 → 输出一行提示:"检测到 {N} 个 shot 为 pending 状态(已登记未提交)。请运行 /generate-video {集数} 完成提交。本 skill 仅处理 submitted/done/failed。" → 继续处理其他状态的 shot。
对每个 status 为 submitted 且 submit_id 非空的任务:
bash scripts/video-check-dreamina.sh "{submit_id}" "story/episodes/{集数}/videos/shot{NN}.mp4"success → 将 status 改为 donefail:{原因} → 将 status 改为 failed,将 fail_reason 改为 {原因}querying → 不修改,仍为 submitted--auto 模式异常处理: 若 scripts/video-check-dreamina.sh 返回非预期输出或非零退出码,按"JSON 摘要契约 → 异常时的 JSON 输出"章节规则处理——记录 error(说明哪个 shot 查询失败),继续处理其他 shot,最终输出时标记 recoverable=true。不要因单个 shot 查询失败就跳出整个流程。
ls story/episodes/{集数}/videos/shot*.mp4 列出已有视频文件done → 将 status 改为 doneall 模式下跨所有集合计)--auto 模式额外要求:在本 skill 所有输出的最后一行追加一行 JSON 摘要,供自动化调用方(如 auto-video 的 sub-agent)解析。字段与填充规则见下方"JSON 摘要契约"章节。human_needed 列表在阶段 5 收集完毕后并入本 JSON。
交互模式(非 --auto)不输出 JSON,保持现状。
对每个 status 为 failed 的任务,按 skills/check-video/failure-classification.md 中的规则分类为"可自动重试"或"需人工介入"。每次失败都重新分类(同一镜头多次失败原因可能不同)。
a. 可自动重试的任务:
prompt、images、durationbash scripts/read-config.sh "即梦视频模型版本" 和 bash scripts/read-config.sh "视频比例"bash scripts/video-gen-dreamina.sh "{prompt}" "story/episodes/{集数}/videos/shot{NN}.mp4" "{images}" "{duration}" "{比例}" "{模型版本}"submitted、清空 fail_reasonfailed、更新 fail_reasonb. 需人工介入的任务:
自动模式(--auto):
{"ep": "{集数}", "shot": {镜头编号}, "reason": "{fail_reason 原文}"}human_needed 字段/check-video {集数} 手动处理交互模式(默认):
fail_reason 原文story/episodes/{集数}/script.md(短视频)或 story/episodes/{集数}/novel.md(系列视频),使用对应的 fix-storyboard skill(short-fix-storyboard 或 storyboarder-fix-storyboard)bash scripts/read-config.sh "图像模型" 获取图像模型值,调用 creator-fix-asset skill + creator-image-{图像模型值} skillfail_reason,判断最可能的原因并调用相应 skillbash scripts/storyboard-to-prompt.sh "story/episodes/{集数}/storyboard.md" {镜头编号}bash scripts/read-config.sh "即梦视频模型版本" 和 bash scripts/read-config.sh "视频比例"bash scripts/video-gen-dreamina.sh "{新prompt}" "story/episodes/{集数}/videos/shot{NN}.mp4" "{images}" "{duration}" "{比例}" "{模型版本}"/check-video {集数} 查询--auto 模式){
"target": "ep01",
"pending": 0,
"done": 12,
"submitted": 3,
"failed": 2,
"all_complete": false,
"human_needed": [
{"ep": "ep01", "shot": 5, "reason": "内容安全拦截"},
{"ep": "ep01", "shot": 9, "reason": "参数错误"}
]
}
| 字段 | 类型 | 说明 |
|---|---|---|
| target | string | 原样回传(epNN 或 all) |
| pending | number | "unknown" | 已登记未提交的数量(需用户运行 /generate-video 完成提交) |
| done | number | "unknown" | done 数量,all 模式下跨所有集合计 |
| submitted | number | "unknown" | 仍在排队的数量 |
| failed | number | "unknown" | 最终仍 failed(含需人工介入类) |
| all_complete | bool | (pending == 0) && (submitted == 0) && (failed == human_needed.length) |
| human_needed | array | 阶段 5 分类为"需人工介入"的 failed;每条 {"ep": "...", "shot": N, "reason": "fail_reason 原文"} |
| error | string | 仅异常时;简短错误描述(≤100 字) |
| recoverable | bool | 仅异常时;错误性质(见"异常时的 JSON 输出") |
"unknown"(不要填 0)all_complete 强制为 falsehuman_needed 在阶段 5 --auto 分支完成分类后填充all_complete 仅当 pending/done/submitted/failed 均为数字时才按公式计算;任一字段为 "unknown" 时强制 false--auto 模式)skill 在 --auto 模式下遇到任何异常(文件不存在、Glob 无匹配、tasks.json 格式损坏、脚本偶发失败等),仍必须输出 JSON 摘要,字段:
target:原样pending / done / submitted / failed:已统计到的填数字,完全无法统计的填字符串 "unknown"all_complete:false(强制)human_needed:[]error:简短错误描述(≤100 字,不要 dump 堆栈)recoverable:bool。按错误性质判断:
all 模式下没有任何 ep 目录)、tasks.json 格式彻底损坏需人工修复;后续调用仍会同样失败判定原则: LLM 按语义判断,不硬编码关键词。不确定时偏向 recoverable=true(保守)。
示例(tasks.json 不存在):
{"target":"ep99","pending":"unknown","done":"unknown","submitted":"unknown","failed":"unknown","all_complete":false,"human_needed":[],"error":"tasks.json 不存在:story/episodes/ep99/videos/tasks.json","recoverable":false}
示例(某 shot 查询脚本偶发失败,但其他 shot 已统计):
{"target":"ep01","pending":0,"done":10,"submitted":2,"failed":1,"all_complete":false,"human_needed":[],"error":"shot 3 查询脚本返回非预期输出","recoverable":true}
不得因异常跳过 JSON 输出——自动化调用方依赖它判断 cron 生命周期。