agentleFS
motola10motola10/claude-code-base/.claude/skills-disabled/youtube-transcribe/SKILL.md

youtube-transcribe

Skill1 starsChanged 5 months agoMITView on GitHub

Use this skill when the user provides a YouTube URL and wants its spoken content extracted as text. The trigger pattern is: a youtube.com or youtu.be link paired with any intent to capture what is said — whether phrased as transcribe, get transcript, get captions, convert to text, write up, read, or go through. The URL plus content-extraction intent is the signal. Skip for YouTube API questions, metadata lookups (views, likes, description), or general coding tasks.

  • Installs packages

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the library is installed, installing it if not:

    line 31
  2. Distinctive:

    Run the bundled script — it fetches every segment, groups them into paragraphs, cleans HTML entities, and applies known ASR corrections …

    line 37
  3. Distinctive:

    If no transcript can be retrieved at all, report the error and stop — do not fabricate content.

    line 56
  4. Distinctive:

    Overview: Write 2–3 sentences — who's speaking, what the video covers, the main takeaway.

    line 67
  5. Very specific:

    Before presenting the final output, apply the agent-to-confirm self-audit:

    line 86
  6. Distinctive:

    If any of these checks fail, fix the issue before proceeding.

    line 96
  7. Distinctive:

    If the video has no transcript available, say so clearly and suggest the user check if captions are enabled on the video.

    line 146
  8. Distinctive:

    Do not compress or summarize content into bullet points — the document sections must contain the full spoken content, just better organized

    line 163
  9. Distinctive:

    Do not invent section titles that don't reflect actual topic shifts in the speech

    line 164
  10. Distinctive:

    Do not skip segments because they seem repetitive or filler ("um", "uh", "you know") — clean them naturally into readable prose but do not …

    line 165
  11. Distinctive:

    Do not add timestamps that weren't in the source data

    line 166
  12. Very specific:

    Do not fabricate content to fill apparent gaps — mark them as [UNCLEAR] instead

    line 167
  13. Distinctive:

    Do not claim the transcript is complete if you only fetched a partial response

    line 168
  14. Distinctive:

    Do not place corrections inline in the document body — they all go at the end in the Corrections Applied section

    line 169

“Common” is measured: kept by at least 6 in 10 of the 7 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

What this skill does

Fetches a YouTube video's captions/transcript and delivers it as clean, structured text that faithfully represents everything spoken — no paraphrasing, no gaps. Where the raw transcript has obvious errors, idioms, or ambiguities, it attempts corrections at 95% confidence and flags anything it cannot confidently fix. It also invokes the agent-to-confirm skill as a final hallucination check before presenting the result.


Step 1 — Extract the video ID

YouTube URLs come in several forms. Parse the video ID from whichever is given:

URL patternVideo ID location
youtube.com/watch?v=VIDEO_IDv query param
youtu.be/VIDEO_IDpath segment
youtube.com/shorts/VIDEO_IDpath after /shorts/
youtube.com/embed/VIDEO_IDpath after /embed/
youtube.com/live/VIDEO_IDpath after /live/

Strip any extra params (&t=30s, ?si=..., etc.) — only the 11-character video ID matters.


Step 2 — Fetch the transcript

Check the library is installed, installing it if not:

pip show youtube-transcript-api || pip install youtube-transcript-api

Run the bundled script — it fetches every segment, groups them into paragraphs, cleans HTML entities, and applies known ASR corrections (e.g. "Cloud Code" → "Claude Code") in one pass:

python ~/.claude/skills/youtube-transcribe/scripts/fetch_transcript.py <VIDEO_ID> <VIDEO_ID>_transcript.md

Note the TOTAL_SEGMENTS=<N> printed at the end — you'll need it for the Step 4 completeness check. The output file has placeholders for video title, Overview, and section headings — that's deliberate; the script can fetch and clean text, but judging where a topic shift happens or what a video is "about" needs the kind of reading comprehension only you can apply. Step 3 covers filling those in.

If the script can't run (no Python, no filesystem access, or youtube-transcript-api itself is unreachable — different failure mode than a missing pip package): fall back to fetching the YouTube watch page via direct HTTP (not WebFetch, which only renders the static shell) and parsing the captionTracks JSON out of ytInitialPlayerResponse. The baseUrl inside it is a signed URL that expires within seconds, so fetch and use it immediately.

If no transcript can be retrieved at all, report the error and stop — do not fabricate content.


Step 3 — Fill in title, overview, and section headings

