Extracts Word/WPS docx comments and track changes into a markdown reconciliation table or JSON for per-item adjudication. Handles insertion/deletion revisions that python-docx misses, supports resolved comments and full-document comparison against a baseline.
Ships in daymade-docs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
一条命令把审阅过的 docx 读成对账表:谁批的、批在哪段、批了什么、处理状态,外加修订模式的 逐段删改。产出表格自带空白「处置」列——它的用途就是拿去逐条裁决。
引擎提炼自作者一个真实图书出版项目的审阅工具链(2026-02 起生产验证:单文件 96 条编辑批注、 整书修订处理、输入含 WPS 云文档导出件),此处为通用化版本。书稿级的深度编辑工作流(版本链、 批注 resolve 状态机、审阅看板)留在原项目(私有),不在本 skill 范围。
本文全部命令都假设工作目录是本 skill 根目录(scripts/ 是相对路径)——先 cd 过来,
或把 scripts/… 换成绝对路径;docx 参数无所谓相对绝对。
uv run python scripts/extract_review.py <审阅稿.docx>
预期输出(有批注时):
# 审阅对账 · 某某协议-审阅版.docx
批注 12 条(未处理 10 / 已处理 2,其中回复 1 条);修订段落 3 个(删除元素 2、插入元素 4)。
## 批注
| # | 批注人 | 时间 | 锚定段落 | 批注内容 | 状态 | 处置 |
|---|---|---|---|---|---|---|
| 0 | 张三 | 2026-02-14 16:02 | 乙方应于收到通知后 15 个工作日内… | 15 天太短,建议 30 天 | 未处理 | |
| ↳1 | 李四 | 2026-02-14 18:11 | (回复 #0) | 同意,30 天合理 | 未处理 | |
## 修订(track changes)
| 段落 | 删除 | 插入 | 处置 |
|---|---|---|---|
| 47 | 百分之十五 | 百分之十 | |
无批注无修订时输出明确提示。零审阅痕迹不等于没有改动:有明确已发基线时继续走下方 全文对比;缺基线时只报告痕迹为空,索取准确已发文件,不推断对方没改或没意见。
变体:
# 机器可读全量(锚定段落不截断、含全部字段)
uv run python scripts/extract_review.py <docx> --json
# 对账表包含已处理(resolved)的批注(默认只列未处理)
uv run python scripts/extract_review.py <docx> --include-resolved
要看某条批注前后更多上下文段落(Markdown 锚定列为缩略文本,--json 里是全文):
uv run python -c "
import sys; sys.path.insert(0, 'scripts') # 同样假设 cwd = skill 根目录
from bridge_lib.docx_bridge_client import extract_views
for v in extract_views('<docx>', paragraph_range=(40, 55)): # 批注锚定段落 ±N
print(v['index'], v['display'][:100])"
python-docx 的 paragraph.text 走 paragraph.runs,runs 只取直接子 <w:r>、不递归
<w:ins> 包装——对方用修订模式插入的所有内容都会被漏读;裸 lxml 的 .//w:t 能读到
ins,但认不出「段落标记被 <w:del> 包装的整段」(接受修订后会整段消失的内容仍有 <w:t>)。
两个方向的漏读都在真实出版审阅稿上踩过。本 skill 的 csx 引擎基于 OpenXML SDK,旧读取
接口报告所支持的段落增删及文本视图,不保证覆盖所有修订类型。机制细节、段落索引语义(body 直接子段,
与 python-docx 对齐、不递归表格内段)及各 csx 的出参规格见
references/csharp-tasks-spec.md。
scripts/bridge_lib/docx_bridge_client.py 是 Python 入口层:list_comments() /
list_revisions() / extract_views() / paragraph_text();调用与缓存行为由该文件定义。
写自定义分析时 import 它,别绕过它手解 XML。
先固定准确基线和对照稿,保留原件。核对对方回稿时,基线必须有实际发送证据;用户明确 指定的双版本控制、生成件与人工编辑件也可比较,但不能据此称基线“已发送”。读取 全文对比流程,再运行:
uv run python scripts/compare_docx.py <基线.docx> <对照稿.docx>
uv run python scripts/compare_docx.py <基线.docx> <对照稿.docx> --json
# 按事项选择关键承诺;核对完整所在文本块及出现次数,不只查关键词仍在
uv run python scripts/compare_docx.py <基线.docx> <对照稿.docx> --unchanged '付款条件'
覆盖正文、页眉页脚、脚注尾注、表格文本和合并结构。脚本复用 SDK bridge,遇未决修订即
明确拒绝比较;先由已有修订感知流程在副本落实已确认视图,再比副本。此门只约束新比较入口,
旧 extract_review.py 与三视图 API 仍读取带修订稿。移位/改写对应是人工核对线索;正文、
图片及版式的覆盖边界和简洁交付格式见该流程。合成回归:
python3 -m unittest discover -s tests -v(SDK 用例需要下方依赖)。
brew install dotnet # 或已有任意 .NET SDK
dotnet tool install -g dotnet-script # csx 运行时
docx_bridge_client.py 定义。scripts/csharp/tasks/ 内各 .csx 的 #r 声明定义。
首次 restore 或缺缓存时需要网络;失败读取真实错误,不用固定耗时判断是否正常。uv run python 或系统 python3 都能跑。| 症状 | 原因 | 处理 |
|---|---|---|
csx script failed … dotnet-script: command not found | dotnet-script 未装 | 按依赖节准备工具 |
| 首次运行等待或失败 | 可能需要 NuGet restore | 检查实际输出和现有缓存;缺包的离线环境需在授权范围内完成 restore,不以等待时长判定正常 |
| 批注 0 条,但对方说改过 | 可能直接改了正文,也可能导出时丢了痕迹 | 有明确已发基线先走全文对比;对方确认有批注但本地未携带时,再取保留批注的 docx 导出件 |
| 批注在,但「按章节筛选」类需求做不了 | 文档没用 Word Heading 样式(很多生成器直排文本) | 用锚定段落号定位;对账表本身不受影响 |
| 修订表为空,但 Word 里能看到红字改动 | 那份文件的改动已被接受/拒绝过,红字是比较视图 | 修订只存在于未接受的 track changes;让对方发未接受修订的原稿 |
对账表出来后的常见下游:逐条裁决由文档 owner 做(表格的「处置」列);需要改合同/协议/书稿 正稿并重新生成对外件时,走你自己项目的起草与重新生成流程——本 skill 刻意不碰改稿。
references/csharp-tasks-spec.md (opens in a new tab)references/full-comparison.md (opens in a new tab)scripts/bridge_lib/__init__.py (opens in a new tab)scripts/bridge_lib/docx_bridge_client.py (opens in a new tab)scripts/compare_docx.py (opens in a new tab)scripts/csharp/tasks/compare_snapshot.csx (opens in a new tab)scripts/csharp/tasks/extract_views.csx (opens in a new tab)scripts/csharp/tasks/list_comments.csx (opens in a new tab)scripts/csharp/tasks/list_revisions.csx (opens in a new tab)scripts/extract_review.py (opens in a new tab)tests/test_compare_docx.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/daymade-docs:read-docx-reviewfrom daymade-docs
npx claudepluginhub daymade/claude-code-skills --plugin daymade-docs11 skills in this plugin
/docs-cleanerConsolidates redundant documentation while preserving all valuable content; keeps a doc set truthful after things change. Modes: (1) POST-CHANGE GOVERNANCE — when code, scripts, config, env vars, ports, paths, deployment, auth, tests, or a documented procedure changed; also "which docs are now wrong", "check docs for inconsistencies", "过时的命令/路径", "文档同步". Use it even when the user mentions only the change and never the docs — updating them is part of the change, not optional cleanup. (2) CONSOLIDATION — "clean up docs", "documentation bloat", "reduce documentation sprawl", "consolidate documentation", "too many doc files", "merge redundant docs", "merge these docs", "文档太多/太乱", multiple files covering the same topic, or documentation exceeding 500 lines across multiple files on similar topics. Finds stale copies of a fact changed in only one place, values that should never have been persisted (counts, totals, "N items", restated summaries), rival definitions that drift apart, and orphaned cross-references./docs-routerWord/PDF/PPTX/HTML→MD;MD/Word→PDF;new Word;PDF HTML/translate;Excel/xlsm/Mac;photo/signed scan;Mermaid;DOCX review;doc cleanup Reads one bundled Daymade specialist. New slide decks use deck-creator when installed; generic PDF reading/editing and spreadsheet analysis stay with their own Skills. Retired ppt-creator stays manual-only./doc-to-markdownConverts DOCX/PDF/PPTX and saved HTML/HTM to high-quality Markdown with automatic post-processing. Fixes pandoc grid tables, simple tables, image paths, CJK bold spacing, attribute noise, and code blocks; for PDFs also strips OCR garbage blocks, repeated headers/footers/watermarks, and absolute image paths from pymupdf4llm output. Trigger on "convert document", "docx to markdown", "parse word", "doc to markdown", "解析word", "转换文档", "HTML to Markdown"./docx-creatorProduces Word (.docx) and exports existing Word/WPS manuscripts to PDF, preserving revisions, tables and images, especially Chinese formal documents via a verified OpenXML generator with mandatory visual verification. Use for 生成 Word 文档 / 写合同 docx / 把 markdown 转成 Word / 中文排版. Not for Markdown → PDF (use daymade-docs:pdf-creator)./excel-automationCreates formatted Excel reports with openpyxl, parses complex xlsm financial models with stdlib zipfile+xml when openpyxl fails, and controls Excel windows on macOS via AppleScript. Reconstructs images or scans of paper forms as editable XLSX files with printable layouts./mermaid-toolsExtracts Mermaid diagrams from markdown files and generates high-quality PNG images using bundled scripts. Activates when working with Mermaid diagrams, converting diagrams to PNG, extracting diagrams from markdown, or processing markdown files with embedded Mermaid code.Other plugins' skills for the same job