Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "open-video-harness",
"interface": {
"displayName": "OpenVideoHarness"
},
"plugins": [
{
"name": "open-video-harness",
"source": {
"source": "local",
"path": "./plugins/open-video-harness"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}
]
}
22 changes: 22 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "open-video-harness",
"owner": {
"name": "ZLHad",
"url": "https://github.com/ZLHad"
},
"description": "OpenVideoHarness: a controllable workflow for making videos with code.",
"plugins": [
{
"name": "open-video-harness",
"source": "./plugins/open-video-harness",
"description": "Make videos with code through the OpenVideoHarness workbench: say what film you want, an agent writes the code, renders it, checks it and stops for you at the decisions that are yours. This plugin is the pointer; on first use it asks before installing the workbench.",
"category": "productivity",
"tags": [
"video",
"animation",
"video-as-code",
"explainer"
]
}
]
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

**写到别人的工作时**:真在用的库和工具,在讲用法的地方照常写,README 的致谢里一行一个。只看过、学过的作品、仓库、帖子和作者,不在主文档里署名,正文直接讲做法("本仓库没有实测"这类提醒照留),名字和学了什么记进 [ACKNOWLEDGMENTS.md](ACKNOWLEDGMENTS.md) 的"参考过的作品"。复制或改写进来的代码和文字,许可要求的声明放在许可要求的地方(例如 `recipes/` 每个文件的"许可"一段和 `NOTICE.md`)。事实的出处照硬规则 5 照写;`cases/` 只记作品本身,不写账号和来源。

`skills/` 里的 skill 不在这四样里,但它是别的宿主进来的门:`bin/vh install-skill` 装出去的是短桩,只带 frontmatter 和克隆的路径,正文让 agent 回克隆里读 `skills/<名字>/SKILL.md`,所以改正文 `git pull` 就到了。改了 frontmatter(`name`、`description`,宿主靠它触发)、改了 `tools/skill_stub.md`、加了或改名了一个 skill,已装的桩要重写:变更记录里写一句要跑 `bin/vh install-skill`(它也会删掉自己为已经没有的 skill 写过的桩),`bin/vh doctor` 的 `skills` 行也会报。
`skills/` 里的 skill 不在这四样里,但它是别的宿主进来的门:`bin/vh install-skill` 装出去的是短桩,只带 frontmatter、克隆的路径和最后一行记号,正文让 agent 回克隆里读 `skills/<名字>/SKILL.md`,所以改正文 `git pull` 就到了。改了 `skills/` 里的任何东西,都要跑一次 `bin/vh sync-agents`:插件(`plugins/open-video-harness/`)带着每个 skill 目录的完整副本,版本号跟着加一,CI 核对。改了 frontmatter(`name`、`description`,宿主靠它触发)或 `tools/skill_stub.md`,已装的、没人改过的桩会在下次打开 Studio 时自己重写;加了或改名了一个 skill,变更记录里写一句要跑 `bin/vh install-skill`(它也会删掉自己为已经没有的 skill 写过的桩),`bin/vh doctor` 的 `skills` 行也会报。

