What I do
- Launch exactly one
generalsubagent for the actual transcript job. Do not do the full workflow inline in the main thread, and do not let that subagent spawn another subagent. - Use co-located
./youtube_transcript.pyto gather raw sources and render an initial merged markdown transcript. - Always retrieve both YouTube caption sources and a Whisper transcription, then compare them to produce the best transcript you can.
- Write the final transcript to
/tmp/transcripts/<channel-name>/<youtube-title>.mdand keep supporting artifacts under/tmp/transcripts.
Workflow
-
Require a single YouTube URL argument. If it is missing, ask for it.
-
Launch exactly one
generalsubagent and give it the URL. In the task prompt, explicitly say:Subagent limit: 1. Do not spawn additional subagents. -
In the subagent, run:
python3 ~/.config/opencode/skills/youtube-transcript/youtube_transcript.py gather "<url>" -
Read the JSON printed by
gatherand capturemanifest_pathplusoutput_markdown. -
In the subagent, run:
python3 ~/.config/opencode/skills/youtube-transcript/youtube_transcript.py merge "<manifest_path>" "<output_markdown>" -
Read the generated manifest and normalized source files. Spot-check the merged markdown against:
- manual subtitles, if present
- automatic captions, if present
- Whisper output
-
If the merged markdown still has obvious errors, missing phrases, or bad formatting, edit the markdown file directly before finishing.
-
Return the final markdown path, video title, source mix, and any caveats to the main agent.
Guardrails
- Always attempt both caption retrieval and Whisper. Do not skip Whisper just because captions exist.
- Prefer manual captions over automatic captions and automatic captions over Whisper, but use Whisper to fill gaps or replace obviously weak caption text.
- Do not claim the result is exact if it mostly depends on automatic captions or Whisper.
- Keep the final transcript readable markdown, with metadata at the top and a timestamped transcript section.
- Keep artifacts under
/tmp/transcripts/<channel-name>/; do not scatter temp files elsewhere unless a tool forces it.