SRT Proofreader
Execute the workflow in order. Keep edits minimal and deterministic.
1. Enter srts/
- 1. Change directory to the task's
srts/ folder. - Stop and report if
srts/ does not exist.
2. Ensure Git Baseline
- 1. Check whether
srts/ is already inside a git repository. - If not inside a git repository:
- run
git init
- run
git add .
- run
git commit -m "init srt"
- 3. Do not rewrite existing history.
3. Require and Read source.md
- 1. Check whether
srts/source.md exists. - If missing, stop immediately and tell the user:
还没有创建 source.md. - Read
source.md before editing subtitles. - Extract terminology and proper nouns from
source.md, then use them as authoritative wording.
4. Select the Main .srt File
- 1. List candidates in
srts/ with:
- extension
.srt
- filename not starting with
. or
_
- 2. Require exactly one candidate.
- If zero candidates, stop and report.
- If multiple candidates, stop and ask the user which file is the main subtitle file.
5. Handle Large Files (>400 lines)
- 1. Count lines in the main
.srt. - If line count is
<=400, edit directly. - If line count is
>400:
- split into
section-001.srt,
section-002.srt, ... using
scripts/srt_sections.mjs
- edit each section sequentially
- merge sections back and overwrite the original main
.srt using the same script
- 4. Use this script interface:
- tool path:
scripts/srt_sections.mjs
- split:
node scripts/srt_sections.mjs split --input <main.srt> --output <dir> --chunk 400
- merge: INLINECODE27
6. Subtitle Editing Rules
- 1. Edit only typo-level text issues and term consistency.
- Never modify subtitle sequence numbers.
- Never modify timestamp lines (
-->). - Preserve original line structure and blank-line boundaries.
- Use
source.md terminology as first priority. - Do not introduce new trailing punctuation on the final subtitle text line.
7. Final Verification
- 1. Review
git diff and confirm index/timestamp lines are unchanged. - Confirm only subtitle text lines were modified.
- Report completion with a short summary of corrected term categories.
SRT 校对工具
按顺序执行工作流程。保持最小化且确定性的编辑。
1. 进入 srts/ 目录
- 1. 切换到任务的 srts/ 文件夹。
- 如果 srts/ 不存在,则停止并报告。
2. 确保 Git 基线
- 1. 检查 srts/ 是否已在 git 仓库中。
- 如果不在 git 仓库中:
- 运行 git init
- 运行 git add .
- 运行 git commit -m init srt
- 3. 不要重写现有历史记录。
3. 要求并读取 source.md
- 1. 检查 srts/source.md 是否存在。
- 如果缺失,立即停止并告知用户:还没有创建 source.md。
- 在编辑字幕前读取 source.md。
- 从 source.md 中提取术语和专有名词,并将其作为权威用词。
4. 选择主 .srt 文件
- 1. 在 srts/ 中列出符合以下条件的候选文件:
- 扩展名为 .srt
- 文件名不以 . 或 _ 开头
- 2. 要求恰好有一个候选文件。
- 如果没有候选文件,停止并报告。
- 如果有多个候选文件,停止并询问用户哪个文件是主字幕文件。
5. 处理大文件(超过 400 行)
- 1. 统计主 .srt 文件的行数。
- 如果行数 <=400,直接编辑。
- 如果行数 >400:
- 使用 scripts/srt_sections.mjs 分割为 section-001.srt、section-002.srt 等文件
- 依次编辑每个分段
- 使用相同脚本合并分段并覆盖原始主 .srt 文件
- 4. 使用此脚本接口:
- 工具路径:scripts/srt_sections.mjs
- 分割:node scripts/srt_sections.mjs split --input <主文件.srt> --output <目录> --chunk 400
- 合并:node scripts/srt_sections.mjs merge --input-dir <目录> --output <主文件.srt>
6. 字幕编辑规则
- 1. 仅编辑拼写级别的文本问题和术语一致性。
- 绝不修改字幕序号。
- 绝不修改时间戳行(-->)。
- 保留原始行结构和空行边界。
- 优先使用 source.md 中的术语。
- 不要在字幕文本行的末尾添加新的标点符号。
7. 最终验证
- 1. 检查 git diff 并确认索引/时间戳行未更改。
- 确认仅修改了字幕文本行。
- 报告完成情况,并附上已修正术语类别的简短摘要。