This is the part automation can't do for you — it requires understanding what was actually said.

  • Video title: Infer it from the opening lines of the transcript; speakers almost always state the topic in the first 30 seconds. There's no metadata field for this in the fetched segments.
  • Overview: Write 2–3 sentences — who's speaking, what the video covers, the main takeaway. Derive this entirely from the transcript, never from outside knowledge. If you state a count ("covers four steps"), count the actual sections you're about to write and make sure it matches — don't estimate from memory.
  • Section headings: A new section starts when the speaker explicitly shifts topic ("Now let's look at...", "The second point is...", "Moving on to...") or there's a clear thematic break. Don't invent headings where no real shift exists — a single ## Content section is fine for videos with no natural breaks. For short videos (< 5 min), 2–4 sections is normal.
  • Extra corrections: The script already fixes the ASR mishears it knows about. Scan the rest of the text for homophones (their/there/they're), missing punctuation, lowercase proper nouns, or run-on misheard phrases. Apply the same 95% confidence rule: ≥95% confident → fix silently and log it in Corrections Applied; below that → leave the original text, wrap it in [?? original text ??], and log it in Uncertain Flags. If a segment is truly unrecoverable, mark it [INAUDIBLE or UNCLEAR: original text] rather than guessing.

Step 4 — Self-audit with agent-to-confirm

Before presenting the final output, apply the agent-to-confirm self-audit:

Decompose your claims and check:

  1. Completeness — did every segment from the fetched transcript make it into the document? (Count raw segments fetched vs. total segments declared in the header; they must match the TOTAL_SEGMENTS from Step 2.)
  2. No invented content — every sentence in the output must trace back to a fetched segment. Nothing was paraphrased or added.
  3. Overview accuracy — if the Overview states a count, count the actual sections in the document you just wrote and confirm the number matches.
  4. Correction honesty — each correction in the Corrections Applied section has a traceable original and a reason you are ≥ 95% confident.
  5. Uncertain flags are genuine — items in the Uncertain Flags section are things you truly cannot resolve, not things you got lazy about.
  6. Closing content present — does the last timestamp in the document land near the video's actual end? Auto-grouping can occasionally drop a trailing partial paragraph — check the tail of the source segments against the tail of the document.

If any of these checks fail, fix the issue before proceeding. If you cannot reach 95% confidence on completeness, tell the user explicitly what portion is confirmed vs. uncertain.


Step 5 — Present the structured document

The goal is a document a reader can actually use — organized, readable, and completely faithful to the source.

Document structure:

# [Video Title]

**URL:** [original URL]
**Language:** [language of the caption track used]
**Caption type:** Manual | Auto-generated
**Total segments:** [N]

---

## Overview
[2–3 sentences per Step 3.]

---

## [Section Title]

[Full spoken content of this section, written as clean continuous prose. Preserve every idea, example, and detail from the transcript. Do not paraphrase or compress. The only changes allowed are corrections already logged, plus natural sentence-boundary punctuation absent from the raw captions.]

[Sparse inline timestamps at section starts — e.g., `[01:24]` — so the reader can jump to the source video.]

---

## [Next Section Title]

[Content...]

---

## Corrections Applied
Changes made with ≥ 95% confidence (original → corrected — reason):
- [00:04] "there going" → "they're going" — homophone correction
- *(none)* if no corrections were made

## Uncertain Flags
Items the transcript preserved verbatim because confidence was below 95%. Look for `[?? ... ??]` markers in the sections above:
- [02:15] "the model [?? lears ??] from data" — possible: "learns", "layers", or mishear; not corrected
- *(none)* if no uncertain items

If the video has no transcript available, say so clearly and suggest the user check if captions are enabled on the video.


Error handling

SituationResponse
No captionTracks in page source (HTTP fallback)"No captions found. The video may not have captions enabled, or it may be age-restricted/private."
baseUrl fetch returns empty or error (HTTP fallback)Retry once with &fmt=json3 appended; if still fails, report the error
Video is very long (> 1 hour)Warn the user before fetching; the transcript may be large. Fetch it anyway and process completely.
Non-English captions onlyTranscribe in the source language; note this prominently; do not attempt translation unless the user asked for it

What NOT to do

  • Do not compress or summarize content into bullet points — the document sections must contain the full spoken content, just better organized
  • Do not invent section titles that don't reflect actual topic shifts in the speech
  • Do not skip segments because they seem repetitive or filler ("um", "uh", "you know") — clean them naturally into readable prose but do not drop the underlying idea
  • Do not add timestamps that weren't in the source data
  • Do not fabricate content to fill apparent gaps — mark them as [UNCLEAR] instead
  • Do not claim the transcript is complete if you only fetched a partial response
  • Do not place corrections inline in the document body — they all go at the end in the Corrections Applied section

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.