Index of every page on this site: llms.txt
All skills
kartikkabadi avatar

/youtube-transcript-to-markdown

@02a497f
by Kartikkartikkabadi/skills10 stars
Run it yourself

Full YouTube transcript to polished markdown file.

  • 2 files
  • 6.9 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/kartikkabadi/skills/youtube-transcript-to-markdown

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈21 tokens for metadata: the name and description. ≈1.4k when used: this file.

Description uses 1.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈83 characters, or 1.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

YouTube Transcript to Polished Markdown

Full end-to-end workflow: pull a YouTube video's captions with yt-dlp, clean the rolling-caption duplication, hand the raw text to a subagent for a full read + fact-check + rewrite into a formatted markdown transcript, then delete every intermediate artifact so only the final .md remains.

When to use

User shares a YouTube URL and asks for the "full transcript", a "clean transcript", or a markdown version of everything said in the video. Not for summaries (use youtube-content for summaries/threads/blogs).

Steps

  1. Fetch captions with yt-dlp (scratch dir: projectless chats use ./work/ytdlp-work; otherwise /tmp/ytdlp-work):

    SCRATCH=./work/ytdlp-work; [ -d ./work ] && [ -d ./outputs ] || SCRATCH=/tmp/ytdlp-work
    mkdir -p "$SCRATCH" && cd "$SCRATCH"
    yt-dlp --no-update --write-auto-subs --sub-langs "en.*" --sub-format vtt \
      --skip-download "URL"

    Prefer --write-subs (human-made) over --write-auto-subs when available; check with yt-dlp --list-subs URL. If NO transcript exists at all, fall back to downloading audio (yt-dlp -x --audio-format wav) and transcribing with the local whisper.cpp install (see local-audio-transcription skill; models at ~/.local/share/whisper/ — never download new models).

  2. Clean the VTT. Auto-caption VTTs are "rolling" captions: each cue repeats the previous line, so naive text extraction triples the text. Correct method: split on blank lines into cue blocks, keep ONLY blocks whose body contains inline timestamp tags (<00:00:02.879><c> ...), take the LAST line of each block, strip <...> tags, join with spaces. Header-duplicate blocks have no <c> tags — skipping them removes all duplication. Insert paragraph breaks after sentence-ending punctuation. Result should be ~word_count = duration_min x 130-190 (a 103-min video ≈ 19-20K words). See scripts/clean_vtt.py.

  3. Get the chapter list from the video description (the URL context or yt-dlp --print "%(chapters)s" URL). Use chapters as the ## section headers.

  4. Delegate the rewrite to PARALLEL chunk subagents, never one. A single subagent asked to read 100K+ chars and rewrite ~20K words in one context dies: the assemble-then-write step exceeds the API proxy read timeout (observed HTTP 524 after ~18 min, zero output written). Instead compute per-chapter line boundaries (map chapter timestamps to cumulative word count, words-per-second ≈ total_words / duration_sec), split into 3-5 contiguous ranges, and fan out one subagent per range with delegate_task tasks=[...]. KEEP RANGES SMALL: one chapter per subagent (1,500-3,000 words raw). A 3-4 chapter range (~5-6K words) still dies on the same 524 — the long generation after reading blows the 120s proxy window even when the read phase fits. Expect roughly 1 success in 4 for oversized chunks and redispatch failures at chapter granularity instead of retrying the same size. Each writes ONLY its own chunk file (e.g. chunk1.md) in the scratch dir. You then stitch chunks + title header + footer note yourself. Each chunk brief must include:

    • input path + its exact line range + its chunk output path
    • its exact list of ## Chapter Name (m:ss) headers, verbatim, in order
    • shared style rules: read the WHOLE range by paging, fix ASR typos and entity names (web_search for spellings), keep first-person voice, reproduce COMPLETE content (no summarizing), paragraph per idea, light filler removal, start directly with the first ## header (no title)
    • tell it NOT to delete the input file (orchestrator does cleanup)
    • pass shared context (entity spellings, book titles, speaker/channel) via the batch context field so all 4 writers stay consistent
    • NEVER pass incident background / prior-session knowledge about the video's subject into the brief. User correction (2026-08-06): "no background stuff from memory. only the actual video." The rewrite must be the video's words only; shared context = spelling conventions, nothing else. Also verify cross-chunk spelling consistency yourself after stitching (one agent may normalize "Sinara" while others write "Synara") — unify before delivering.
  5. Verify the deliverable yourself. Check the output file exists, has all chapter headers, and the word count matches expectation. Subagent reports are self-reports — spot-check the actual file.

  6. Clean up everything else. rm -rf "$SCRATCH" (the VTT, cleaned txt, any audio). If a fallback whisper model or package was installed specifically for this run and the user didn't have it before, remove it. The ONLY surviving artifact is the markdown file: ./outputs/ in projectless chats, Downloads elsewhere.

Pitfalls

  • Never flatten VTT naively — you get 3x duplicated text (59K words for a 20K-word video). The <c>-tag filter in step 2 is the reliable dedupe.
  • --sub-formats (plural) is not a valid yt-dlp flag — it's --sub-format.
  • YouTube auto-captions mangle entity names ("moes" for "moats", wrong brand names) — the subagent rewrite pass is not optional.
  • Old yt-dlp versions fail on new YouTube player changes; if extraction errors, update yt-dlp first (brew upgrade yt-dlp or uv pip install -U yt-dlp).
  • Set explicit expectations on subagent output size: a full 2-hour transcript rewrite is ~110K chars; the child may need to assemble it in chunks.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 02a497f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago
platforms
[
  "linux",
  "macos",
  "windows"
]

README badge

README badge for kartikkabadi/skills/youtube-transcript-to-markdown