fix(using-yt-tools): tighten SKILL.md v0.2.0→0.2.1

- description: 860→340 chars (remove implementation fluff)
- timestamps: add bare seconds example (123 → 2:03)
- stdout: clarify "CLI designed for single-line EOF"
- cache: add cumulative warning (20 videos = 1-4 GB)
- failure modes: add malformed URL to yt-dlp failures

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 13:06:38 +03:00
parent ca95e5cc54
commit 9fdd48b605

View File

@@ -1,7 +1,7 @@
---
name: using-yt-tools
version: 0.2.0
description: Two flows for accessing YouTube content. **Iterative-watch** (для «что в этом ролике / о чём ролик / video summary»): markdown transcript with [mm:ss] anchors → pick moments → extract frames as JPGs → Read them. **Targeted-frames** (для «покажи кадр на N / посмотри момент N / что показано на N»): extract specific frames at user-given timestamps, no transcript. Also triggers on "транскрипт видео", "расшифровка YouTube", "youtube transcript", "watch this video", or any youtube.com URL WebFetch can't reach. Wraps yt-dlp + youtube-transcript-api + PySceneDetect + ffmpeg via CLI in `~/projects/.common/lib/yt-tools/`. Skip for non-YouTube (Vimeo/Twitch/local mp4), audio podcasts (no STT here), pure-download workflows (use yt-dlp directly).
version: 0.2.1
description: Two flows for YouTube content. **Iterative-watch** (summary/exploration): transcript with [mm:ss] anchors → pick moments → extract frames. **Targeted-frames** (specific timestamps): extract frames directly, no transcript. Triggers: "что в ролике", "о чём видео", "video summary", "youtube transcript", "покажи кадр на N", или любой youtube.com URL. CLI в `~/projects/.common/lib/yt-tools/`. YouTube-only; для Vimeo/Twitch/local — другие тулзы.
---
# using-yt-tools
@@ -42,7 +42,7 @@ CLI entry-points на PATH (из `pip install -e ~/projects/.common/lib/yt-tools
| Flow | Required | Optional |
|---|---|---|
| A — iterative-watch | YouTube URL или bare 11-char video id | `--lang ru,en` для non-English subs; `--out PATH` |
| B — targeted-frames | YouTube URL + comma-separated `mm:ss` / `h:mm:ss` / bare seconds | `--no-cache-source` (stream вместо кеша source.mp4); `--out DIR` |
| B — targeted-frames | YouTube URL + timestamps (`mm:ss`, `h:mm:ss`, или bare seconds: `123` → 2:03) | `--no-cache-source` (stream вместо кеша source.mp4); `--out DIR` |
Оба flow пишут в `<cwd>/yt-cache/<video-id>/` по умолчанию.
@@ -58,7 +58,7 @@ CLI entry-points на PATH (из `pip install -e ~/projects/.common/lib/yt-tools
5. Answer the user, citing both transcript paragraph and frame contents
```
Last line каждого CLI's stdout — absolute path артефакта. Не парси текст вокруг, бери конец stdout.
Last line каждого CLI's stdout — absolute path артефакта (CLI designed для single-line EOF output). Не парси текст вокруг, бери конец stdout.
### Flow B — targeted-frames
@@ -80,7 +80,7 @@ Last line каждого CLI's stdout — absolute path артефакта. Не
| `yt-transcript` / `yt-frames` not on PATH | yt-tools pkg не pip-installed | Скажи юзеру install per `~/projects/.common/lib/yt-tools/README.md`; стоп |
| `yt-dlp not found on PATH` | Внешний бин отсутствует | Дай install command для ОС юзера; стоп |
| `ffmpeg not found on PATH` | Внешний бин отсутствует | То же; на Windows после `winget install Gyan.FFmpeg` юзер должен restart терминала + CC session |
| `yt-dlp source download failed (exit N) \| stderr: …` | Network / private / age-gated / region-locked | Выведи captured stderr verbatim; не retry |
| `yt-dlp source download failed (exit N) \| stderr: …` | Network / private / age-gated / region-locked / malformed URL | Выведи captured stderr verbatim; не retry |
| `yt-dlp --dump-json failed` | То же, но на metadata step | То же |
| `Subtitles disabled` от `youtube-transcript-api` | Канал отключил CC | Для Flow A это fatal — скажи юзеру, предложи Flow B с явными таймкодами если уместно |
| Юзер дал не-YouTube URL (Vimeo / Twitch / local mp4) | Out of scope | Стоп; скажи что скил YouTube-only |
@@ -93,7 +93,7 @@ Last line каждого CLI's stdout — absolute path артефакта. Не
- `frames/frame_<mmss>.jpg` per extracted frame
- Network: yt-dlp вытягивает metadata + опционально source.mp4; `youtube-transcript-api` вытягивает subs
- Никакого внешнего state не мутируется — чисто local-fs side effects
- `source.mp4` может быть ~50-200 MB на 720p / 10-минутный ролик; кеш переиспользуется между запусками
- `source.mp4` может быть ~50-200 MB на 720p / 10-минутный ролик; кеш переиспользуется между запусками. **Warning:** cumulative — 20 роликов = 1-4 GB на диске.
Cache hygiene: `yt-tools cache list` показывает usage, `yt-tools cache prune --older-than 7d` чистит.