--- name: video-explainer argument-hint: " [what to focus on]" description: Turn a video (YouTube or any yt-dlp URL, or a local file) into a self-contained HTML explainer page whose diagrams are built in pure CSS (flows, timelines, charts, comparisons, cycles, layers), adding screenshots only where the video's own visuals are the point. Uses the watch plugin to download the video, sample frames and pull the transcript, then genuinely looks at the frames. Use this whenever someone wants a video explained, summarized or broken down as a web page, visual notes, an explainer, a one-pager, study notes or a diagram-based summary, e.g. "make an HTML page explaining this YouTube video", "turn this talk into visual notes", "explain this video with diagrams", "I don't have time to watch this, give me a page I can skim", even if they don't say HTML or CSS. For a quick question about a video, use /watch directly instead. --- # Video → visual explainer page ## Contents - [1. Prepare the video](#1-prepare-the-video) - [2. Watch it properly](#2-watch-it-properly) - [3. Find the explanation, not the transcript](#3-find-the-explanation-not-the-transcript) - [4. Choose diagrams](#4-choose-diagrams) - [5. Screenshots: only when they earn it](#5-screenshots-only-when-they-earn-it) - [6. Build the page](#6-build-the-page) - [7. Render, look, fix](#7-render-look-fix) - [8. Deliver](#8-deliver) Reference files (open one when a step points to it): - `references/diagrams.md`: Diagram catalog The goal: someone who has not watched the video reads the page in about five minutes and understands what the video said **and showed**: the argument, the mechanisms, the numbers, the results. Most of that understanding should come from diagrams built in HTML + CSS, with prose that explains rather than transcribes. Scripts live in `scripts/` next to this file. Run them with `python` on Windows (`python3` is the Microsoft Store stub there) and `python3` elsewhere. On Windows, any ad-hoc Python you write that prints video titles or descriptions needs `PYTHONIOENCODING=utf-8`, or emoji crash the console. ## 1. Prepare the video ```bash python "/scripts/prepare.py" "" --work "" ``` Pick a work dir in your scratch/temp area (e.g. `/video-explainer-`); the script creates it. It finds the installed **watch** plugin and runs its pipeline (yt-dlp download, ffmpeg frames, captions), retrying the download with fallback yt-dlp settings when YouTube answers 403. Then it writes: - `transcript.md`: the de-duplicated transcript in ~30 s paragraphs with `[MM:SS]` stamps, under the video's own chapter headings when it has chapters. (Raw YouTube auto-captions repeat every line; this file doesn't.) Read this one. - `captions.txt`: the same words, one caption cue per line with `[MM:SS.s]`. Grep it when you need the exact moment a phrase is said, for a timestamp link or a grab. - `meta.json`: title, channel, upload date, duration, chapters, description, tags, `video_path`, `timestamp_url_template` (YouTube deep links), and the frame list. - It prints the frame paths (≈80 frames at 512 px for a 3–10 min video) with exact times: `grab.py --times ` returns the same picture at full resolution. (`report.md` is the watch plugin's raw report; you don't need it.) Useful flags: `--start/--end` (focus on a section), `--max-frames N`. If it fails: missing watch plugin → tell the user to install it (`/plugin marketplace add bradautomates/claude-video`, then `/plugin install watch@claude-video`). Persistent 403s → `pip install -U yt-dlp`, and make sure `node` or `deno` is on PATH. No transcript (no captions, no Whisper key) → carry on frames-only, and tell the user that adding a Groq key to `~/.config/watch/.env` would give the page the narration too. ## 2. Watch it properly 1. **Read `transcript.md` in full.** It's the backbone of what was *said*. 2. **Read every frame** the script listed, in parallel batches of ~20. The frames show what the narration leaves out: chart values and axes, dates, labels, on-screen text, diagrams, code, UI, and above all *results* (what the demo actually produced). If on-screen text matters but is unreadable at 512 px, grab that moment at full resolution (step 4's `grab.py`) and read it. 3. For a long video (>15 min) frames are sparse. Use the transcript to find the visual moments ("as you can see", "look at this chart", "here's the result"), then sample them densely: `grab.py