Visualizer (/va) — truly understand videos
All scripts and prompt templates live in scripts/ and prompts/ next to this file —
resolve their paths from this skill's base directory (shown when the skill loads).
Two passes run by default (both, whenever a Gemini key is available), then YOU merge
the results into one answer. Without a key, Pass 1 alone still works (transcript-only).
Pass 0 — Dedup check (0 tokens, only if the user keeps a notes folder)
If VA_NOTES_DIR is set (or the user has told you where their video notes live), grep
that folder for the video ID before analyzing. Hit → point to the existing note instead
of re-analyzing. No notes folder → skip this pass.
Pass 1 — yt-dlp (free, seconds, no API key needed)
<skill-dir>/scripts/yt_fetch.sh "<URL>" "<outdir>"
Writes to <outdir>:
meta.md — title, channel, duration, date, chapters, full video description
links.md — every URL from the description (the main source for mentioned tools/repos — Gemini never sees the description!)
transcript.md — cleaned transcript with [MM:SS] timestamps
Use a temp/scratch directory. For videos >1h, read the transcript in sections.
Pass 2 — Gemini as video eyes (free tier: 8h YouTube/day)
<skill-dir>/scripts/gemini_watch.sh "<URL-or-file>" "<prompt>" > "<outdir>/gemini.md"
ALWAYS redirect output to a file (it is long and gets truncated otherwise), then read the file.
- Accepts YouTube URLs (direct, no download), any other platform URL (yt-dlp download ≤720p → Files API upload) and local files up to 2 GB (upload).
- Key:
GEMINI_API_KEY env var or ~/.config/va/env (line GEMINI_API_KEY=...).
- First-run onboarding (no key found): run Pass 1 anyway, then offer the guided setup —
do NOT just error out:
- Tell the user what the key unlocks (visuals, audio, on-screen OCR) and that it is free.
- Walk them through it: open https://aistudio.google.com/apikey → sign in with any
Google account → "Create API key" (the auto-suggested project is fine, no billing).
- Ask them to paste the key in chat (or into the file themselves if they prefer),
then write it for them:
mkdir -p ~/.config/va && echo 'GEMINI_API_KEY=<key>' > ~/.config/va/env && chmod 600 ~/.config/va/env — never store it anywhere else,
never echo it back.
- Mention once, honestly: on the free tier Google may use inputs for training —
fine for public YouTube videos, not for confidential footage (paid tier for that).
- Verify with a quick Pass-2 call, then continue the original request.
- Model override as 3rd argument. Default cascade handles "high demand" and daily quotas
automatically (retries + model fallback).
- YouTube: public videos only (unlisted/private → obtain the file and pass a local path).
- Shorts URLs: pass to Gemini in
watch?v= form.
- Analysis modes in
prompts/: pick by video type and append the user's actual question:
talk-summary.md — talks, tutorials, lectures (default for knowledge videos)
design-rebuild.md — website/UI/design videos, goal: rebuild
ad-teardown.md — ads, UGC, viral shorts, competitor analysis
render-qa.md — AI-generated renders, consistency/artifact QA
Each mode ends by requesting a FRAME: MM:SS — description list (input for Pass 3).
- For segments: prefix the prompt with
Analyze only MM:SS to MM:SS.
Pass 3 (optional) — frames as images
<skill-dir>/scripts/frames.sh "<URL-or-file>" "<outdir>" 2:42 7:37 ...
Take timestamps from Pass 2's FRAME: list. Writes frame-MM-SS.jpg; for URLs the
video is cached once as <outdir>/.video.mp4 (delete after). View the frames yourself
(Read) before using them — keep only the ones that carry real content.
Merge — your actual job
Default output is a structured ANSWER IN CHAT:
- TL;DR (3-5 sentences)
- Key takeaways with
[MM:SS], most important first — never a chronological retelling
- Visuals (diagrams/slides/UI from Pass 2, with timestamps)
- Links & mentioned tools (description + transcript + OCR merged, deduplicated)
- Honest verdict: what is genuinely useful, what is filler/ads (call it out, with time ranges)
Rules:
- Contradictions: the transcript wins on exact wording, Gemini wins on visuals.
- ALWAYS merge links from all three sources (description, spoken, on-screen OCR).
- Saving notes is opt-in: only write a markdown note to disk when the user asks
(or has a standing notes folder). Then: one file per video, named
YYYY-MM-DD Creator - Title.md, images beside it.
Fallbacks
- No captions → Pass 2 alone is enough (Gemini hears the audio natively); additionally
request a timestamped transcript of the key statements in the prompt.
- No Gemini key → Pass 1 only (transcript, description links, metadata) — still covers
most talk-style videos.
- Local files / non-YouTube →
gemini_watch.sh handles download/upload automatically.
1---2name: va3description: Visualizer - truly understand videos. Two-pass analysis (yt-dlp transcript/metadata/links + Gemini as native video eyes) distilled into a structured answer. Use whenever a video is involved, even without an explicit /va call - when the user pastes a YouTube/TikTok/Loom/Vimeo URL or a video file (.mp4/.mov/.webm/.mkv), wants a video watched/summarized/analyzed, asks what is said or shown in a video, wants key takeaways from a talk/tutorial, wants links/tools/repos extracted from a video, or wants to rebuild UI/design shown in a video.4---56# Visualizer (/va) — truly understand videos78All scripts and prompt templates live in `scripts/` and `prompts/` next to this file —9resolve their paths from this skill's base directory (shown when the skill loads).1011Two passes run by default (both, whenever a Gemini key is available), then YOU merge12the results into one answer. Without a key, Pass 1 alone still works (transcript-only).1314## Pass 0 — Dedup check (0 tokens, only if the user keeps a notes folder)15If `VA_NOTES_DIR` is set (or the user has told you where their video notes live), grep16that folder for the video ID before analyzing. Hit → point to the existing note instead17of re-analyzing. No notes folder → skip this pass.1819## Pass 1 — yt-dlp (free, seconds, no API key needed)2021```bash22<skill-dir>/scripts/yt_fetch.sh "<URL>" "<outdir>"23```2425Writes to `<outdir>`:26- `meta.md` — title, channel, duration, date, chapters, **full video description**27- `links.md` — every URL from the description (the main source for mentioned tools/repos — Gemini never sees the description!)28- `transcript.md` — cleaned transcript with `[MM:SS]` timestamps2930Use a temp/scratch directory. For videos >1h, read the transcript in sections.3132## Pass 2 — Gemini as video eyes (free tier: 8h YouTube/day)3334```bash35<skill-dir>/scripts/gemini_watch.sh "<URL-or-file>" "<prompt>" > "<outdir>/gemini.md"36```3738ALWAYS redirect output to a file (it is long and gets truncated otherwise), then read the file.3940- Accepts YouTube URLs (direct, no download), **any other platform URL** (yt-dlp download ≤720p → Files API upload) and **local files** up to 2 GB (upload).41- Key: `GEMINI_API_KEY` env var or `~/.config/va/env` (line `GEMINI_API_KEY=...`).42- **First-run onboarding (no key found):** run Pass 1 anyway, then offer the guided setup —43 do NOT just error out:44 1. Tell the user what the key unlocks (visuals, audio, on-screen OCR) and that it is free.45 2. Walk them through it: open https://aistudio.google.com/apikey → sign in with any46 Google account → "Create API key" (the auto-suggested project is fine, no billing).47 3. Ask them to paste the key in chat (or into the file themselves if they prefer),48 then write it for them: `mkdir -p ~/.config/va && echo 'GEMINI_API_KEY=<key>' >49 ~/.config/va/env && chmod 600 ~/.config/va/env` — never store it anywhere else,50 never echo it back.51 4. Mention once, honestly: on the free tier Google may use inputs for training —52 fine for public YouTube videos, not for confidential footage (paid tier for that).53 5. Verify with a quick Pass-2 call, then continue the original request.54- Model override as 3rd argument. Default cascade handles "high demand" and daily quotas55 automatically (retries + model fallback).56- YouTube: **public videos only** (unlisted/private → obtain the file and pass a local path).57- Shorts URLs: pass to Gemini in `watch?v=` form.58- **Analysis modes** in `prompts/`: pick by video type and append the user's actual question:59 - `talk-summary.md` — talks, tutorials, lectures (default for knowledge videos)60 - `design-rebuild.md` — website/UI/design videos, goal: rebuild61 - `ad-teardown.md` — ads, UGC, viral shorts, competitor analysis62 - `render-qa.md` — AI-generated renders, consistency/artifact QA63 Each mode ends by requesting a `FRAME: MM:SS — description` list (input for Pass 3).64- For segments: prefix the prompt with `Analyze only MM:SS to MM:SS`.6566## Pass 3 (optional) — frames as images6768```bash69<skill-dir>/scripts/frames.sh "<URL-or-file>" "<outdir>" 2:42 7:37 ...70```7172Take timestamps from Pass 2's `FRAME:` list. Writes `frame-MM-SS.jpg`; for URLs the73video is cached once as `<outdir>/.video.mp4` (delete after). View the frames yourself74(Read) before using them — keep only the ones that carry real content.7576## Merge — your actual job7778Default output is a structured ANSWER IN CHAT:79- TL;DR (3-5 sentences)80- Key takeaways with `[MM:SS]`, most important first — never a chronological retelling81- Visuals (diagrams/slides/UI from Pass 2, with timestamps)82- Links & mentioned tools (description + transcript + OCR merged, deduplicated)83- Honest verdict: what is genuinely useful, what is filler/ads (call it out, with time ranges)8485Rules:86- Contradictions: the transcript wins on exact wording, Gemini wins on visuals.87- ALWAYS merge links from all three sources (description, spoken, on-screen OCR).88- **Saving notes is opt-in**: only write a markdown note to disk when the user asks89 (or has a standing notes folder). Then: one file per video, named90 `YYYY-MM-DD Creator - Title.md`, images beside it.9192## Fallbacks93- No captions → Pass 2 alone is enough (Gemini hears the audio natively); additionally94 request a timestamped transcript of the key statements in the prompt.95- No Gemini key → Pass 1 only (transcript, description links, metadata) — still covers96 most talk-style videos.97- Local files / non-YouTube → `gemini_watch.sh` handles download/upload automatically.