Communitygithub.com

imfangli/srt-script-proofreader

A portable Agent Skill for proofreading ASR-generated SRT subtitles while preserving timestamps.

srt-script-proofreader とは?

srt-script-proofreader is a Claude Code agent skill that a portable Agent Skill for proofreading ASR-generated SRT subtitles while preserving timestamps.

対応~Claude Code~Codex CLI~Cursor
npx skills add imfangli/srt-script-proofreader

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

SRT Script Proofreader

Overview

Correct an ASR-generated SRT by treating its timestamps as fixed and the supplied narration script as a semantic and terminology reference. Produce a corrected SRT that follows what was actually spoken instead of blindly replacing the subtitles with the prewritten script.

Required Inputs

  • Require one uploaded .srt file and one narration script included in the prompt or an attached text file.
  • Identify the intended SRT unambiguously when multiple subtitle files are present. Ask for clarification only when selection cannot be inferred safely.
  • Request the missing SRT or script when either input is absent; do not fabricate it.

Correction Priorities

Apply this evidence order:

  1. Preserve every cue index and timestamp exactly as written in the source SRT.
  2. Preserve locally coherent wording that reflects spontaneous additions, omissions, repetitions, reordered ideas, or other deviations in the actual recording.
  3. Use the narration script to resolve obvious ASR errors, especially homophones, similar-sounding words, incorrect capitalization, English words, product names, personal names, technical terms, abbreviations, and numbers.
  4. Use neighboring cues and the overall meaning to repair garbled fragments when a direct cue-to-script match is unavailable.
  5. Preserve the speaker's intended language, tone, and natural spoken phrasing. Correct recognition mistakes without rewriting the speech into polished written prose.
  6. Avoid inserting script content merely because it is absent from the SRT. Treat a script-only passage as unspoken unless surrounding ASR evidence strongly indicates an omission caused by recognition failure.
  7. Avoid deleting an SRT-only passage merely because it is absent from the script. Retain it when it is meaningful in context and plausibly spoken.

Workflow

  1. Read the full narration script to establish topic, structure, terminology, names, capitalization, and number formats.
  2. Parse the SRT into cue indices, timestamp ranges, and text. Keep an untouched source copy for validation.
  3. Align SRT passages to the script by meaning rather than exact string matching. Use broader paragraph-level alignment when the actual recording changes order or wording.
  4. Correct each cue conservatively according to the correction priorities. Move a word between adjacent cue texts only when needed to keep the spoken phrase aligned with its existing time range; never move or alter timestamps.
  5. Preserve cue count, cue order, cue indices, timestamp strings, and valid SRT structure. Keep subtitle line breaks readable; do not add notes, uncertainty markers, Markdown, or commentary inside subtitle text.
  6. Remove all punctuation from the semantic end of every cue, including Chinese and English commas, periods, semicolons, colons, question marks, exclamation marks, enumeration commas, ellipses, and dashes. Preserve punctuation inside a cue. When one or more closing quotation marks or brackets end the cue, remove punctuation immediately before them but retain the closing marks.
  7. Save the result beside the source or in the requested output location as <source-stem>_corrected.srt. Encode as UTF-8 and preserve a source UTF-8 BOM when present.
  8. Run python3 scripts/validate_srt_preservation.py <source.srt> <corrected.srt> from the skill root.
  9. Fix all reported structural, index, timestamp, empty-cue, or terminal-punctuation errors, then rerun validation until it passes.
  10. Return a link to the corrected SRT and briefly state that timestamps were preserved. Mention unresolved ambiguity only outside the file and only when it could materially affect accuracy.

Quality Standard

  • Favor a confident correction when the script and local phonetic or semantic evidence agree.
  • Favor the actual SRT wording when it forms a coherent spoken alternative to the script.
  • Review cue boundaries around every substantial correction to prevent duplicated or dropped words.
  • Keep internal punctuation consistent and natural without changing meaning, but never leave sentence-ending punctuation at the end of a cue.
  • Deliver only after the bundled validator succeeds.

Example Trigger

Trigger on requests such as: “这是机器识别的 SRT,时间戳是准的;请参考下面这份口播稿校正错字和专有名词,但实际录音和稿子不完全一样,最后给我一份修正后的 SRT。”

Resources

scripts/

  • validate_srt_preservation.py: Compare a corrected SRT with its source and fail when cue count, indices, timestamps, structure, nonempty text, or terminal-punctuation requirements differ.

関連スキル