## 推送前自查:`tools/ci.sh`

Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,22 @@ bash install.sh --no-icon # leave OVH Studio out of your
- The showcase videos aren't in git; to rebuild a showcase locally, `tools/fetch_media.sh` downloads them from the release to where its scripts expect them.
- The first render and the first use of the sound tools download more into `~/.cache`: Chrome about 200 MB, the sound tools' Python packages about 0.7 GB, and the default local voice about 2.6 GB (its packages 0.8 GB, its model 1.8 GB), which `bin/vh tts` says before it starts and shows the progress of (`--provider edge` needs only a small package). The local Whisper behind `--align local` is about 3.6 GB more, said the same way (measured 2026-11; where each goes is on the wiki's [Getting Started](https://github.com/ZLHad/OpenVideoHarness/wiki/Getting-Started)). Where the official sources are blocked: the installer tries the official npm registry, Hugging Face and Google's storage first (twice each), and when one does not answer and its mainland-China mirror does, it switches to the mirrors (npmmirror, Tsinghua's TUNA, hf-mirror, listed in `tools/mirrors.txt`) and says which and why. From then on the downloads `bin/vh` starts follow: npm, Python packages, the local voice's model, Electron, the Chrome renders use, and an agent's own `npm` or `uv` in a session Studio started. A registry you set yourself (an `.npmrc`, a `uv.toml`, the variable) stays yours. `bin/vh settings mirror off` turns it off; installed before this, `bin/vh settings mirror cn` turns it on. Not covered: GitHub (the clone itself, `references/fetch.sh`, `--obscura`), `bin/vh hf add`, `bin/vh hdri` (Poly Haven) and the Google Fonts the hand-drawn engine's studio page loads. More on the wiki's [China network](https://github.com/ZLHad/OpenVideoHarness/wiki/China-Network) page.

Skill only: `npx skills add https://github.com/ZLHad/OpenVideoHarness --skill open-video-harness`. It's a pointer: on first use it asks before installing the full workbench. That copy stays as it was when the repo changes; once the workbench is installed, `bin/vh install-skill` replaces it with a stub that follows the clone.
Skill only, as a plugin of the agent's (two shell commands each; `--sparse` fetches the plugin's own folders, about 2 MB, not the whole repo):

```bash
claude plugin marketplace add ZLHad/OpenVideoHarness --sparse .claude-plugin plugins/open-video-harness
claude plugin install open-video-harness@open-video-harness
```

```bash
codex plugin marketplace add ZLHad/OpenVideoHarness --sparse .agents/plugins --sparse plugins/open-video-harness
codex plugin add open-video-harness@open-video-harness
```

Or `npx skills add https://github.com/ZLHad/OpenVideoHarness --skill open-video-harness`. Each is a pointer: on first use it asks before installing the workbench itself (the clone above).
- **Updates.** The plugin changes only when its version does, and that happens when the skills change. Claude Code takes a new one after `claude plugin marketplace update open-video-harness` and `claude plugin update open-video-harness@open-video-harness`. Codex takes it after `codex plugin marketplace upgrade`, then `codex plugin add open-video-harness@open-video-harness` again.
- **The `npx skills add` copy stays as it was.** Once the workbench is installed, `bin/vh install-skill` writes stubs that follow the clone, and `bin/vh doctor` says the copy is there.
- **With both the plugin and the installer's stubs**, an agent lists the skill twice (`open-video-harness` and `open-video-harness:open-video-harness`). Both reach the same workbench. To keep one, remove the plugin (`claude plugin uninstall open-video-harness@open-video-harness`, `codex plugin remove open-video-harness@open-video-harness`), or install with `--no-skill`.

## Where things are

