Subtitle Correction Skill
This skill corrects speech recognition errors in subtitle files while strictly preserving timeline information.
Interactive Workflow
Step 1: Request Terminology from User
IMPORTANT: Before starting any correction, ALWAYS ask the user for domain-specific terms.
Prompt the user with:
For English users:
Step 2: Confirm Understanding
After receiving terms, confirm by:
- Listing the terms received
- Identifying the likely domain/context (AI/ML tutorial, web dev, etc.)
- Asking if there are any additional terms before proceeding
Example response:
Step 3: Process with Terms
Use the provided terms to:
- Build a mental model of expected vocabulary
- Identify likely speech recognition errors
- Apply consistent corrections throughout
When User Doesn't Provide Terms
If user says "没有" / "no" / "直接开始":
- Proceed with correction using built-in patterns
- Flag uncertain corrections for user review
- After completion, ask if any terms were missed
Core Workflow
- Read the subtitle file - Load the .srt file provided by the user
- Identify error patterns - Recognize common speech recognition mistakes
- Apply corrections - Fix errors while preserving timestamps exactly
- Output corrected file - Return or save based on user's context
Strict Rules
Timeline Preservation
- NEVER modify timestamps - Keep all
00:00:00,000 --> 00:00:00,000lines exactly as-is - NEVER change subtitle numbering - Preserve sequence numbers
- NEVER merge or split subtitle entries - One-to-one correspondence
Error Categories
1. Phonetic Errors (同音字/谐音错误)
Common in Chinese speech recognition:
- 会话 ↔ 绘画 (huìhuà)
- 元数据 ↔ 源数据 (yuán shùjù)
- 本课 ↔ 本科 (běnkè)
- 示例 ↔ 事例 (shìlì)
- 实践 ↔ 时间 (shíjiàn)
2. Technical Term Errors
Speech recognition often fails on:
- Framework names: LangChain, LangGraph, OpenAI, PyTorch, TensorFlow
- Programming terms: API, SDK, runtime, checkpointer, middleware
- Code identifiers: snake_case names, function names, class names
3. English-Chinese Mixed Content
- Luncheon/lunch → langchain
- open EI/open Email → OpenAI
- land GRAPH → langgraph
- a memory Server → MemorySaver
4. Code-Related Terms
Convert spoken descriptions to proper format:
- "underscore" → "_" in variable names
- "dot" → "." in method calls
- Recognize camelCase, snake_case, PascalCase patterns
User-Provided Terminology
When users provide a terminology list, use it as the primary reference for corrections:
These terms indicate:
- Expected proper spellings of technical terms
- Context about the content domain
- Hints for identifying speech recognition errors
Processing Strategy
For Long Files (>200 lines)
- Process in chunks using
view_rangeparameter - Maintain context across chunks
- Build complete corrected file incrementally
For Technical Content
- Identify the domain (AI/ML, web dev, etc.)
- Build mental model of expected terminology
- Apply domain-specific corrections consistently
Quality Checks
Before outputting:
- Verify all timestamps unchanged
- Verify subtitle count unchanged
- Check terminology consistency throughout
- Ensure no orphaned corrections (partial fixes)
Common Correction Patterns
Chinese AI/ML Course Content
Code Identifiers
Output Format
When saving, use -corrected suffix:
- Input:
filename.srt - Output:
filename-corrected.srt
Validation Script
Use scripts/subtitle_tool.py to validate and analyze subtitle files:
Diff Output Formats
Terminal Output (Default)
Shows word-level changes with colors:
[-deleted-]- Text removed (shown in red in terminal){+added+}- Text added (shown in green in terminal)- Use
--allto show unchanged entries too
HTML Report (Recommended for Review)
Generates a full comparison report with:
- All entries displayed (changed and unchanged)
- Side-by-side columns: Original | Corrected | Diff View
- Visual highlighting: Red strikethrough for deletions, green for additions
- Summary statistics: Total entries, changed count, unchanged count
- Jump links: Quick navigation to changed entries
- Change indicators: Yellow dot marks changed rows
Then open diff_report.html in a browser.
Validation Workflow
- Before correction: Run
analyzeto identify potential errors - After correction: Run
validateto ensure structural integrity - Review changes: Run
diff --html report.htmlto generate a visual comparison report
Validation Checks
- Entry count matches original
- All timestamps unchanged
- All sequence numbers preserved
- No formatting corruption
Example Interaction
Interaction 1: User uploads file without terms
User: 帮我修正这个字幕文件
Claude:
User: LangChain, Agent, OpenAI, LangGraph, checkpointer
Claude:
User: 没有了,开始吧
Claude: [Proceeds with correction workflow]
Interaction 2: User provides terms upfront
User: 帮我修正字幕,术语:LangChain, OpenAI, Agent
Claude: [Confirms terms, then proceeds directly]
Correction Process
- Read uploaded .srt file
- Run
analyzeto identify potential errors - Apply corrections using provided terms as primary reference
- Run
validateto confirm structural integrity - Save corrected file with
-correctedsuffix - Generate diff report and present summary of changes
- Offer HTML report: Ask user if they want an HTML diff report for easier review
Output: Provide categorized summary of corrections made.
After completion, prompt user:


