---
name: SRT Card Annotator
description: This skill should be used when the user asks to "add reference cards to srt", "annotate srt with cards", "insert cards into subtitles", "generate srt with card annotations", "add 字卡 to srt", or needs to add contextual reference cards below subtitle text blocks in SRT files.
version: 0.1.0
title: SRT Card Annotator
canonical_url: https://skilld.dev/gh/dean9703111/ai-agent-skill-for-video-workflow/srt-card-annotator
last_updated: 2026-09-25T01:20:06.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/card-types.yaml](https://skilld.dev/api/skills-raw/dean9703111/ai-agent-skill-for-video-workflow/srt-card-annotator/references/card-types.yaml).
>
> If the user asked to install this Skill, run `npx skilld install dean9703111/ai-agent-skill-for-video-workflow/srt-card-annotator`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/srt-card-annotator`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/dean9703111/ai-agent-skill-for-video-workflow/srt-card-annotator) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/srt-card-annotator`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/srt-card-annotator --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/srt-card-annotator --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# 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

1. **Frequency**: Minimum 2 cards per 10 subtitle segments
2. **Length**: Extract 10-16 character key phrases from segment content
3. **Context-aware**: Choose type based on semantic meaning:
   - Risk/error/pitfall → 紅色警告
   - Suggestion/reminder/note → 白色提醒
   - List/steps/sequence → 藍色列點
   - Core conclusion/key insight → 金色重點
4. **Precision**: Only annotate truly important information
5. **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

1. **First Pass**: Read entire SRT to understand content flow
2. **Second Pass**: Identify high-value segments for annotation
3. **Third Pass**: Extract phrases and classify types
4. **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:

1. Read `references/card-types.yaml` to understand card types
2. Load and parse the input SRT file
3. Analyze content to identify key segments
4. Extract 10-16 character phrases from selected segments
5. Classify each phrase with appropriate card type
6. Insert card lines below subtitle text (not modifying original content)
7. Save output as `reference-cards.srt`
8. 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.
