splice-youtube-quotes
Skill2 starsChanged 21 days agoMITView on GitHub
Download a short YouTube video, split its audio into individual alert WAV clips, stage them under ~/alerts/tmp, and prepare final slugged alert filenames. Use when Codex is given a YouTube URL and asked to create alert sounds or quote clips for the alerts folder.
In this repository15 other files it gives its agents.
- global/CLAUDE.mdCLAUDE.md
- black-octoberSkill
- branch-cascadeSkill
- build-orderSkill
- full-review-auditSkill
- meta-improveSkill
- newSkill
- pr-monitorSkill
- publish-mobile-appSkill
- remindSkill
- reopen-prSkill
- research-spikeSkill
- setup-switch-loginSkill
- skill-syncSkill
- switch-loginSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this when the user gives a YouTube URL and wants short quote or alert WAVs staged for review.
- Very specific: line 13
Keep source.wav, waveform.png, and cuts.tsv in the staging folder.
- Very specific: line 14
Do not move files into /Users/kevin/alerts/ or edit alert YAML files until the user signs off on the staged clips.
- Very specific: line 15
Always cut from source.wav.
- Distinctive: line 16
If the user gives a quote count, use it as a hard constraint for the draft clip count.
- Distinctive: line 17
Before exporting any clips, propose the timestamp boundaries you intend to splice, ask the user to confirm or correct the total quote …
- Distinctive: line 18
If labels are unknown, ask the user for the quote text in order.
- Distinctive: line 22
Create a staging folder:
- Distinctive: line 51
Run silence detection at a few thresholds:
- Distinctive: line 62
If separators are not true silence, compute RMS valleys with Python stdlib:
- Distinctive: line 120
After the user signs off on the timestamp list, export draft clips from the original source:
- Distinctive: line 138
Ask the user to review the staged WAVs.
- Distinctive: line 147
When labels are approved, slugify filenames:
- Very specific: line 153
Keep final review files directly in /Users/kevin/alerts/tmp/<slug>/.
- Very specific: line 159
If a split is wrong, move the boundary and regenerate both adjacent files from source.wav.
- Very specific: line 160
Prefer explicit shell variables/functions over clever tab-delimited shell parsing when rebuilding cuts.tsv.
- Distinctive: line 161
Keep all work in staging until the user approves the final files and names.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Extract YouTube Alerts
Use this when the user gives a YouTube URL and wants short quote or alert WAVs staged for review.
Rules
- Stage work under
/Users/kevin/alerts/tmp/<slug>/. - Keep
source.wav,waveform.png, andcuts.tsvin the staging folder. - Do not move files into
/Users/kevin/alerts/or edit alert YAML files until the user signs off on the staged clips. - Always cut from
source.wav; do not repeatedly cut already-cut clips. - If the user gives a quote count, use it as a hard constraint for the draft clip count.
- Before exporting any clips, propose the timestamp boundaries you intend to splice, ask the user to confirm or correct the total quote count, and wait for explicit sign-off. Do not splice until the user approves the proposed cuts.
- If labels are unknown, ask the user for the quote text in order. Codex cannot reliably transcribe audio natively; try captions or a local transcription tool only if available and worth the time.
Workflow
Create a staging folder:
mkdir -p /Users/kevin/alerts/tmp/<slug>Download audio from the YouTube URL:
yt-dlp --no-playlist -x --audio-format wav --audio-quality 0 \ -o '/Users/kevin/alerts/tmp/<slug>/source.%(ext)s' '<youtube-url>'Confirm duration:
ffprobe -v error -show_entries format=duration \ -of default=noprint_wrappers=1:nokey=1 \ /Users/kevin/alerts/tmp/<slug>/source.wavGenerate a waveform image:
ffmpeg -y -hide_banner -i /Users/kevin/alerts/tmp/<slug>/source.wav \ -filter_complex 'showwavespic=s=3600x700:colors=0x2f6fff' \ -frames:v 1 /Users/kevin/alerts/tmp/<slug>/waveform.pngRun silence detection at a few thresholds:
ffmpeg -hide_banner -i /Users/kevin/alerts/tmp/<slug>/source.wav \ -af silencedetect=n=-35dB:d=0.12 -f null - ffmpeg -hide_banner -i /Users/kevin/alerts/tmp/<slug>/source.wav \ -af silencedetect=n=-30dB:d=0.12 -f null - ffmpeg -hide_banner -i /Users/kevin/alerts/tmp/<slug>/source.wav \ -af silencedetect=n=-40dB:d=0.12 -f null -If separators are not true silence, compute RMS valleys with Python stdlib:
python3 - <<'PY' import math, struct, wave from pathlib import Path path = Path('/Users/kevin/alerts/tmp/<slug>/source.wav') with wave.open(str(path), 'rb') as w: channels = w.getnchannels() rate = w.getframerate() frames = w.getnframes() width = w.getsampwidth() data = w.readframes(frames) if width != 2: raise SystemExit(f'unexpected sample width: {width}') win = int(rate * 0.02) rms = [] for start in range(0, frames, win): count_frames = min(win, frames - start) offset = start * channels * width chunk = data[offset : offset + count_frames * channels * width] total = 0 count = 0 for (sample,) in struct.iter_unpack('<h', chunk): total += sample * sample count += 1 rms.append(math.sqrt(total / count) / 32768 if count else 0) smoothed = [] for i in range(len(rms)): lo = max(0, i - 3) hi = min(len(rms), i + 4) smoothed.append(sum(rms[lo:hi]) / (hi - lo)) minima = [] neighborhood = int(0.12 / 0.02) margin = int(0.25 / 0.02) for i in range(margin, len(smoothed) - margin): lo = max(0, i - neighborhood) hi = min(len(smoothed), i + neighborhood + 1) if smoothed[i] == min(smoothed[lo:hi]): t = (i + 0.5) * 0.02 if minima and t - minima[-1][0] < 0.18: if smoothed[i] < minima[-1][1]: minima[-1] = (t, smoothed[i]) else: minima.append((t, smoothed[i])) for t, energy in sorted(minima, key=lambda item: item[1])[:60]: print(f'{t:7.3f} {energy:.5f}') PY- Choose draft cut boundaries from the waveform plus valley list. If the user gave
Nquotes, chooseN + 1timestamps including start and end. Before exporting files, report the proposed timestamp list, your best-guess quote count, and ask the user to confirm the total quote count and approve or correct the splice points. After the user signs off on the timestamp list, export draft clips from the original source:
ffmpeg -y -hide_banner -loglevel error \ -ss <start> -to <end> \ -i /Users/kevin/alerts/tmp/<slug>/source.wav \ -ac 2 -ar 48000 \ /Users/kevin/alerts/tmp/<slug>/<draft-or-final-name>.wavWrite
cuts.tsvwith:file start end duration textGet each duration from
ffprobeon the generated file.- Ask the user to review the staged WAVs. Expect corrections like:
- combine adjacent clips
- split one clip at a percentage or timestamp
- move a boundary earlier or later because the tail of one quote is in the next clip
- rename from quote text
- Apply corrections by regenerating only affected files from
source.wav, then updatecuts.tsv. - When labels are approved, slugify filenames:
<speaker-prefix>-<lowercase-quote-with-dashes>.wav- Keep final review files directly in
/Users/kevin/alerts/tmp/<slug>/. Remove intermediate folders only after the final named files are present.
Practical Notes
- Some videos use low-energy separators rather than true silence; in that case,
silencedetectmay miss most quote breaks. - A full waveform gives orientation, but zoomed waveform panels can be useful for tight split corrections.
- If a split is wrong, move the boundary and regenerate both adjacent files from
source.wav. - Prefer explicit shell variables/functions over clever tab-delimited shell parsing when rebuilding
cuts.tsv. - Keep all work in staging until the user approves the final files and names.
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
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.

