YouTube Summary (youtube2md)
Use the official youtube2md CLI behavior from the package/repository, with this skill's full-mode default model set to gpt-5.4-mini.
Runtime + security prerequisites
- Require Node.js 18+.
- Require preinstalled
youtube2mdon PATH.- Recommended pinned install:
npm i -g youtube2md@1.0.2
- Recommended pinned install:
- Require python3 for transcript text preparation (
prepare.py) in simple/transcript modes. - Default runner uses the local
youtube2mdexecutable only. - Runtime npm execution (
npx) is intentionally not supported by this skill runner. - The
YOUTUBE2MD_BINenvironment variable override is rejected by the runner. OPENAI_API_KEYenables full summarization mode; transcript and/or audio-derived content may be sent to OpenAI through youtube2md's workflow.- For sensitive content, omit
OPENAI_API_KEYand use simple or transcript mode when captions are available.
- For sensitive content, omit
- Full-mode runner default model is
gpt-5.4-mini.- Override per run with the fifth runner argument:
scripts/run_youtube2md.sh <url> full <output_md_path> <language> <model>. - Override by environment with
YOUTUBE2MD_DEFAULT_MODEL=<model>when the fifth argument is omitted.
- Override per run with the fifth runner argument:
YOUTUBE_COOKIES_PATHorYOUTUBE_COOKIE_HEADERcan be used when YouTube blocks anonymous caption/audio access.- In sensitive environments, audit upstream
youtube2md@1.0.2and dependencies before installation or future version bumps.
See references/security.md before first-time install/enable.
Workflow
-
Validate input
- Accept
youtube.comandyoutu.beURLs. - If a message contains only YouTube URL(s), treat it as a request to summarize with this skill.
- If YouTube URL(s) are provided without an explicit task, default to summary output, not transcript-only output.
- If URLs are missing, ask for one URL per line.
- Accept
-
Choose mode
- Full mode: generates Markdown with youtube2md's summarization pipeline.
- If
OPENAI_API_KEYis visible/available and external API use is acceptable, try full mode first. - Defaults to model
gpt-5.4-minithrough the runner.
- If
- Simple mode: uses youtube2md
--extract-onlyinternally, prepares transcript text (.txt), then summarizes from that transcript.- Use when API key is unavailable, content is sensitive, external API use is not acceptable, or full mode fails/falls back.
- Transcript mode: uses youtube2md
--extract-onlyinternally and returns/prepares transcript output without a summary.- Use when the user asks for transcript extraction, transcript-only output, raw transcript, or machine-readable transcript JSON.
- Prefer a no-error path: check key first and run simple mode directly when key is missing and the user asked for a summary.
- Full mode: generates Markdown with youtube2md's summarization pipeline.
-
Run converter
- Preferred runner script:
scripts/run_youtube2md.sh <url> full [output_md_path] [language] [model]- If
OPENAI_API_KEYis missing, runner auto-falls back to the internal extract path; disclose summary output as simple mode. - If
[model]is omitted, runner passes--model gpt-5.4-miniunlessYOUTUBE2MD_DEFAULT_MODELis set.
- If
scripts/run_youtube2md.sh <url> extract [output_json_path]extractis the runner/CLI mode name.- Disclose it as
simplewhen summarizing from the prepared.txt. - Disclose it as
transcriptwhen returning transcript-only output.
- Optional machine-readable CLI output:
YOUTUBE2MD_JSON=1 scripts/run_youtube2md.sh <url> fullYOUTUBE2MD_JSON=1 scripts/run_youtube2md.sh <url> extract
- Optional stdout/no-file mode:
YOUTUBE2MD_STDOUT=1 scripts/run_youtube2md.sh <url> extract
- Optional output directory:
YOUTUBE2MD_OUT_DIR=./output scripts/run_youtube2md.sh <url> extract
- Runtime controls:
- Use only locally installed
youtube2mdexecutable. - Do not use runtime npm execution (
npx) for this skill.
- Use only locally installed
- Direct CLI equivalent:
youtube2md --url <url> [--out <path>] [--out-dir <dir>] [--lang <language>] --model gpt-5.4-mini- Add
--extract-onlyfor simple/transcript modes. - Add
--jsonfor machine-readable status/errors. - Add
--stdoutto write output to stdout instead of a file.
- Preferred runner script:
-
Verify output
- Full mode: Markdown file exists and is non-empty unless
--stdoutis used. - Simple mode: JSON file exists and prepared TXT file exists and is non-empty when file output is used.
- Transcript mode: JSON or TXT transcript output exists and is non-empty, unless
--stdoutis used. - If using
--json, parseok: true/falseand handle errorcode.
- Full mode: Markdown file exists and is non-empty unless
-
Respond to the user
- Follow
references/output-format.mdas the default response shape. - Follow
references/summarization-behavior.mdfor source policy and chapter/takeaway density. - Do not include generated local file path(s) in normal user-facing replies.
- Share file paths only when explicitly requested by the user (e.g., debugging/export workflows).
- Summary source policy:
- Full mode succeeded -> use youtube2md Markdown output as the summary source.
- Simple mode -> use prepared
.txttranscript text as the summary source. - Transcript mode -> return transcript content or requested transcript artifact details, not a summary.
- Always append a final mode line after the user-facing result:
Mode: fullMode: simpleMode: simple (fallback from full; OPENAI_API_KEY unavailable)when full was requested but the runner fell back and a summary was still produced.Mode: transcriptwhen transcript-only output was requested.
- Keep user-facing flow smooth: if key is missing, use simple output and summarize from
.txtwithout surfacing avoidable tool-error noise.
- Follow
Multi-video requests
- Process URLs sequentially.
- Return per-video results (omit local file paths unless requested).
- Include the final mode line for each video result.
- If any fail, report successful items first, then failures with fixes.
Built-in behavior to trust
- Default output paths:
- Full mode:
./summaries/<video_id>.md - Simple/transcript modes (CLI extract):
./summaries/<video_id>.json - Local runner post-process (simple/transcript modes):
./summaries/<video_id>.txtviaprepare.py
- Full mode:
- Skill runner default full-mode model:
gpt-5.4-miniunless the fifth runner argument orYOUTUBE2MD_DEFAULT_MODELoverrides it. - Upstream youtube2md package default model:
gpt-5-miniwhen no model is passed directly; this skill normally passes its own default. - Transcript strategy:
- YouTube captions via watch-page / InnerTube requests, with YouTube cookies when configured.
youtube-transcriptfallback.- Whisper STT fallback when
OPENAI_API_KEYis available; skipped in simple/transcript modes without an API key.
Packaging hygiene
- Do not publish generated outputs (e.g.,
summaries/*.json,summaries/*.txt) inside the skill folder. - Keep only source files (
SKILL.md,scripts/,references/, helpers) in release artifacts.
Resources
- CLI runner:
scripts/run_youtube2md.sh - Transcript text prep:
prepare.py - Output guidance:
references/output-format.md - Behavior reference:
references/summarization-behavior.md - Security/install notes:
references/security.md - Troubleshooting and error codes:
references/troubleshooting.md






