Correct typos in Word documents, polish the wording, unify the formatting, and record every text modification through Word Track Changes.
When to Use
- The user provides a .docx file that needs proofreading
- Requests "proofreading," "error correction," "polishing," "fixing typos," "checking spelling"
- Needs to unify the document formatting
- Needs tracked revision records
When NOT to Use
- Need to create a document from scratch → use word-formatter
- Need to generate charts and illustrations → use word-formatter
- Only need to read the document content without making modifications
Workflow
1. 读取文档 → 2. 选择模式 → 3. 逐段分析 → 4. 应用修正(Track Changes) → 5. 输出
Step 1: Read the document
python ~/.claude/skills/word-proofreader/proofreader.py extract "/path/to/document.docx"
Output a JSON-format list of paragraphs, including the paragraph index, text, and style name.
Step 2: The user selects a processing mode
Use AskUserQuestion to ask:
| Mode | Description |
|---|---|
| Error correction only | Correct only typos, spelling errors, and punctuation issues |
| Error correction + polishing | Error correction + optimizing word choice, adjusting sentence structure, improving readability |
| Comprehensive processing | Error correction + polishing + unified formatting (font and font size, line spacing and paragraph spacing, heading levels) |
Step 3: Analyze paragraph by paragraph
Read the paragraph list output by extract and analyze each paragraph.
Analysis points:
Error correction (performed in all modes)
- Chinese typos (incorrect substitutions of homophones or similarly shaped characters)
- English spelling errors
- Punctuation (mixed Chinese and English punctuation, redundant/missing punctuation)
- Number and unit formats
Polishing (error correction + polishing and comprehensive processing modes)
- Condensing redundant expressions
- Replacing inappropriate word choices
- Sentence structure optimization (splitting overly long sentences, converting passive sentences to active sentences, etc.)
- Adding logical connectives
- Note: polishing should preserve the original style and tone, without excessive rewriting
Generate correction JSON and write it to a temporary file:
{
"paragraphs": [
{
"index": 0,
"original": "这个方案的目地是为了提高工作效率,使的我们能够更加好的完成任务。",
"corrected": "这个方案的目的是提高工作效率,使我们能够更好地完成任务。",
"changes": [
{"type": "typo", "from": "目地", "to": "目的"},
{"type": "typo", "from": "使的", "to": "使"},
{"type": "polish", "from": "为了提高", "to": "提高"},
{"type": "polish", "from": "更加好的", "to": "更好地"}
]
}
]
}
Important: Output only paragraphs with modifications; do not include paragraphs that need no modification in the JSON.
Step 4: Apply corrections
After saving the correction JSON as a temporary file, execute:
python ~/.claude/skills/word-proofreader/proofreader.py apply \
"/path/to/document.docx" \
"/tmp/corrections.json" \
--output "/path/to/document_proofread.docx" \
--mode full
--mode Parameters:
typo_only- No formattingtypo_polish- No formattingfull- Formatting
Custom formatting parameters (optional):
--format /tmp/format_config.json
format_config.json example:
{
"body_font_cn": "SimSun",
"body_font_en": "Times New Roman",
"body_size": 12,
"heading1_size": 22,
"heading2_size": 16,
"heading3_size": 14,
"line_spacing": 1.5,
"space_after": 6
}
Step 5: Output
The script will output modification statistics. Report to the user:
完成!
- 输出文件:/path/to/document_proofread.docx
- 修改段落:X / Y
- 错别字修正:N 处
- 润色优化:M 处
请用 Word 打开文件,在「审阅」→「修订」中查看每处修改,可逐条接受或拒绝。
Dependencies
pip install python-docx
Error Handling
| Error | Handling method |
|---|---|
| File does not exist | Prompt the user to check the path |
| Format not supported | Only .docx is supported |
| python-docx is not installed | Prompt pip install |
| Document encrypted/protected | Prompt the user to remove protection first |