labali-subtitle-correct-with-reference-text
Treat this skill as a deterministic subtitle-correction runner.
Required Constraints
- Keep subtitle timestamps unchanged.
- Read one subtitle file (
.srtor.vtt) and one reference text file. - Correct subtitle text by sequence alignment against the reference text.
- Preserve subtitle cue count and cue timing boundaries.
- Output a corrected subtitle file.
- Do not call external subtitle APIs.
NEVER
- Never modify, shift, or interpolate cue timestamps — preserve them exactly as read from the input file.
- Never generate output if either the subtitle file or the reference text file is missing or unreadable.
Runtime Inputs
Use skill.yaml as input schema source of truth.
Execution
Use wrapper:
npx tsx skills/private/labali-subtitle-correct-with-reference-text/scripts/run.ts \
--subtitle_path "/path/to/input.srt" \
--reference_path "/path/to/reference.txt" \
[--output_path "/path/to/output.srt"]
Wrapper delegates to:
scripts/fix-subtitle-with-reference.py
Success Criteria
A run is successful only when all conditions hold:
- Input subtitle and reference files both exist.
- Subtitle file is parsed into cues.
- Cue timestamps remain unchanged in output.
- Subtitle text is replaced by aligned reference text segments.
- Output subtitle file is generated.
- Command exits with status code 0.