agentleFS
ksdischksdisch/claude-config/skills/youtube-transcript/SKILL.md

youtube-transcript

Skill0 starsChanged 27 days agoMITView on GitHub

Download a YouTube video's transcript with yt-dlp — manual captions first, auto-generated as fallback, local Whisper transcription only as a gated last resort — and convert it to deduplicated plain text named after the video. Use when given a YouTube URL and asked for the transcript, captions, or subtitles, when asked to "transcribe a YouTube video", or when another skill needs a video's text. Trigger on "youtube transcript", "get the transcript", "download captions", "get subtitles", "transcribe this video".

  • Installs packages

59 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use research-prompt, ship-learn-next and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • matyasstochSkill

    research-prompt

    Write a single-paragraph Deep Research prompt to hand to a human researcher (or a deep-research AI). Use when the user wants a research brief, a "deep research prompt", a one-paragraph task for a researcher, or asks "what should our researcher look for". Produces ONE tight paragraph with full context, numbered sub-questions, and per-finding output format.

    Also in 3 projects that use this

  • michalparkolaSkill

    ship-learn-next

    Transform learning content (like YouTube transcripts, articles, tutorials) into actionable implementation plans using the Ship-Learn-Next framework. Use when user wants to turn advice, lessons, or educational content into concrete action steps, reps, or a learning quest.

    Also in 4 projects that use this

  • huskerjeffSkill

    youtube-search

    Search YouTube and extract video metadata and captions using yt-dlp. Use when the user wants to search YouTube, find video transcripts, research topics via YouTube, or feed video content into other tools like NotebookLM.

    Also in 4 projects that use this

  • michalparkolaSkill

    article-extractor

    Extract clean article content from URLs (blog posts, articles, tutorials) and save as readable text. Use when user wants to download, extract, or save an article/blog post from a URL without ads, navigation, or clutter.

    Also in 3 projects that use this

  • MicrosoftSkill

    web-search

    Also in 3 projects that use this

  • ArogyaReddySkill

    changelog-generator

    Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 50 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Whisper is opt-in, with the cost shown: Never download audio or install Whisper without quoting the duration and approximate audio size and …

    line 36
  2. Very specific:

    If it prints a path, continue.

    line 58
  3. Distinctive:

    If the install fails, stop and point at <https://github.com/yt-dlp/yt-dlp#installation>.

    line 60
  4. Distinctive:

    If either errors, report yt-dlp's own message.

    line 82
  5. Very specific:

    If the video isn't in English, take whatever track --list-subs actually offers and say which language you used — a silent language …

    line 105
  6. Distinctive:

    Stop and ask, quoting real numbers from step 2:

    line 111
  7. Very specific:

    Use --model base unless Kyle asks otherwise.

    line 124
  8. Very specific:

    Delete the .vtt once the .txt exists.

    line 161
  9. Distinctive:

    Default to the current working directory — the transcript is usually wanted right where Kyle is working.

    line 170
  10. Very specific:

    Feeding another skill: When a skill calls this one for URL input and consumes the transcript as an intermediate — youtube-breakdown today — …

    line 175
  11. Distinctive:

    Never write into a git repo's tracked tree without saying so — a stray 200 KB transcript in git status is noise at best and a committed …

    line 182

“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

YouTube Transcript

Fetch a YouTube video's text. The whole skill is one decision — what is the cheapest source of text that actually exists for this video — and then a conversion step.

Preference order, never reversed:

  1. Manual captions (--write-sub) — human-written, punctuated, no scroll overlap.
  2. Auto-generated captions (--write-auto-sub) — nearly always present, needs cleanup.
  3. Whisper on downloaded audio — accurate but slow and bandwidth-hungry. Gated.

Most videos resolve at step 1 or 2 in a few seconds. Step 3 is rare and always costs Kyle something, so it never happens without him saying yes.


Invariants

These hold on every run. Everything else in this file is guidance.

  • --list-subs before any download. Guessing which captions exist and reacting to the failure wastes a round trip and produces confusing errors when the real problem is a private or geo-blocked video. Look first.
  • Whisper is opt-in, with the cost shown. Never download audio or install Whisper without quoting the duration and approximate audio size and getting an explicit yes. These are the only steps in the skill that consume real bandwidth or disk.
  • Never install anything silently. yt-dlp missing is a question, not a brew install.
  • Ask in chat, never in the shell. The Bash tool has no stdin — a script that ends in read -r RESPONSE hangs or reads EOF and takes the default branch. Every confirmation in this skill is a turn in the conversation, and the shell only runs after the answer.
  • One command per Bash call, no orchestration scripts. Long chained scripts hide which step failed and re-run expensive steps on retry. Run a step, read the output, decide.
  • The .vtt is an intermediate. The deliverable is .txt. Delete the VTT once the conversion succeeds — but not before, and never if the conversion errored.

Steps

1. Confirm yt-dlp is available

command -v yt-dlp

If it prints a path, continue. If not, tell Kyle it's missing and offer the install for his platform — brew install yt-dlp on this Mac, pip3 install yt-dlp anywhere. Wait for yes. If the install fails, stop and point at https://github.com/yt-dlp/yt-dlp#installation; don't improvise a workaround.

2. Read the video's metadata and caption inventory

yt-dlp --print "%(title)s" "<URL>" > title.txt
yt-dlp --print "%(duration)s|%(id)s" "<URL>"
yt-dlp --list-subs "<URL>"

