---
name: subtitle-corrector-yashu
description: 本技能专门纠错「音频转文字」生成的纯文本字幕：将文中专有名词的误写归一为正字，并修正其他明显错别字、删除口语填充词。激活条件：用户消息须包含以下关键词之一：`字幕纠错`、`校正音频转文字`、`音频转文字字幕纠错`、`字幕错别字修正`、`字幕校订`。
disable-model-invocation: false
title: subtitle-corrector-yashu
canonical_url: https://skilld.dev/gh/steelan9199/wechat-publisher/subtitle-corrector-yashu
last_updated: 2026-10-07T07:20:50.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: [scripts/correct.py](https://skilld.dev/api/skills-raw/steelan9199/wechat-publisher/subtitle-corrector-yashu/scripts/correct.py).
>
> If the user asked to install this Skill, run `npx skilld install steelan9199/wechat-publisher/subtitle-corrector-yashu`. 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/subtitle-corrector-yashu`, 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/steelan9199/wechat-publisher/subtitle-corrector-yashu) 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/subtitle-corrector-yashu`. 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/subtitle-corrector-yashu --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/subtitle-corrector-yashu --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.

# 字幕纠错 Skill（Subtitle Corrector）· 推断归一版

把一份「音频转文字」产生的纯文本字幕，纠错成干净可读的版本。**原始文件绝不被修改**，结果写入新文件。

## 核心原则

- **原始文件只读**：任何情况下不写入、不重命名、不删除用户提供的原 txt。
- **专有名词只给正字**：用户提供的只是一串「正确写法」的专有名词（用逗号 `,`、中文逗号 `，` 或空格分隔）。文中对应的误写（音近/形近）由你（AI）去推断并改成正字。例如用户给 `小明`，文中若是 `小名`/`晓明`，你高置信度地归一为 `小明`。
- **高置信度才改（宁漏勿错）**：只有当你相当确信某处是同一专有名词的误写时才改；拿不准就保留原样，绝不为「通顺」而臆造或误伤正常词。
- **填充词清理 + 语境增强**：删口语填充词，并顺手修其他明显错别字。

## 工作流

### 第 1 步：解析用户输入

从用户消息提取两类信息：

1. **输入文件路径**：绝对路径，如 `D:\temp\8月17日.txt`（Windows 反斜杠原样保留）。
2. **专有名词清单（仅正字）**：用户直接给的一串正确写法，用 `,` / `，` / 空格 分隔。
   - 例：`小明, 李娇, 张总` 或 `小明 李娇 张总`
   - 这些是「标准名」，你需要用它们在文中定位并修正误写。
   - 若用户未提供任何专有名词，仍可执行「填充词清理 + 语境增强」，但不要臆造专有名词。

> 不要期待用户给出「错→对」格式——他们只给对的那一面，错的那一面由你推断。

### 第 2 步：AI 语义纠错（核心、必做）

读取原文件全文，做一遍**人工复核式**的纠错，产出纠错后的文本（先在内存/草稿中）：

1. **专有名词归一**：对清单里每个正字，扫描全文，找出高置信度的误写并改成正字。
   - 依据：音近（小名/晓明→小明）、形近、同音字、以及上下文语义一致性。
   - 仅在「高度确信是同一实体/术语的误写」时改；若某正字在文中本就写对，无需处理；若文中出现读音相近但可能是另一个正常词，则保留。
   - 例：用户给 `张总`，文中 `张忠`/`章总` 在语境指同一人 → 归一为 `张总`。
2. **其他错别字（语境增强）**：顺手修正明显音近/形近错别字（如 `在见→再见`、`人工只能→人工智能`），同样只改高置信度的。
3. 保留原段落、空行、标点结构；**严禁**增删事实或改写用户原意。

> 边改边记录改动清单（「原词 → 正字」），用于最后汇报。

### 第 3 步：写入并做确定性后处理

1. 将第 2 步得到的文本写入 `_corrected.txt`（与原文件同目录，文件名 `原名_corrected.txt`，编码 `utf-8-sig`，保证 Windows 记事本正常显示中文）。
   - 可用 Write 工具直接写出。
2. 运行本技能目录下的 `scripts/correct.py` 对该文件再做一遍**确定性填充词清理 + 标点规整**（脚本只删安全的单字/短语填充词，不会动你已归一好的专有名词）：
   ```bash
   python3 "<skill_dir>/scripts/correct.py" -i "D:\temp\8月17日_corrected.txt" -o "D:\temp\8月17日_corrected.txt"
   ```
   - 脚本会打印 `OUTPUT:` 与 `REPORT:`（含各填充词命中次数），读取以便汇报。
   - 如需自定义填充词，用 `--fillers "啊" "额" ...`；如要跳过，用 `--no-filler`。

### 第 4 步：向用户汇报

简洁说明：
- 输出文件路径（强调原文件未改动）。
- **专有名词归一**：列「误写 → 正字」若干例（来自第 2 步记录）。
- **其他错别字修正**：举 2-3 个典型（如 在见→再见）。
- **填充词删除**：来自脚本 REPORT 的统计。
- 提醒：对「高置信度才改」未敢确定的地方，可让用户补充指正。

## 边界与注意事项

- 文件很大时，AI 语义纠错可分段阅读、逐段覆盖，但注意保持整体一致；脚本后处理照常处理整文件。
- 不要为了「通顺」而改变用户已写对的专有名词、数字、术语。
- 编码默认输出 `utf-8` 无`BOM`；若用户要求其他编码，用 `--encoding-out` 指定。

## 示例

用户：「帮我纠错字幕 D:\temp\8月17日.txt ，专有名词：小明, 李娇, 张总」

→ AI 读原文，发现 `小名`/`晓明`→`小明`、`李叫`→`李娇`、`张忠`→`张总`（高置信度），顺手修 `在见`→`再见`；写入 `D:\temp\8月17日_corrected.txt`；再用 correct.py 做填充词+标点清理；最后汇报改动清单。
