srt card annotator
npx skills add https://github.com/dean9703111/ai-agent-skill-for-video-workflow --skill SRT Card Annotator
Skill 文档
SRT Card Annotator
This skill provides an AI-driven workflow for analyzing SRT subtitle files and adding contextual reference cards below subtitle text blocks. Cards are intelligently selected based on content context and must not modify original timestamps or subtitle text.
Purpose
Enhance SRT subtitle files with reference cards that:
- Highlight key points, warnings, tips, and structured information
- Are intelligently placed based on content analysis
- Follow strict formatting rules:
[åå¡](word:xxx / type:yyy) - Maintain original subtitle timing and text integrity
- Use contextually appropriate card types from predefined categories
When to Use This Skill
Use this skill when:
- Adding educational annotations to video subtitles
- Highlighting key concepts in transcribed content
- Creating enhanced subtitles with contextual tips and warnings
- Processing Chinese language educational or instructional videos
Card Structure
Each card follows this format:
[åå¡](word:xxx / type:yyy)
Where:
- word: Key phrase extracted from the subtitle segment (10-16 characters max)
- type: One of four predefined types (see Card Types section)
Card Types
Reference references/card-types.yaml for complete definitions. Summary:
| Type | Usage | Context |
|---|---|---|
| éè²éé» | Core conclusions, critical insights | Most important takeaway |
| ç½è²æé | Suggestions, reminders, notes | Helpful tips and advice |
| ç´ è²è¦å | Risks, errors, pitfalls | Dangers and common mistakes |
| èè²åé» | Lists, steps, structured info | Sequential or parallel items |
Card Selection Principles
- Frequency: Minimum 2 cards per 10 subtitle segments
- Length: Extract 10-16 character key phrases from segment content
- Context-aware: Choose type based on semantic meaning:
- Risk/error/pitfall â ç´ è²è¦å
- Suggestion/reminder/note â ç½è²æé
- List/steps/sequence â èè²åé»
- Core conclusion/key insight â éè²éé»
- Precision: Only annotate truly important information
- Integrity: Never modify original timestamps or subtitle text
Core Workflow
1. Load and Parse SRT File
Read the input SRT file and parse into segments:
- Extract subtitle number
- Extract timestamp (start â end)
- Extract subtitle text
- Preserve exact formatting
2. Analyze Content Semantically
For each subtitle segment, analyze:
- Semantic meaning and context
- Presence of key concepts, warnings, or steps
- Relationship to surrounding segments
- Importance level
3. Identify Card Insertion Points
Determine where to insert cards:
- Evaluate each segment for card-worthiness
- Ensure minimum 2 cards per 10 segments
- Prioritize segments with:
- Critical information
- Warnings or risks
- Key conclusions
- Important steps or lists
4. Extract Key Phrases
For selected segments:
- Extract the most important 10-16 character phrase
- Ensure phrase is directly from segment content
- Maintain semantic completeness
- Avoid truncating mid-concept
5. Classify Card Type
For each extracted phrase, determine type:
- ç´ è²è¦å: Contains risk indicators (é¯èª¤ã風éªãé¿å ãä¸è¦ãå±éª)
- ç½è²æé: Contains suggestions (建è°ãæéãæ³¨æãå¯ä»¥ãè¨å¾)
- èè²åé»: Contains list markers (第ä¸ãæ¥é©ãå æ¬ãåçºãæ)
- éè²éé»: Contains conclusions (éé»ãééµãæ ¸å¿ã總çµãæéè¦)
6. Insert Cards
Add card lines below subtitle text:
1
00:00:00,000 --> 00:00:05,000
éåæä½æé¢¨éªï¼è«å°å¿èç
[åå¡](word:æä½æé¢¨éªè«å°å¿ / type:ç´
è²è¦å)
2
00:00:05,000 --> 00:00:10,000
建è°å
åä»½è³æåé²è¡
[åå¡](word:建è°å
åä»½è³æ / type:ç½è²æé)
7. Generate Output File
Save the annotated SRT as reference-cards.srt:
- Maintain all original formatting
- Preserve subtitle numbering
- Keep exact timestamps
- Add card lines only in text blocks
Implementation Guidelines
Reading Card Type Definitions
Before processing, read references/card-types.yaml to understand:
- Available card types
- Usage contexts for each type
- Selection principles
- Examples of appropriate usage
Processing Strategy
- First Pass: Read entire SRT to understand content flow
- Second Pass: Identify high-value segments for annotation
- Third Pass: Extract phrases and classify types
- Final Pass: Insert cards and validate formatting
Quality Checks
Before generating output:
- Verify minimum card frequency (2 per 10 segments)
- Confirm all cards use valid types from
card-types.yaml - Ensure all extracted phrases are 10-16 characters
- Validate no modifications to original content
- Check output filename is
reference-cards.srt
Example Output
Input SRT:
1
00:00:00,000 --> 00:00:03,500
ä»å¤©è¦æå¤§å®¶å¦ä½é¿å
常è¦çé¯èª¤
2
00:00:03,500 --> 00:00:07,000
ç¬¬ä¸æ¥æ¯æª¢æ¥ç³»çµ±è¨å®
Output SRT (reference-cards.srt):
1
00:00:00,000 --> 00:00:03,500
ä»å¤©è¦æå¤§å®¶å¦ä½é¿å
常è¦çé¯èª¤
[åå¡](word:é¿å
常è¦çé¯èª¤ / type:ç´
è²è¦å)
2
00:00:03,500 --> 00:00:07,000
ç¬¬ä¸æ¥æ¯æª¢æ¥ç³»çµ±è¨å®
[åå¡](word:ç¬¬ä¸æ¥æª¢æ¥ç³»çµ±è¨å® / type:èè²åé»)
Important Constraints
Must NOT:
- Modify original subtitle text
- Change timestamps
- Alter subtitle numbering
- Use Python scripts or automation (AI analysis required)
- Create cards longer than 16 characters
- Use card types not defined in
card-types.yaml
Must DO:
- Use AI to analyze content semantically
- Extract phrases directly from subtitle content
- Choose contextually appropriate card types
- Maintain minimum card frequency
- Output to
reference-cards.srt - Preserve all original SRT formatting
Additional Resources
Reference Files
references/card-types.yaml– Complete card type definitions, usage contexts, and selection principles
Workflow Summary
To annotate an SRT file with reference cards:
- Read
references/card-types.yamlto understand card types - Load and parse the input SRT file
- Analyze content to identify key segments
- Extract 10-16 character phrases from selected segments
- Classify each phrase with appropriate card type
- Insert card lines below subtitle text (not modifying original content)
- Save output as
reference-cards.srt - Validate card frequency, formatting, and type validity
Focus on semantic understanding and contextual appropriateness when selecting card types. The goal is to enhance subtitles with meaningful, concise annotations that help viewers grasp key concepts, avoid pitfalls, and follow structured information.