Word Review Redline
Use this skill when editing an existing Word document must stay reviewable.
This skill does not replace the system documents skill. It narrows how edits must be applied on top of that foundation:
- always use real Word tracked changes, not silent replacement
- add a short Chinese comment at every modified location
- keep comments simple and reviewer-oriented, such as
修改措辞、更正术语、补充说明 - finish with the
documentsverification flow
Workflow
- Read the system
documentsskill first.- Primary foundation:
C:\Users\AS\.codex\plugins\cache\openai-primary-runtime\documents\26.514.12219\skills\documents\SKILL.md - For real tracked changes: load
ooxml/tracked_changes.md - For real Word comments: load
ooxml/comments.md
- Primary foundation:
- Decide whether the requested edit can stay local and surgical.
- Prefer minimal replacements over rewriting large spans.
- Preserve surrounding structure, formatting, and review history.
- Apply changes with tracked revisions enabled.
- Do not make silent text substitutions in final deliverables.
- Do not accept tracked changes unless the user explicitly asks for a clean copy.
- Attach a Chinese comment at every changed location.
- Each inserted or replaced location needs one concise comment.
- Comments should explain the edit category, not restate the full sentence.
- Verify structurally and visually.
- Comments require structural verification.
- Layout requires render verification through the
documentsworkflow.
Comment Rules
Use short Chinese phrases that help a reviewer scan edits quickly.
Preferred patterns:
修改措辞统一表述更正错别字更正术语补充说明补充背景精简表述增强语气弱化绝对表述修正格式
For longer paragraph-level rewrites, make the comment more informative. Examples:
重写本段以增强逻辑衔接和表达清晰度补充限制条件并弱化绝对表述整合重复表述,压缩本段长度按审稿语气重写本段结论表述
Avoid:
- long explanations
- English comments unless the user asks
- one summary comment covering multiple distant edits
- comments only at paragraph level when the actual edit is a small local replacement
Editing Rules
- Default to editing existing
.docxfiles, not creating a fresh rewrite. - Prefer true tracked replacements so Word can show delete/insert markup.
- For each replacement, keep the comment anchored to the changed range.
- If a requested change is too large for precise range comments, split it into smaller edits when practical.
- If a full paragraph rewrite is unavoidable, explain that in one local Chinese comment attached to that rewritten area.
Tools
Use the system documents skill scripts as the base workflow.
Important helpers:
render_docx.pyfor DOCX render QAscripts/comments_extract.pyfor structural verificationscripts/accept_tracked_changes.pyonly when the user requests a clean accepted copy
This skill adds one local helper:
scripts/tracked_review_edit.pyscripts/render_docx_via_documents.ps1scripts/render_docx_windows.pyscripts/review_docx_workflow.ps1
Use tracked_review_edit.py when the change can be represented as exact text replacements and each replacement needs an attached Chinese comment.
Use render_docx_via_documents.ps1 as the main Windows render entrypoint for this machine.
Use render_docx_windows.py when you want the direct Python entrypoint behind that wrapper.
Use review_docx_workflow.ps1 when you want the end-to-end flow in one command.
Local Helper
tracked_review_edit.py performs all of the following in one pass:
- enables
w:trackRevisions - replaces one occurrence per requested target with real
<w:del>+<w:ins> - adds a real Word comment anchored to the inserted replacement
- writes author/date metadata for both tracked changes and comments
Expected request shape:
- start from an existing
.docx - provide one or more replacement specs
- provide a short Chinese comment per replacement
Example:
& "<bundled-python>" "C:\Users\AS\.codex\skills\word-review-redline\scripts\tracked_review_edit.py" `
input.docx `
--out output.docx `
--author "Codex" `
--edit "旧表述=>新表述=>修改措辞" `
--edit "错误术语=>正确术语=>更正术语"
Batch example:
& "<bundled-python>" "C:\Users\AS\.codex\skills\word-review-redline\scripts\tracked_review_edit.py" `
input.docx `
--out output.docx `
--edit-file edits.csv `
--require_all
The batch file may be .csv or .json. When comment is empty, the helper auto-generates a short Chinese review comment. Read references/batch_edit_lists.md for the schema.
Render QA
For visual QA, keep following the system documents workflow, but on this machine use the local wrapper implementation so LibreOffice and Poppler are injected in a Windows-safe way:
& "C:\Users\AS\.codex\skills\word-review-redline\scripts\render_docx_via_documents.ps1" `
-InputPath output.docx `
-OutputDir render-out `
-EmitPdf
Fallback:
& "<bundled-python>" "C:\Users\AS\.codex\skills\word-review-redline\scripts\render_docx_windows.py" `
output.docx `
--output_dir render-out
One-Click Workflow
Use the orchestration script when you want one command to:
- detect Strict OOXML
- normalize through local Word when needed
- apply tracked edits with Chinese comments
- extract comments to JSON
- render PDF/PNG QA artifacts
& "C:\Users\AS\.codex\skills\word-review-redline\scripts\review_docx_workflow.ps1" `
-InputPath input.docx `
-EditFile edits.csv `
-RequireAll
Outputs are written into a timestamped working folder under D:\codex\tmp\review_docx_workflow\ unless -WorkDir is provided.
Validation
For each meaningful edit batch:
- Extract comments structurally with the system
comments_extract.pyhelper. - Confirm comment count matches edit count.
- Confirm each comment text is Chinese and reviewer-friendly.
- Render the DOCX through
scripts/render_docx_via_documents.ps1on this machine. - If you need the lower-level direct entrypoint, use
scripts/render_docx_windows.py. - If you want the full Windows workflow in one step, use
scripts/review_docx_workflow.ps1.
References
Read references/review_comment_patterns.md when you need examples or want to normalize comment wording across edits.
Read references/batch_edit_lists.md when preparing CSV or JSON replacement lists.