One Go binary with a subcommand per former script, invoked as 'go run ./scripts/newsletter <command>' from repo root. Stdlib only; publications config embedded via go:embed (go run recompiles on edit). Behavior parity verified side-by-side before deleting the JS — see plans/reports/parity-260818-newsletter-go-migration-report.md. Permissions: allow 'Bash(go *)', drop 'Bash(node *)' and the redundant 'Write(content)' rule (Edit rules cover all file-editing tools).
2.9 KiB
name, description
| name | description |
|---|---|
| mt-add-video | YouTube video handler for the Hugo blog newsletter. Adds a YouTube link to today's newsletter Bonus → Videos section as a Vietnamese title link plus a 1-2 sentence Vietnamese summary. Normally invoked by the mt-add-url meta skill after classification, but can be used directly for a known YouTube URL. Handles YouTube links only (not direct video files). |
Overview
mt-add-video is the YouTube handler: given a YouTube link, it adds the video to today's newsletter Bonus → Videos as a Vietnamese title link with a 1-2 sentence Vietnamese summary. It does not classify or route — that is mt-add-url's job.
Scope: YouTube links only (watch, youtu.be, shorts). Direct video files (.mp4 etc.) are not handled here — they go through mt-add-url's fallback.
Shared scripts: scripts/newsletter/. Shared procedure: ../mt-add-url/references/newsletter-post-mechanics.md — follow it for post find/create, numbering, Bonus insertion, and language rules.
Input
A clean YouTube URL (passed by mt-add-url, or given directly).
Workflow
-
Classify / fetch title — run the router to get the canonical URL + title:
go run ./scripts/newsletter add-url "<url>"Confirm
route: youtube; skip ifduplicateor notaccessible. Use the returnedclean_url(canonicalwatch?v=ID) andtitle.- If
titleis missing (oEmbed failed), fetch the title via WebFetch on the watch URL.
- If
-
Localize title — render the title in Vietnamese where natural; keep proper nouns (product/company/channel names) as-is.
-
Write a 1-2 sentence Vietnamese summary. Source for the summary content, in order:
- WebFetch the watch URL for the video description.
- If thin/unavailable, optionally use the
ai-multimodal(Gemini) skill to analyze the video — only if available. - Worst case, derive a single sentence from the title. Keep it to 1-2 sentences (KISS).
-
Post mechanics — follow
../mt-add-url/references/newsletter-post-mechanics.mdto find/create today's post and locate the Bonus section. -
Insert under Bonus → Videos:
**Videos:** [Tiêu đề video tiếng Việt](https://www.youtube.com/watch?v=ID) > Tóm tắt 1-2 câu về nội dung video.- If
### Bonusdoesn't exist yet, create it (there's now an asset to put in it). - If
**Videos:**already exists, append the new entry under it; otherwise create the**Videos:**subsection.
- If
-
Report:
✅ Video added to Newsletter #[number] (Bonus → Videos) 📄 content/post/YYYY/MM/DD/index.md 🎬 [Vietnamese title] — [clean_url]
Checklist
route: youtubeconfirmed; not a duplicate- Title in Vietnamese (proper nouns kept)
- 1-2 sentence Vietnamese summary present
- Entry under Bonus → Videos (section/subsection created if missing)
- Vietnamese content ≥99%