/lattifai-skills:lai-summarizefrom lattifai-skills
Summarizes transcripts, podcasts, or long captions into structured markdown with TL;DR, chapters, timestamps, quotes, and entities. Uses the session's LLM directly, no external API needed.
Ships in lattifai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Preferred model: Claude Sonnet (cost-efficient for this agent-driven workload). This skill runs on whatever model is active in the parent session — any Claude model works; no hard switch.
This skill summarizes using the agent's own LLM capability — the model you are running right now. It does not call out to any external LLM service by default. Helper scripts turn the source into an agent-ready prompt and validate the finished summary, so the agent only has to write prose.
Primary path (agent-driven, default): prepare.py → agent writes summary.md → validate.py.
Secondary path: lai summarize caption (CLI with its own LLM backend) — only when the transcript is too large for the agent's context, or there is no agent in the loop.
Any caption format supported by lattifai-captions (SRT, VTT, ASS, JSON, Gemini markdown, plain text, …).
Optional meta.md beside the source enriches the summary. If meta.md defines chapters:, those titles and timestamps are hard constraints — no merge, split, rename, or reorder.
meta.md must wrap its YAML in --- frontmatter delimiters; otherwise validate.py can't parse it and hard constraints are silently skipped (with a warning on stderr). Minimal template:
---
title: "Episode Title"
chapters:
- { title: "Intro", start: 0.0, end: 60.0 }
- { title: "Main Topic", start: 60.0, end: 420.0 }
---
Free-form notes below the frontmatter are fine.
<source> — caption/transcript file--output <path> — default <source>.summary.md--meta <path> — episode metadata (auto-detected beside source)--lang <code> — summary language (default: source language)short / medium / long ≈ 200–400 / 500–1000 / 1000–2000 words (default medium)<base> = source media stem (e.g. podcast from podcast.mp3) or YouTube ID. Files all land in the current directory:
# 1. Build an agent-ready prompt input from the source + meta.md
python skills/lai-summarize/scripts/prepare.py podcast.aligned.json -o podcast.prompt_input.md
# 2. Agent reads <base>.prompt_input.md and writes <base>.summary.md per the schema below.
# 3. Validate frontmatter, chapters, and verbatim quotes
python skills/lai-summarize/scripts/validate.py podcast.aligned.json podcast.summary.md
prepare.py produces a transcript with [MM:SS] timestamps and speaker labels, plus a # Meta block that marks meta.md chapters as HARD CONSTRAINT when present.
---
title: "Episode Title"
seo_title: "SEO title (≤60 chars)"
seo_description: "One-sentence description (≤160 chars)"
tags: ["tag1", "tag2"] # 4–8 tags
chapters:
- { title: "Chapter Title", start: 10.0, end: 52.0 }
confidence: 0.85 # 0.0–1.0 self-assessment
source_quality: high # high | medium | low
---
TL;DR paragraph (2–4 sentences, active voice).
## [00:10] Chapter Title
Summary paragraph(s).
> *"Verbatim quote, ≤40 words."*
## Entities
- **Name** (Person|Concept|Organization): one-line context
validate.py checksseo_title ≤ 60, seo_description ≤ 160tags: 4–8 entrieschapters: 1–8, each with title/start/end, start < endmeta.md verbatim when present## [MM:SS] Title headers match frontmatter chapters 1:1 in order> *"quote"* appears verbatim in source transcript textconfidence ∈ [0, 1]; source_quality ∈ {high, medium, low}Requires pyyaml (stdlib argparse / re otherwise).
The CLI takes two positional args (input, output); there is no -o:
lai summarize caption podcast.aligned.json podcast.summary.md
Configure an LLM backend once (required for this path only):
lai config set summarization.llm.model_name gemini-3-flash-preview
# Gemini key: see /lai-transcribe
# Or OpenAI-compatible:
lai config set summarization.llm.model_name gpt-4o
lai config set OPENAI_API_KEY <your-key>
CLI options: summarization.lang=zh, summarization.length=short, summarization.output_format=json, meta=video.meta.md.
| Problem | Fix |
|---|---|
validate.py flags quote not in source | Quote must be verbatim — rewrite or pick another line |
| Chapter count / timestamp drift from meta.md | Hard constraint — use meta.md values exactly |
| Transcript too large for the agent | Fall back to CLI (secondary path) |
meta.md chapters malformed | Remove from meta.md and let the agent generate chapters |
/lai-transcribe — produce the transcript first/lai-align — precise timestamps feed chapter boundaries/lai-diarize — speaker labels enable speaker-aware summaries/lai-translate — translate the summaryWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lattifai/lattifai-skills --plugin lattifai-skills9 skills in this plugin
/lai-alignAlign existing captions to audio/video with word-level precision using the Lattice-1 model. Trigger when the user has both a media file AND a caption/transcript that need to be synchronized, or says "fix caption timing", "字幕对不上", "对齐字幕", "word-level timestamps", "karaoke timing", "timestamps are off". Do NOT trigger without existing text — use `/lai-transcribe` first./lai-captionConvert between 30+ caption/subtitle formats (SRT, VTT, ASS, JSON, TextGrid, LRC, FCPXML, Premiere, …) and shift timing. Trigger on "convert captions", "SRT to VTT", "转换字幕格式", "shift timing", "ASS styling", "karaoke effect", "导入Premiere", or any caption-format question. Do NOT trigger to fix timing accuracy (`/lai-align`) or translate (`/lai-translate`)./lai-diarizeIdentify speakers ("who said what") in aligned captions via pyannote.audio. Real speaker names come from the agent's own reasoning over transcript + context (default), with a CLI-LLM fallback for headless runs. Trigger on multi-speaker content (podcasts, interviews, meetings) or phrases like "diarize", "speaker detection", "说话人识别", "区分说话人", "label the speakers". Requires aligned captions — run `/lai-align` first./lai-karaokeGenerate viral-ready karaoke / lyric-video subtitles with per-word highlighting in one command. Adaptive font size from media resolution. Ready-made style presets for TikTok, Reels, Shorts, 抖音, 小红书, YouTube, and cinematic long-form. Trigger on "karaoke 字幕", "卡拉OK", "lyric video", "逐词歌词", "按字高亮", "TikTok 字幕", "抖音字幕", "Reels caption", "Shorts caption", "小红书歌词", "viral subtitles", "爆款字幕", or when a song / podcast / video clip is given and per-word highlighted captions are asked for. For general caption format conversion without karaoke styling, use /lai-caption./lai-setupInstall LattifAI and get a free trial API key. Trigger on first mention of LattifAI / `lai`, authentication errors, trial requests, or "how do I get started with alignment" / "我想做字幕对齐" before `lai --version` is verified. Do NOT trigger when already authenticated — route to `/lai-align`, `/lai-transcribe`, etc./lai-transcribeTranscribe audio/video to timestamped captions with Gemini (100+ languages) or local Parakeet / SenseVoice models. Trigger on "transcribe", "speech to text", "转录", "语音转文字", "generate captions from audio", or when the user provides an audio/video file with no text. If the YouTube video already has captions, prefer `/lai-youtube`.Other plugins' skills for the same job