feat(using-yt-tools): SKILL.md body fill (2 flows) [0.1.0 → 0.2.0]

Fill the v0.1.0 stub body. Description rewritten to document two distinct flows
(was iterative-only, even though triggers already listed targeted-frames phrases):

- Flow A — iterative-watch (transcript → pick anchors → frames): for "what's
  in this video / summary / о чём ролик / video summary / youtube transcript"
- Flow B — targeted-frames (frames only, no transcript): for "посмотри 1:23 /
  покажи кадр на N / что показано на N" — user already named timestamps,
  transcript fetch would be pure waste

Body sections filled (6): When/Prereq/Inputs/Steps/Failure/Side/NOT — Flow A
and Flow B distinguished throughout. Failure modes table covers missing CLI,
missing yt-dlp/ffmpeg (with Windows winget+PATH note), network/private/age-
gated, subs-disabled. What NOT to do explicitly forbids the "always-iterative"
trap that the v0.1.0 description implicitly invited.

Bump version 0.1.0 → 0.2.0 (MINOR — documents new capability set). Description
744 chars (under 900-char soft budget; well below ~1024 hard limit). Installed
to ~/.claude/skills/using-yt-tools/ via scripts/install.ps1 — harness skill-
listing renders full description, not truncated to H1.

STATUS.md: closes new [using-yt-tools-skill-body-fill] 🟢 (filed+closed
in-place since this is one body-fill task, not a multi-session workstream).
[using-yt-tools-review] stays 🔵 — body-fill blocker removed, but still
blocked on [using-yt-tools-trigger-smoke-clean-session] (needs fresh CC
session). Caveat recorded: body-fill was done by implementer instead of the
'fresh agent' the review-task originally specified — explicit user approval.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 12:39:40 +03:00
parent e83038965b
commit 4956beba5f
2 changed files with 110 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
# Task Board # Task Board
_Updated: 2026-05-20 (using-yt-tools: 3 baseline 🟢; 3 finding fixes 🟢 [paragraphs/frames-stderr/windows-path-doc] → yt-tools 0.1.0→0.1.3, 74/74 tests; trigger-smoke-clean-session still ⚪ (needs fresh CC session); review 🔵 on SKILL.md body fill)_ _Updated: 2026-05-20 (using-yt-tools: 3 baseline 🟢; 3 finding fixes 🟢 [paragraphs/frames-stderr/windows-path-doc] → yt-tools 0.1.0→0.1.3, 74/74 tests; skill-body-fill 🟢 [SKILL.md 0.1.0→0.2.0, two flows documented]; trigger-smoke-clean-session ⚪ (needs fresh CC session); review 🔵 still — body blocker removed, now blocked on trigger-smoke only)_
<!-- <!--
Canonical layout. One block per task. Per-task deep context lives in Canonical layout. One block per task. Per-task deep context lives in
@@ -113,6 +113,26 @@ Mode: **`pending`** — скил вызывает внешние CLI (yt-dlp/ffm
--- ---
## 🟢 [using-yt-tools-skill-body-fill] — Fill `skills/using-yt-tools/SKILL.md` body (When/Prereq/Inputs/Steps/Failure/Side/NOT) with both flows documented.
**Why:** Skill промоутился v0.1.0 со stub-body (`<пусто>` в каждой секции) + description описывал только iterative-flow, хотя триггеры включали targeted-frames фразы («покажи кадр на N» / «посмотри момент N»). Это создавало dissonance: агент мог активироваться на targeted-frames запрос, но prescriptive body не существовал, а description предписывал избыточный transcript fetch first. Также блокировало `[using-yt-tools-review]` acceptance criteria по Steps / Failure modes / What NOT to do.
**Scope:**
- Description rewrite: документировать оба flow (iterative + targeted-frames) с разделёнными trigger phrase lists. Уложиться ≤900 chars (memory: hard limit ~1024).
- Body: When/Prereq/Inputs/Steps/Failure/Side/NOT — два flow явно, с командами и failure-table.
- Bump `version: 0.1.0``0.2.0` (MINOR — new capability документирован: targeted-frames flow).
- Install в `~/.claude/skills/using-yt-tools/` через `scripts/install.ps1 -Names using-yt-tools`.
**Override caveat:** review-task originally specified «body пишется не имплементером (другая сессия / другой агент)». В этой сессии override дан юзером явно — body написан имплементером. Это ослабляет «fresh-eyes» гарантию body-quality, но review-pass на чистой сессии (по trigger-smoke-clean-session) даст symmetric coverage всё равно.
**Status:** done
**Where I stopped:** Closed by `<pending-commit>` (this commit). Description 744 chars (под 900-budget). Body: 6 sections, Flow A + Flow B explicitly distinguished. Trigger smoke в harness skill-listing — description полностью отображается (не truncated к H1). После body-fill — `[using-yt-tools-review]` остаётся 🔵 только на trigger-smoke-clean-session (один из двух исходных blockers снят).
**Next action:** (none — kept until merged)
**Branch:** master
<!-- created+closed-by: vitya@DESKTOP-NSEF0UK / 2026-05-20 / acceptance: body sections ✅ + description ≤900 ✅ + version bumped ✅ + skill installed ✅; caveat: override on non-implementer rule (user explicit approval) -->
---
## ⚪ [using-yt-tools-trigger-smoke-clean-session] — Behavioral trigger smoke for using-yt-tools — requires a fresh CC session. ## ⚪ [using-yt-tools-trigger-smoke-clean-session] — Behavioral trigger smoke for using-yt-tools — requires a fresh CC session.
**Scope (вынесено из using-yt-tools-test-trigger):** **Scope (вынесено из using-yt-tools-test-trigger):**
@@ -156,12 +176,13 @@ Findings → follow-up tasks (`using-yt-tools-<gap>-fix`) через `tasks_crea
**NB по семверу:** `version: 0.1.0` записан промоутером. Дальнейшие инкременты — ответственность владельца `claude-skills/`, **не** этого скила и не ревьюера. **NB по семверу:** `version: 0.1.0` записан промоутером. Дальнейшие инкременты — ответственность владельца `claude-skills/`, **не** этого скила и не ревьюера.
**Status:** blocked (на body fill, см. ниже) **Status:** blocked (на trigger-smoke-clean-session — единственный остаток после body-fill 🟢)
**Where I stopped:** 3 baseline impl-таски 🟢 (install, hermes-mapping, test-trigger partial). `.common/lib/yt-tools/` python-пакет 🟢 (готов, 67/67 тестов). НО: `SKILL.md` body — пустой stub (`<пусто>` в каждой секции When/Inputs/Steps/Failure/Side-effects/NOT). Без body нечего рецензировать в acceptance-критериях по Steps/Failure modes/What NOT to do. Также: 4 findings зафайлены как отдельные ⚪ таски (transcript-paragraphs / frames-stderr / windows-path-doc / trigger-smoke-clean-session). **Where I stopped:** 3 baseline impl-таски 🟢 (install, hermes-mapping, test-trigger partial). `.common/lib/yt-tools/` python-пакет 🟢 (74/74 тестов после 0.1.0→0.1.3). `SKILL.md` body 🟢 (0.1.0→0.2.0 — Flow A iterative + Flow B targeted-frames документированы, см. [using-yt-tools-skill-body-fill]). 3 finding-fix таски 🟢. Остаётся только: trigger-smoke на чистой CC-сессии (см. [using-yt-tools-trigger-smoke-clean-session]).
**Next action:** Запустить отдельную таску на «second-pass body fill для using-yt-tools/SKILL.md» (не имплементер промоушена — body пишется после impl). После этого review снимается с блокировки. Альтернативно: ревьюер может сейчас закрыть скоп «trigger + iterative-flow» (части 1+2 acceptance) и оставить «body acceptance» отдельным review-passом. **Next action:** В чистой CC-сессии прогнать smoke из [using-yt-tools-trigger-smoke-clean-session] (10 positive + 3 false-positive trigger phrases) + поведенческий smoke-test для каждого шага Flow A и Flow B на тестовом URL. Если 0 findings — закрыть 🟢 с close-note. Findings — новые ⚪ fix-tasks.
**Branch:** n/a **Branch:** n/a
<!-- created-by: vitya@DESKTOP-NSEF0UK / from: OpeItcLoc03/workshop / 2026-05-20T06:31:09.000Z / via: local-file (gitea-down) --> <!-- created-by: vitya@DESKTOP-NSEF0UK / from: OpeItcLoc03/workshop / 2026-05-20T06:31:09.000Z / via: local-file (gitea-down) -->
<!-- updated-by: vitya@DESKTOP-NSEF0UK / 2026-05-20 / 3 baseline 🟢, body-fill new blocker, 4 findings filed --> <!-- updated-by: vitya@DESKTOP-NSEF0UK / 2026-05-20 / 3 baseline 🟢, body-fill new blocker, 4 findings filed -->
<!-- updated-by: vitya@DESKTOP-NSEF0UK / 2026-05-20 / body-fill 🟢 (override: done by implementer per explicit user approval; review-task originally specified non-implementer); 3/4 finding-fixes 🟢; remaining blocker: trigger-smoke-clean-session -->
--- ---

View File

@@ -1,33 +1,109 @@
--- ---
name: using-yt-tools name: using-yt-tools
version: 0.1.0 version: 0.2.0
description: Use when the agent needs to "watch" a YouTube video iteratively — fetch a clean-markdown transcript with [mm:ss] anchors, decide which moments matter, then pull only those frames as JPGs for vision-reading via Read. Triggers on "транскрипт видео", "расшифровка YouTube", "что в этом ролике", "о чём ролик", "покажи кадр на N", "посмотри момент N", "что показано в видео на N", "watch this video", "video summary", "youtube transcript", or any youtube.com URL where WebFetch can't reach the actual content. Wraps yt-dlp + youtube-transcript-api + PySceneDetect + ffmpeg via CLI in `~/projects/.common/lib/yt-tools/`. Skip for non-YouTube videos (Vimeo/Twitch/local mp4), audio-only podcasts (no STT here), or pure-download workflows (use yt-dlp directly). 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).
--- ---
# using-yt-tools # using-yt-tools
Iterative-watching YouTube для агента: clean-markdown транскрипт с `[mm:ss]`-якорями → агент решает, какие моменты интересны → targeted frame extraction по таймкодам → агент видит кадры через `Read`. Iterative-watching YouTube для агента: clean-markdown транскрипт с `[mm:ss]`-якорями → агент решает, какие моменты интересны → targeted frame extraction по таймкодам → агент видит кадры через `Read`. Альтернативный flow — если юзер уже назвал таймкоды, идём прямо за кадрами без транскрипта.
## When to use ## When to use
<пусто, дописывается во втором проходе> Два различных flow, выбор по user intent:
**Flow A — iterative-watch** (exploration / summary):
- Юзер спрашивает что в ролике, хочет summary, хочет узнать о чём видео.
- Шаги: fetch transcript → read → pick interesting moments → extract those frames → Read frames.
- Trigger phrases: «что в этом ролике», «о чём ролик», «расшифровка YouTube», «video summary», «youtube transcript», «watch this video».
**Flow B — targeted-frames** (specific moments):
- Юзер уже назвал конкретные таймкоды; транскрипт — лишняя работа.
- Шаги: extract frames at given timestamps → Read frames.
- Trigger phrases: «покажи кадр на N», «посмотри момент N», «что показано на N», «show frame at N».
Оба flow предполагают, что `yt-tools` CLI установлен из `~/projects/.common/lib/yt-tools/`. Если `yt-transcript` / `yt-frames` отсутствуют на PATH — abort с install-hint (см. Prerequisites).
## Prerequisites
CLI entry-points на PATH (из `pip install -e ~/projects/.common/lib/yt-tools/` внутри venv):
- `yt-transcript`, `yt-frames`, `yt-watch`, `yt-tools`
Внешние бинари (любая ОС):
- `yt-dlp` — fetches metadata + source mp4
- `ffmpeg` — muxes streams + extracts frames
Если что-то отсутствует, CLI выдаёт явное `"X not found on PATH"`. Скажи юзеру и стоп.
Полный install per-OS — в `~/projects/.common/lib/yt-tools/README.md`. **Windows-gotcha:** после `winget install Gyan.FFmpeg` или `winget install yt-dlp.yt-dlp` нужен restart терминала (и Claude Code session) — winget пишет в per-user PATH, который текущий shell не перечитывает.
## Inputs ## Inputs
<пусто> | 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` |
Оба flow пишут в `<cwd>/yt-cache/<video-id>/` по умолчанию.
## Steps ## Steps
<пусто> ### Flow A — iterative-watch
```
1. yt-transcript <url> → ./yt-cache/<vid>/transcript.md
2. Read transcript.md, find [mm:ss] anchors that match the question
3. yt-frames <url> --timestamps 1:23,4:56,… → ./yt-cache/<vid>/frames/frame_*.jpg
4. Read each frame_*.jpg via the vision tool
5. Answer the user, citing both transcript paragraph and frame contents
```
Last line каждого CLI's stdout — absolute path артефакта. Не парси текст вокруг, бери конец stdout.
### Flow B — targeted-frames
```
1. Parse user's timestamps (mm:ss / h:mm:ss / bare seconds — все работают)
2. yt-frames <url> --timestamps 1:23,4:56,… → ./yt-cache/<vid>/frames/frame_*.jpg
3. Read each frame_*.jpg
4. Answer the user, referencing each frame by its [mm:ss] label
```
Без transcript fetch. Если потом юзер спросит «что говорилось в тот момент?», переключайся на Flow A на том же URL — `source.mp4` cache переиспользуется, повторного download нет.
## Failure modes ## Failure modes
<пусто> Все failures abort cleanly; никогда не оставляй наполовину готовое состояние.
| Symptom | Cause | Action |
|---|---|---|
| `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 --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 |
## Side effects ## Side effects
<пусто> - Writes под `<cwd>/yt-cache/<video-id>/`:
- `transcript.md` (Flow A)
- `source.mp4` (≤720p, оба flow если без `--no-cache-source`)
- `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-минутный ролик; кеш переиспользуется между запусками
Cache hygiene: `yt-tools cache list` показывает usage, `yt-tools cache prune --older-than 7d` чистит.
## What NOT to do ## What NOT to do
<пусто> - **Не запускай Flow A когда юзер уже дал таймкоды.** «Посмотри 1:23 и 4:56» → сразу Flow B. Fetching transcript first — чистая трата.
- **Не bulk-extract «на всякий случай».** Flow A берёт кадры из транскрипта, Flow B — из явного user input. Никогда `--mode interval --interval 5s` «to be safe».
- **Не используй `yt-watch` как default Flow A renderer.** `yt-watch` комбинирует transcript + scene-frames в один doc — тяжелее (требует ffmpeg scene-detect pass на source.mp4). Бери только когда юзер хочет один self-contained document.
- **Не shell-quote URLs в одну command строку.** Используй CLI list-form (он уже list-form в `subprocess.run`); YouTube URLs содержат `?` и `&`, которые ломают naive quoting.
- **Не retry на yt-dlp failures.** Failure здесь значит видео реально недоступно (private / region / age) или у юзера broken auth. Retries — трата токенов.
- **Не пересказывай / не переводи transcript в свой ответ молча.** Артефакт — для твоего reasoning; цитируй с `[mm:ss]`-якорем когда приводишь пассаж.
- **Не вызывай скил на non-YouTube URL.** Vimeo / Twitch / TikTok / local mp4 — out of scope. Бери другие тулзы (или yt-dlp напрямую).
- **Не пиши результаты в произвольные пути.** По умолчанию `<cwd>/yt-cache/<vid>/`; явный `--out` только если юзер просил.