Expand Down
17 changes: 16 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,22 @@ bash install.sh --no-icon # 不把 OVH Studio 放进应
- 样片的视频不在 git 里,要在本地复现样片时运行 `tools/fetch_media.sh`,它从 Release 下载到脚本要的位置。
- 第一次渲染、第一次用声音工具时还会往 `~/.cache` 下载:Chrome 约 200 MB,声音工具的 Python 依赖约 0.7 GB,默认的本地配音约 2.6 GB(依赖 0.8 GB、模型 1.8 GB;`bin/vh tts` 开始前会先说,并显示进度;`--provider edge` 只要一个小包);`--align local` 用的本地 Whisper 另需约 3.6 GB,同样先说(2026-11 实测;各放在哪里见 wiki 的[快速开始](https://github.com/ZLHad/OpenVideoHarness/wiki/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B))。国内网络:安装时先试官方的 npm 源、Hugging Face 和 Google 的存储(各试两次),哪个连不上、它的国内镜像连得上,就改用国内镜像(npmmirror、清华 TUNA、hf-mirror,列在 `tools/mirrors.txt`),并说明是哪个、为什么。之后 `bin/vh` 起的下载都跟着走:npm、Python 包、本地配音模型、Electron、渲染用的 Chrome,还有 Studio 起的 agent 自己跑的 `npm`、`uv`。你自己设过的源(`.npmrc`、`uv.toml` 或那个变量)不动。`bin/vh settings mirror off` 关掉;这之前装的,`bin/vh settings mirror cn` 打开。不走镜像的:GitHub(克隆本身、`references/fetch.sh`、`--obscura`)、`bin/vh hf add`、`bin/vh hdri`(Poly Haven),以及手绘引擎的 studio 页面加载的 Google Fonts。其余细节见 wiki 的[国内网络](https://github.com/ZLHad/OpenVideoHarness/wiki/%E5%9B%BD%E5%86%85%E7%BD%91%E7%BB%9C)。

只装 skill:`npx skills add https://github.com/ZLHad/OpenVideoHarness --skill open-video-harness`。它只是一个指针,第一次用时会征得你同意,再把完整的工作台装好。这样装的是整份副本,仓库更新了它不变;工作台装好以后跑一次 `bin/vh install-skill`,换成跟随克隆的短桩。
只装 skill,作为 agent 的插件装(各两条终端命令;`--sparse` 只取插件自己的目录,约 2 MB,不拉整个仓库):

```bash
claude plugin marketplace add ZLHad/OpenVideoHarness --sparse .claude-plugin plugins/open-video-harness
claude plugin install open-video-harness@open-video-harness
```

```bash
codex plugin marketplace add ZLHad/OpenVideoHarness --sparse .agents/plugins --sparse plugins/open-video-harness
codex plugin add open-video-harness@open-video-harness
```

也可以 `npx skills add https://github.com/ZLHad/OpenVideoHarness --skill open-video-harness`。装上的都只是指针:第一次用时先征得你同意,再装工作台本身(就是上面那份克隆)。
- **更新**:插件只在版本号变了的时候更新,版本号只在 skill 改了的时候变。Claude Code 先 `claude plugin marketplace update open-video-harness`,再 `claude plugin update open-video-harness@open-video-harness`;Codex 先 `codex plugin marketplace upgrade`,再重新 `codex plugin add open-video-harness@open-video-harness`。
- **`npx skills add` 装的副本不会跟着变**:工作台装好以后,`bin/vh install-skill` 会写跟随克隆的短桩,`bin/vh doctor` 也会提到那份副本。
- **插件和安装脚本的短桩都装了时**,agent 里会列出两个(`open-video-harness` 和 `open-video-harness:open-video-harness`),走到的是同一个工作台。只留一个的话,卸掉插件(`claude plugin uninstall open-video-harness@open-video-harness`、`codex plugin remove open-video-harness@open-video-harness`),或者安装时加 `--no-skill`。

## 文档地图

Expand Down
64 changes: 52 additions & 12 deletions bin/vh
Original file line number Diff line number Diff line change
Expand Up @@ -182,35 +182,66 @@ shell_folder() { # shell_folder <cache dir> [version]: the folder of that chrome
return 1
}
agents_body() { cat "$ROOT/CLAUDE.md"; }
stub_write() { # stub_write <folder> <name>: the stub for skills/<name> into <folder>/<name>/SKILL.md, as doctor.py --stub renders it
# (the skill's frontmatter, tools/skill_stub.md with the name and this clone, and the mark: install-skill's, untouched), through a
# temporary file moved into place. Fails, saying nothing, when it cannot be written
local d=$1 n=$2 tmp
mkdir -p "$d/$n" 2>/dev/null || return 1
tmp=$(mktemp "$d/$n/.SKILL.md.XXXXXX" 2>/dev/null) || return 1
python3 "$ROOT/tools/doctor.py" --stub "$n" "$ROOT" > "$tmp" 2>/dev/null && mv "$tmp" "$d/$n/SKILL.md" 2>/dev/null || { rm -f "$tmp"; return 1; }
}
cmd_install_skill() { # writes a stub for each skill in skills/: its frontmatter (what a host triggers on), this clone as the harness
# path, and a few lines that send the agent to <clone>/skills/<name>/SKILL.md, so a git pull updates what every host reads.
# tools/skill_stub.md is the stub's text; tools/doctor.py (skills_check) renders the same to compare with what is installed.
# Line ends come out LF from a CRLF checkout too (tr -d '\r'). A stub this clone wrote for a skill skills/ no longer has is
# removed: one whose Harness path line names this clone, alone in its folder; anything else there is left as it is
local which=${1:-all} dests=() d s n t body f line
# path, and a few lines that send the agent to <clone>/skills/<name>/SKILL.md, so a git pull updates what every host reads; last a
# line that marks it as install-skill's (doctor.py: skill_stub, stub_state). A stub this clone wrote for a skill skills/ no longer
# has is removed: one whose Harness path line names this clone, alone in its folder; anything else there is left as it is.
# Exit 1 when a stub could not be written
local which=${1:-all} dests=() d s n f line rc=0
case "$which" in claude) dests=("$HOME/.claude/skills") ;; codex) dests=("$HOME/.agents/skills") ;; all) dests=("$HOME/.claude/skills" "$HOME/.agents/skills") ;;
*) echo "usage: bin/vh install-skill [claude|codex|all] (unknown target: $which)" >&2; exit 2 ;; esac
t=$(tr -d '\r' < "$ROOT/tools/skill_stub.md")
line="Harness path (set by install.sh): $ROOT"
for d in "${dests[@]}"; do
for s in "$ROOT"/skills/*/SKILL.md; do
n=$(basename "$(dirname "$s")")
body=${t//@NAME@/"$n"}; body=${body//@HARNESS@/"$ROOT"} # quoted replacements: an & in the path stays an &
mkdir -p "$d/$n"
{ tr -d '\r' < "$s" | awk 'NR == 1 && $0 == "---" { f = 1; print; next } f { print; if ($0 == "---") exit }'; printf '%s\n' "$body"; } > "$d/$n/SKILL.md"
echo "$c_ok skill → $d/$n/SKILL.md (a stub that reads $ROOT/skills/$n/SKILL.md)"
if stub_write "$d" "$n"; then echo "$c_ok skill → $d/$n/SKILL.md (a stub that reads $ROOT/skills/$n/SKILL.md)"
else echo "$c_no $d/$n/SKILL.md could not be written (is $d writable?)" >&2; rc=1; fi
done
for f in "$d"/*/SKILL.md; do
[ -f "$f" ] || continue
n=$(basename "$(dirname "$f")")
[ -f "$ROOT/skills/$n/SKILL.md" ] && continue
tr -d '\r' < "$f" | grep -qxF "$line" || continue # not this clone's: someone else's skill, or another clone's
[ "$(ls -A "$(dirname "$f")")" = SKILL.md ] || { echo "! $f was written for this clone, but skills/ has no $n now; other files are beside it, so it is left: remove it yourself" >&2; continue; }
rm "$f" && rmdir "$(dirname "$f")" && echo "$c_ok removed $d/$n (skills/ has no $n now)"
if rm "$f" && rmdir "$(dirname "$f")"; then echo "$c_ok removed $d/$n (skills/ has no $n now)"; else rc=1; fi
done
done
echo " restart Claude Code / Codex so it picks up the skill; then ask for a video from any folder."
echo " a git pull here updates the skill; run this again only when bin/vh doctor's skills line says so (a renamed skill, a new one, a changed description)."
return $rc
}
cmd_studio() { # stdlib only; the desk it starts runs under this same bash. Before it opens (not for -h or the icon's own
# status, install and removal), this clone's stubs that are behind are written again (skills_refresh), quietly for
# --print-address and --json, whose output is read by a program
export OVH_BASH=$BASH
case " $* " in *" -h "*|*" --help "*|*" --icon-status "*|*" --install-icon "*|*" --remove-icon "*) ;;
*" --print-address "*|*" --json "*) skills_refresh quiet ;; *) skills_refresh ;; esac
exec python3 "$ROOT/tools/desk/studio.py" "$@"
}
skills_refresh() { # skills_refresh [quiet]: before Studio opens, the stubs install-skill wrote for this clone and nobody changed
# since, that are behind skills/ (a changed description, a stub of the shape before the mark), written again; only those files
# (tools/doctor.py --stale-skills): never a skill folder of someone else's, a whole copy (npx skills add), a stub edited by hand
# or one pointing at another clone, and no skill added that was not installed for that host. One line on stderr when it wrote
# something or could not; none otherwise, and none with quiet
local f n w=0 no=0
while IFS= read -r f; do
[ -n "$f" ] || continue
n=$(basename "$(dirname "$f")")
[ -f "$ROOT/skills/$n/SKILL.md" ] || continue
if stub_write "$(dirname "$(dirname "$f")")" "$n"; then w=$((w + 1)); else no=$((no + 1)); fi
done < <(python3 "$ROOT/tools/doctor.py" --stale-skills 2>/dev/null)
[ "${1:-}" = quiet ] && return 0
[ $w = 0 ] || echo "skills: $w stub$([ $w = 1 ] || echo s) this clone wrote brought up to date (restart Claude Code or Codex to see them)" >&2
[ $no = 0 ] || echo "skills: $no stub$([ $no = 1 ] || echo s) could not be written; bin/vh doctor says which" >&2
return 0
}
cmd_settings() { # this machine's settings (tools/settings.py, -h); the mirror turned on also fetches HyperFrames' Chrome from it now,
# since HyperFrames cannot be pointed at a mirror itself
Expand All @@ -232,6 +263,15 @@ cmd_sync_agents() { # CLAUDE.md's 命令行 line from tools/commands.json first,
echo
agents_body; } > "$ROOT/AGENTS.md"
echo "$c_ok AGENTS.md regenerated from CLAUDE.md"
# the plugin Claude Code and Codex install from this repo's marketplace (.claude-plugin/, .agents/plugins/) carries a copy
# of each skill: a plugin is copied into the host's cache whole, so it cannot point back into skills/ (tools/ci.sh holds them equal)
local plug="$ROOT/plugins/open-video-harness/skills" s n d v
[ -d "$ROOT/plugins/open-video-harness" ] || return 0 # (a copy of bin/vh without the plugin: nothing to copy into)
for s in "$ROOT"/skills/*/SKILL.md; do # each skill's whole folder, so a skill with files beside its SKILL.md ships whole
[ -f "$s" ] || continue; n=$(basename "$(dirname "$s")"); rm -rf "${plug:?}/$n"; mkdir -p "$plug"; cp -R "$(dirname "$s")" "$plug/$n"; done
for d in "$plug"/*/; do [ -d "$d" ] || continue; n=$(basename "$d"); [ -f "$ROOT/skills/$n/SKILL.md" ] || rm -rf "$d"; done
v=$(python3 "$ROOT/tools/plugin_version.py" --write) || exit 1 # the version moves when, and only when, the skills do
echo "$c_ok plugins/open-video-harness/skills/ copied from skills/ (the plugin the marketplaces install; version $v)"
}

cmd_setup() {
Expand Down Expand Up @@ -1555,7 +1595,7 @@ case "${1:-help}" in
review) shift; cmd_review "$@" ;;
concept) shift; cmd_concept "$@" ;;
desk) shift; cmd_desk "$@" ;;
studio) shift; export OVH_BASH=$BASH; exec python3 "$ROOT/tools/desk/studio.py" "$@" ;; # stdlib only; the desk it starts runs under this same bash
studio) shift; cmd_studio "$@" ;; # stdlib only; the desk it starts runs under this same bash
gate) shift; cmd_gate "$@" ;;
commands) shift; exec python3 "$ROOT/tools/commands.py" list "$@" ;; # read-only, not logged
artifacts) shift; exec python3 "$ROOT/tools/artifacts.py" "$@" ;; # read-only, not logged; stdlib only
Expand Down
Loading
Loading