Skip to content

feat(b-roll): add video-add-b-roll skill - #18

Merged
ZhangchengCharles merged 67 commits into
mainfrom
docs/video-add-b-roll-design
Jul 27, 2026
Merged

ZhangchengCharles merged 67 commits into
mainfrom
docs/video-add-b-roll-design

Conversation

@ZhangchengCharles

Copy link
Copy Markdown
Collaborator

What changed

Adds video-add-b-roll, a new skill that places selective, transcript-timed visual cutaways into an understood Project Protocol V1 sequence.

  • New skill — SKILL.md playbook, reference/broll-rules.md, an example plan, the local candidate review page, and five scripts: broll_plan.py, pexels.py, build_review_page.py, normalize_broll.py, check_broll.py, with a 154-test suite.
  • Acquisition — Pexels search/download plus import-local for your own or externally generated footage. Every candidate is frozen with a real probe, byte count, SHA-256, and provenance; downloads validate redirects, hosts, size, and media before atomic publication, and .part recovery is owned by the downloader.
  • Two-stage review — an exact-candidate review that must decide every shot once, then a completed visual review bound by SHA-256 to the plan, stills, contact sheet, boundary reel, machine summary, and final delivery. Human and explicitly delegated Agent modes are both valid; neither can be fabricated from silence.
  • Shared protocol — projectlib.py gained b-roll plan and receipt validation, dependency-revision coverage, and image-sequence overlay checks. The operation adds a b-roll track and changes video pixels only, leaving timeline, geometry, and audio untouched.
  • Docs — registered the skill in CLAUDE.md/AGENTS.md and the README, and documented the repo's runnable test suites and check_* harnesses, which were previously undocumented.
  • Also on this branch (predates the b-roll work): the video-rough-cut → video-cut rename and the ClawHub publish workflow.

Why it changed

Talking-head, interview, and explanatory videos need a small number of evidence-backed cutaways. Doing that by hand means unverifiable provenance and no record of who approved which shot. This makes the shot list a reviewable, diffable plan and refuses to guess: missing, weak, or downloader-rejected media becomes skipped, and an approved all-skipped plan is a valid no-op rather than an excuse to drop in generic filler.

How it was checked

  • python -m unittest skills/video-add-b-roll/tests/test_broll.py — 154 tests, OK
  • skills/video-cut/tests/test_inspect_bounds.py — 6 tests, OK
  • skills/video-edit-compare/tests/test_make_compare.py — 1 test, OK
  • check_protocol_extensions.py plus the cut and captions protocol checkers — all passed
  • Confirmed the supported Pexels endpoint is api.pexels.com/v1/videos/search (the unversioned path is deprecated) and that both routes returned identical live payloads before switching
  • Fixed a doc/code break found while reviewing: complete_visual_review() required a fifth comparison argument that the playbook no longer passes, which raised TypeError for anyone following SKILL.md. Since SKILL.md is the spec, the code, compiler contract, and fixtures moved to match.

Notes for review

Two known issues, both pre-existing and deliberately left out of scope:

  1. skills/video-to-shorts/scripts/check_review_ui.py has 2 failures (fake_render() missing video_preset). They reproduce identically with this branch's changes stashed.
  2. video-add-b-roll and video-add-content-cards both publish under review/03-. The README now reflects that real behaviour rather than hiding it. Renumbering isn't a docs change — b-roll has 54 references to review/03-b-roll, and those paths are SHA-256-bound in review receipts, so it needs its own commit.

The branch is named docs/ but the diff is mostly feat; the branch predates the feature work landing on it.

ZhangchengCharles and others added 29 commits July 23, 2026 19:15
What changed:
- Add `video-add-b-roll` to the skills table and shared protocol section,
  including the canonical `cut -> color-grade -> b-roll -> content-cards ->
  captions` order and its plan path.
- Document the runnable test suites and `check_*` regression harnesses, with
  single-test invocations and the known pre-existing `check_review_ui.py`
  failures.
- Record the skill-local `.env` rule for `PEXELS_API_KEY`.
- Note that CLAUDE.md and AGENTS.md are no longer hardlinked and must be
  edited together; gitignore `.env`.

Why it changed:
The b-roll skill shipped without being registered in the agent playbook, and
the commands section understated what is actually runnable, so agents rebuilt
that knowledge each session.

How it was checked:
Ran every documented command and recorded the real results. The protected Git
section is byte-for-byte unchanged; CLAUDE.md and AGENTS.md verified identical
with cmp.
What changed:
- Drop the required `comparison` argument from
  `check_broll.complete_visual_review()` and stop binding the source-time
  comparison in the receipt, report, and compiler artifact contract in
  `projectlib`.
- Update `pexels.py` to the supported `api.pexels.com/v1/videos/search` path
  (the unversioned path is deprecated) and send an explicit User-Agent on
  search and download.
- Refresh the SKILL.md playbook and the affected tests and fixtures.

Why it changed:
The playbook no longer runs `video-edit-compare` before the b-roll visual
review, but the code still demanded a fifth positional argument. Any agent
following SKILL.md hit `TypeError: complete_visual_review() missing 1 required
positional argument: 'comparison'`, and the compiler rejected receipts whose
artifact set omitted it. SKILL.md is the spec, so the code moved to match.

How it was checked:
- `python -m unittest skills/video-add-b-roll/tests/test_broll.py` — 154 tests, OK
- `skills/video-cut/tests/test_inspect_bounds.py` — 6 tests, OK
- `skills/video-edit-compare/tests/test_make_compare.py` — 1 test, OK
- `check_protocol_extensions.py`, plus the cut and captions protocol
  checkers — all passed
- Verified both Pexels routes return identical live payloads before switching
- `check_review_ui.py` has 2 failures that reproduce identically with these
  changes stashed; pre-existing and out of scope
What changed:
- Add a B-roll feature bullet and a `/video-add-b-roll` row to the skills
  table, following the existing wording and ordering.
- Name the skill in the Quick Start example prompt and note that stock footage
  needs `PEXELS_API_KEY` in `skills/video-add-b-roll/.env`, with local import
  as the no-key path.
- Add `review/03-b-roll/` and `work/b-roll/` to the project layout.

Why it changed:
This branch ships the b-roll skill, but the README still described the stack
without it.

How it was checked:
Cross-checked every documented path against the paths the scripts actually
write. Skill name matches the SKILL.md frontmatter `name`, which is the
published slug and slash-command trigger.

Known issue, not changed here: `video-add-b-roll` and
`video-add-content-cards` both publish under `review/03-`. The layout now
reflects that real behaviour rather than hiding it. Renumbering is not a docs
change — b-roll has 54 hash-bound references to `review/03-b-roll`, so it
needs its own commit.
What changed:
Trim the Pexels key note to the essential instruction and label the example
prompt as an example.

Why it changed:
The previous phrasing carried detail that belongs in the skill's own SKILL.md.

How it was checked:
Read the rendered paragraph; no dangling text left behind.
@ZhangchengCharles
ZhangchengCharles merged commit e689a1c into main Jul 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant