# Labali Subtitle Correct With Reference Text

> Correct subtitle wording using a reference script that has accurate text but no timestamps. Use when the existing subtitle file (.srt, .vtt, or similar) already has correct timestamps but wrong words, and a separate reference text (script, transcript) is available for textual correction.

- Skill: `kingson4wu/labali-subtitle-correct-with-reference-text` (Agent Skill, multi-file: 10 files)
- Install (CLI): `npx skillmds@latest add kingson4wu/labali-subtitle-correct-with-reference-text`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kingson4wu/labali-subtitle-correct-with-reference-text/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: Kingson4Wu (https://skillmd.com/u/kingson4wu)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kingson4wu/labali-subtitle-correct-with-reference-text

---


# 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 (`.srt` or `.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:

```bash
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:

1. Input subtitle and reference files both exist.
2. Subtitle file is parsed into cues.
3. Cue timestamps remain unchanged in output.
4. Subtitle text is replaced by aligned reference text segments.
5. Output subtitle file is generated.
6. Command exits with status code 0.

