diff --git a/README.md b/README.md index 036c170..790bdcc 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,4 @@ Personal agent skills packaged through Nix. Some skills adapt workflows or helper scripts from public examples. - `axi-review` is based on the [AXI principles](https://axi.md/). -- `youtube-transcript` is based on [`amosblomqvist/pi-config/skills/youtube-transcript`](https://github.com/amosblomqvist/pi-config/tree/main/skills/youtube-transcript). +- `ingest-youtube-transcript` is based on [`amosblomqvist/pi-config/skills/youtube-transcript`](https://github.com/amosblomqvist/pi-config/tree/main/skills/youtube-transcript). diff --git a/flake.nix b/flake.nix index 110e531..c1d760f 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,7 @@ inherit pkgs; inherit (skill) name src; } - // nixpkgs.lib.optionalAttrs (skill.name == "youtube-transcript") { + // nixpkgs.lib.optionalAttrs (skill.name == "ingest-youtube-transcript") { commands = [ { path = "fetch_transcript"; diff --git a/skills/ingest-youtube-transcript/SKILL.md b/skills/ingest-youtube-transcript/SKILL.md new file mode 100644 index 0000000..168c4ba --- /dev/null +++ b/skills/ingest-youtube-transcript/SKILL.md @@ -0,0 +1,55 @@ +--- +name: ingest-youtube-transcript +description: Use for YouTube URLs that need transcript analysis, summarization, quoting, search, or durable output. +--- + +# Ingest YouTube Transcript + +Ingest a YouTube video's title and transcript. +Use the transcript to understand the source and answer the user's request. +Create durable output when the user requests it or active project conventions require it. + +## Helper command + +Run from this skill directory: + +```bash +./fetch_transcript "" +``` + +The command prints JSON to stdout: + +```json +{ + "title": "Video title", + "transcript": "full transcript text as a single string" +} +``` + +The command writes progress logs to stderr. +The command exits non-zero on failure and writes the error to stderr. + +## Ingest workflow + +1. Run `./fetch_transcript` for the YouTube URL. +2. Read the returned `title` and `transcript`. +3. Build source understanding from the transcript. +4. Respond to the user's request in chat by default. +5. Create durable output when requested or when active project conventions require it. +6. State the output path when you create durable output. +7. State the scratch location when you create temporary scratch files. + +## Durable output + +Follow active project conventions for durable output. +Answer in chat when no durable output convention exists. +The user can request durable output afterward. + +## Transcript behavior + +The helper prefers manual English subtitles. +The helper falls back to automatic English subtitles. +The helper attempts only English captions. +The language order is `en`, `en-US`, `en-GB`, then any `en*` caption. +The transcript is plain text with timing and formatting removed. +Videos without English captions fail. diff --git a/skills/youtube-transcript/fetch_transcript b/skills/ingest-youtube-transcript/fetch_transcript similarity index 100% rename from skills/youtube-transcript/fetch_transcript rename to skills/ingest-youtube-transcript/fetch_transcript diff --git a/skills/youtube-transcript/fetch_transcript.py b/skills/ingest-youtube-transcript/fetch_transcript.py similarity index 100% rename from skills/youtube-transcript/fetch_transcript.py rename to skills/ingest-youtube-transcript/fetch_transcript.py diff --git a/skills/youtube-transcript/SKILL.md b/skills/youtube-transcript/SKILL.md deleted file mode 100644 index 4233037..0000000 --- a/skills/youtube-transcript/SKILL.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -name: youtube-transcript -description: Fetch the transcript and title of a YouTube video as JSON. Use when the user provides a YouTube URL and needs spoken captions for analysis, summarization, quoting, or search. ---- - -# YouTube Transcript - -Fetch a YouTube video's title and full transcript with `yt-dlp` captions. -Prefer manual English subtitles. -Fall back to automatic English subtitles. - -## Requirements - -The Nix-packaged skill provides Python 3 and `yt-dlp`. -A source checkout requires Python 3 and `yt-dlp` on `PATH`. - -## Usage - -Run from this skill directory: - -```bash -./fetch_transcript "" -``` - -## Output - -Prints a JSON object to stdout: - -```json -{ - "title": "Video title", - "transcript": "full transcript text as a single string" -} -``` - -Progress logs go to stderr. -On failure, the script exits non-zero and writes the error to stderr. - -## Notes - -- Only English captions are attempted. -- The language order is `en`, `en-US`, `en-GB`, then any `en*` caption. -- Manual captions are preferred over automatic captions. -- The transcript is plain text with timing and formatting removed. -- Videos without English captions fail.