The duration feeds the Whisper cost estimate; --list-subs says which of the three paths below you're on.

The title goes to a file and stays there. A video title is the one input to this skill that a stranger controls, and it reaches you as text you are about to compose a shell command out of. $, `, and $(…) all expand inside double quotes — a video called How `id` works or Understanding $(whoami) executes at the moment you run the command you wrote. Redirecting to title.txt and passing the path in step 5 means the title crosses as data and never becomes command text. Read title.txt if you need the title for your own narration; just never paste it into a command line.

If either errors, report yt-dlp's own message. The common causes — private, members-only, age-restricted, geo-blocked, or a bad URL — are all things Kyle needs to know about rather than something to retry around.

3. Get the captions

Work down the list until one produces a .vtt. --skip-download keeps this to a few KB; --sub-langs en avoids pulling every language when only English is wanted.

Manual captions (if --list-subs showed a non-automatic English track):

yt-dlp --write-sub --sub-langs en --skip-download --output transcript "<URL>"

Auto-generated captions (fallback):

yt-dlp --write-auto-sub --sub-langs en --skip-download --output transcript "<URL>"

Either writes transcript.en.vtt into the working directory.

If the video isn't in English, take whatever track --list-subs actually offers and say which language you used — a silent language substitution produces a transcript Kyle can't read and won't expect.

4. Whisper — only if steps 3's options both came up empty

Stop and ask, quoting real numbers from step 2:

No captions exist for this video (42 min, ~38 MB of audio). I can download the audio and transcribe it locally with Whisper — several minutes of CPU. Want me to?

Only after yes:

  1. command -v whisper — if missing, ask again before pip3 install openai-whisper (~1–3 GB with models, and it needs ffmpeg).
  2. yt-dlp -x --audio-format mp3 --output "audio_%(id)s.%(ext)s" "<URL>"
  3. whisper "audio_<id>.mp3" --model base --output_format vtt
  4. Offer to delete the mp3 once the VTT exists.

Use --model base unless Kyle asks otherwise; small and up buy accuracy at a steep time cost, and tiny is noticeably worse on technical vocabulary.

5. Convert to plain text

python3 ~/.claude/skills/youtube-transcript/scripts/vtt-to-text.py \
  <the .vtt from step 3 or 4> --title-file title.txt

Stay in the working directory from steps 2–4 and give the script by absolute path. The VTT and title.txt are both relative to where you've been working, so cd-ing to the skill's own directory breaks both arguments — and --dir defaults to the current directory, which would write the transcript into ~/.claude/skills/, a symlink into the config repo.

The input is whichever VTT actually got written — transcript.en.vtt on the caption paths, audio_<id>.vtt on the Whisper path.

--title-file names the output after the video and sanitizes the title in Python, so you never construct a filename in the shell. Add --dir <path> to place it elsewhere. Use -o <path> instead only when the name comes from Kyle rather than from the video.

The script strips the WEBVTT header, cue timings, NOTE/STYLE blocks, karaoke <c> tags, and HTML entities, then removes the scroll overlap that makes auto-captions read every phrase two or three times.

Deduplication is cue-aware: a line is dropped only when the cue immediately before it already contained that line, which is exactly how rollup captions repeat. Don't reach for a line-count window instead — a rollup cue carries several lines, so the repeat can sit two or three lines back, and any window wide enough to catch it also eats the short utterances ("Yeah.", "Right.") that legitimately recur a few lines apart in interviews. Since step 6 deletes the VTT, anything dropped here is gone for good. --no-dedup turns it off, which is the right call for manual captions.

6. Clean up and report

Delete the .vtt once the .txt exists. Tell Kyle the output path, the line count, and which of the three sources the text came from — manual captions and Whisper output read very differently from auto-captions, and knowing which he has changes how much he trusts the punctuation.


Where the file goes

Default to the current working directory — the transcript is usually wanted right where Kyle is working.

Two exceptions:

  • Feeding another skill. When a skill calls this one for URL input and consumes the transcript as an intermediate — youtube-breakdown today — the transcript is not a deliverable: run the whole fetch from the session scratchpad, so title.txt, the .vtt, and the final .txt all land there and none of it touches a repo. The calling skill saves its own output separately.
  • Kyle names a destination. Then use that.

Never write into a git repo's tracked tree without saying so — a stray 200 KB transcript in git status is noise at best and a committed accident at worst.


Troubleshooting

SymptomWhat's actually wrong
--list-subs shows tracks, download writes nothingLanguage mismatch — --sub-langs en on a video with only es tracks silently writes no file. Re-run with the language that's actually listed.
Output text is one-third repeated phrasesThe VTT was converted with something other than the script, or with --no-dedup. Re-run the conversion without it.
HTTP Error 403 / "Sign in to confirm you're not a bot"yt-dlp is out of date, or YouTube wants a session. Update first (brew upgrade yt-dlp); mention --cookies-from-browser chrome as the next option but don't run it without asking — it reads Kyle's browser cookies.
Whisper fails on startMissing ffmpeg (brew install ffmpeg) or insufficient disk for the model.
Transcript ends earlySome videos have partial captions. Compare the last timestamp in the VTT against the duration from step 2 before assuming the file is fine.

Related

  • youtube-breakdown — the usual consumer. It calls this skill when given a URL, then processes the text into structured notes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.