DOCX Processing Toolkit
telagod/code-abyss
Routes Word document tasks to the right tool: pandoc for text, raw OOXML for structure and comments, docx-js for new files, and a mandatory redlining flow for edits to others' documents.
Word 文档全能处理技能 | Complete Word Document Processing Skill. An agent skill from LeoYeAI/openclaw-master-skills.
$ npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills tdoc-docx --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tdoc-docx .claude/skills/tdoc-docx && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "tdoc-docx" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/tdoc-docx into .claude/skills/tdoc-docx/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tdoc-docx", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/tdoc-docxType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills tdoc-docx --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/tdoc-docx .agents/skills/tdoc-docx && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "tdoc-docx" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/tdoc-docx into .agents/skills/tdoc-docx/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tdoc-docx", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills tdoc-docx --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/tdoc-docx .cursor/skills/tdoc-docx && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "tdoc-docx" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/tdoc-docx into .cursor/skills/tdoc-docx/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tdoc-docx", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/LeoYeAI/openclaw-master-skills.git --path skills/tdoc-docx--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills tdoc-docx --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/tdoc-docx .gemini/skills/tdoc-docx && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "tdoc-docx" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/tdoc-docx into .gemini/skills/tdoc-docx/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tdoc-docx", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install LeoYeAI/openclaw-master-skills tdoc-docxInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/tdoc-docx .github/skills/tdoc-docx && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "tdoc-docx" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/tdoc-docx into .github/skills/tdoc-docx/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tdoc-docx", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills tdoc-docx --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/tdoc-docx .opencode/skills/tdoc-docx && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "tdoc-docx" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/tdoc-docx into .opencode/skills/tdoc-docx/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tdoc-docx", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
tdoc-docxWord 文档全能处理技能 | Complete Word Document Processing Skill. An agent skill from LeoYeAI/openclaw-master-skills.
Tdoc DOCX is an agent skill from LeoYeAI/openclaw-master-skills. Word 文档全能处理技能 | Complete Word Document Processing Skill. 支持创建、读取、编辑、转换 Word 文档 | Create, read, edit, convert Word documents. 支持 .docx/.doc 格式、中文公文格式、表格、图片、tracked changes、评论 | Supports .docx/.doc, Chinese gov format, tables, images, tracked changes, comments. 触发词:Word、文档、docx、doc、公文、报告、转PDF.
Its SKILL.md is about 3.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 44 other files, including scripts (for example `_meta.json`, `install.sh` and `scripts/__init__.py`).
It sits in Documents & Office, covering Word documents. It works with Microsoft Word, Python, Homebrew and Linux. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.
Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 13 files in scripts/ (Python and Shell, from the files we listed), which the agent can run.
Shell commands in SKILL.md call:
python3aptbrewbashpip3uvnpmsofficeFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip3, uv and npm, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Tdoc DOCX loads about 3.6k tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 676 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
w install --cask libreoffice`<br>Linux: `sudo apt install libreoffice` |macOS: `brew install pandoc`<br>Linux: `sudo apt install pandoc` |macOS: `brew install poppler`<br>Linux: `sudo apt install poppler-utils` |acOS: `brew install antiword`<br>Linux: `sudo apt install antiword` |- Linux: `sudo apt install fonts-noto-cjk`- Linux: `sudo apt install libreoffice`Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from LeoYeAI/openclaw-master-skills at commit e5199b5, republished under its MIT licence (© LeoYeAI). 676 words, ~3,565 tokens.
.claude/skills/tdoc-docx/SKILL.md (or your agent's skills folder). This skill also uses 41 other files; get the full folder from GitHub.提供对 .docx / .doc 文件的完整生命周期管理:
| 能力 | 说明 | 脚本 |
|---|---|---|
| 创建 | 从零创建专业 Word 文档(含中文公文格式) | create_docx.py |
| 读取 | 提取文本、表格、图片、元数据 | read_docx.py |
| 编辑 | JSON 规则批量编辑 / XML 层面精细操作 | edit_docx.py + office/ |
| 转换 | docx↔pdf、doc→docx、docx→markdown | convert_docx.py |
| 差异 | 生成两版本间的 Unified Diff 报告 | diff_docx.py |
| 评论 | 添加评论、回复、tracked changes | comment.py |
| 分析 | 文档摘要、关键词提取、字数统计 | word_count.py + AI |
当用户请求以下任务时,自动使用此 skill:
关键词识别:
路由决策树仅适用于「创建文档」这一个环节。 文档一旦创建完成(无论是通过路径 A 通用创建还是路径 B 垂类模板创建),后续所有操作一律使用
scripts/下的工具脚本,不再走模板流程。
用户请求
│
├─ 「创建」新文档 → 走路由决策树(路径 A 通用 / 路径 B 垂类模板)
│
└─ 对「已有」文档进行操作 → 直接使用 scripts/ 工具脚本
├─ 编辑/修改 → edit_docx.py(JSON 规则)或 XML 编辑(office/unpack → 修改 → pack)
├─ 读取/提取 → read_docx.py
├─ 格式转换 → convert_docx.py
├─ 差异对比 → diff_docx.py
├─ 评论/修订 → comment.py + XML 编辑
└─ 字数/分析 → word_count.py + AI💡 典型场景:用户先让你用红头模板创建了一份文件,然后又要求「把 A 改成 B」——此时应该用
edit_docx.py编辑已有文件,而不是重新跑一遍创建脚本。
⚠️ 首次使用本 skill 前必须先安装依赖,否则脚本会报 ModuleNotFoundError!
方式1:一键安装(推荐)
cd {baseDir}
./install.sh方式2:手动安装
# 使用 pip
pip3 install -r {baseDir}/requirements.txt
# 或使用 uv(更快)
uv pip install -r {baseDir}/requirements.txt核心 Python 依赖(必装):
| 包名 | 最低版本 | 用途 |
|---|---|---|
python-docx | 1.1.0 | 创建/读取/编辑 DOCX |
reportlab | 4.0 | DOCX→PDF 基础转换 |
defusedxml | 0.7.0 | 安全 XML 解析 |
lxml | 5.0 | XSD 验证 |
系统级依赖(必装,install.sh 会自动安装):
| 工具 | 用途 | 手动安装方式 |
|---|---|---|
| LibreOffice | 高保真 PDF 转换、DOC→DOCX、接受修订 | macOS: brew install --cask libreoffice<br>Linux: sudo apt install libreoffice |
| pandoc | 高级文本提取 | macOS: brew install pandoc<br>Linux: sudo apt install pandoc |
| Poppler | DOCX→图片 (pdftoppm) | macOS: brew install poppler<br>Linux: sudo apt install poppler-utils |
| antiword | .doc 文件读取 | macOS: brew install antiword<br>Linux: sudo apt install antiword |
💡 推荐使用
./install.sh一键安装,脚本会自动检测系统并安装以上所有依赖。
本决策树仅在「创建新文档」时使用。 对已有文档的编辑、转换、对比等操作请直接使用
scripts/工具脚本(参见上方「核心路由原则」)。
创建文档时,必须按以下决策树选择执行路径:
用户请求创建文档
│
├─ Step 1: 意图识别 — 是否匹配垂类模板?
│ │
│ ├─ ✅ 匹配垂类模板(公文、合同等专业文档)
│ │ └─ → 路径 B:垂类模板创建流程
│ │ ① 读取 {baseDir}/templates/<模板名>/rules.md
│ │ ② 按 rules.md 规范,用 Python 脚本创建文档
│ │ ③ 不使用 create_docx.py 的内置 style
│ │
│ └─ ❌ 不匹配垂类模板(通用文档)
│ └─ → 路径 A:通用创建流程
│ │
│ ├─ Step 2: 用户是否上传/提供了 Markdown 文件?
│ │ │
│ │ ├─ ✅ 有 Markdown → 路径 A1:CLI 方式(--from-markdown)
│ │ └─ ❌ 无 Markdown → 路径 A2:Python API 方式(⭐ 默认推荐)
│ │
│ └─ 选择风格: default / business / academic
│
└─ 输出文档核心原则:除非用户明确上传了 Markdown 文件要求基于 MD 创建,否则一律使用 Python API 方式(直接调用
DocxCreator)创建文档。
适用于:一般报告、总结、方案、商务文档、学术论文等无特定行业格式规范的文档。
这是默认的创建方式。 当用户没有上传 Markdown 文件时,直接编写 Python 脚本调用
DocxCreator类创建文档。
import sys
sys.path.insert(0, "{baseDir}/scripts")
from create_docx import DocxCreator
creator = DocxCreator(style='default') # 可选: default/business/academic
creator.add_title("文档标题")
creator.add_heading1("一、第一章")
creator.add_paragraph("正文内容")
creator.add_paragraph("详细说明...", bold_prefix="(一)小标题。")
creator.add_table(["列1", "列2"], [["A", "B"], ["C", "D"]])
creator.add_image("chart.png", width=400, caption="图1")
creator.add_empty_line()
creator.add_page_break()
creator.save("output.docx")DocxCreator 可用方法:
| 方法 | 说明 |
|---|---|
add_title(text) | 居中大标题 |
add_author(text) | 居中署名(支持 \\n 换行) |
add_heading1(text) | 一级标题 |
add_heading2(text) | 二级标题 |
add_paragraph(text, bold_prefix=None) | 正文段落(可选加粗前缀) |
add_table(headers, rows, col_widths=None) | 表格 |
add_image(path, width=None, caption=None) | 图片 |
add_empty_line() | 空行 |
add_page_break() | 分页符 |
save(filepath) | 保存文档 |
支持的通用风格 (style):
| 风格 | 说明 | 适用场景 |
|---|---|---|
default | 默认现代风格(微软雅黑/Arial) | 通用文档 |
business | 商务风格(简洁、专业) | 商业方案、合同 |
academic | 学术论文格式(宋体/Times New Roman) | 论文、学术报告 |
⚠️ 注意:
gov风格仍然保留在 DocxCreator 中,但当识别到公文类意图时,应走路径 B 垂类模板流程,按 rules.md 规范用 Python 精确创建,而非简单调用style='gov'。
仅当用户明确上传了 Markdown 文件(如
.md文件)时才使用此路径。
# 从 Markdown 转换(自动识别标题层级)
python3 {baseDir}/scripts/create_docx.py --from-markdown input.md --output output.docx
# 带署名
python3 {baseDir}/scripts/create_docx.py --from-markdown input.md --output output.docx \
--author "某某单位\n2026年3月11日" --style default
# 指定模板风格
python3 {baseDir}/scripts/create_docx.py --from-markdown input.md --output output.docx --style businessMarkdown 格式规范:
# 文档大标题
## 一、一级标题
### (一)二级标题
正文段落内容。
**1. **带加粗前缀的段落
- 列表项会转为段落当意图识别到用户需要创建符合特定行业/领域格式规范的文档时,必须走此路径。
| 垂类模板 | 触发关键词 | 模板路径 |
|---|---|---|
| 公文 | 公文、通知、请示、批复、报告、函、纪要、意见、决定、命令、公报、议案 | {baseDir}/templates/official_document/rules.md |
| 红头文件 | 红头、红头文件、红头文档、红头模板 | {baseDir}/templates/red_head/rules.md |
| (扩展) | (未来可添加更多垂类模板) | {baseDir}/templates/<模板名>/rules.md |
第一步:读取规范
读取 {baseDir}/templates/<模板名>/rules.md该文件包含该垂类文档的完整格式规范:字体、字号、行距、页边距、层级编号、标点规则等。
第二步:按规范用 Python 创建
根据 rules.md 中的详细规范(含页面设置、字体对照表、段落格式、代码片段等),直接使用 python-docx API 编写 Python 脚本创建文档。
⚠️ 不使用
create_docx.py的内置 style,因为垂类规范比内置 style 更严格精确。所有字体、字号、行距、页边距等参数均以对应 rules.md 为准。
第三步:格式检查
按 rules.md 末尾的格式检查清单逐项确认。
| 模板 | 目录 | 规范文件 | 说明 |
|---|---|---|---|
| 党政机关公文 | templates/official_document/ | rules.md | 依据 GB/T 9704-2012,涵盖通知、请示、批复、报告、函等全部公文类型 |
| 红头文件 | templates/red_head/ | rules.md + src/red_head_document.py | 红头文件模板,含发文机关标志、红色分隔线、版记区域等完整红头要素,基于模板 py 文件 + 搜索素材生成 |
💡 扩展方式:新增垂类模板只需在
templates/下创建新目录,添加rules.md规范文件,并在上方的意图识别表中注册即可。
如需使用 Node.js docx 库创建高度定制化文档(如复杂嵌套表格、精确页面布局),可安装:npm install -g docx
注意:本 skill 推荐优先使用 Python API,docx-js 仅在需要极端定制时作为备选。
docx-js 关键规则:
\n,用 Paragraph 分段LevelFormat.BULLETcolumnWidths 和 cell widthtypeShadingType.CLEAR(非 SOLID)# 基本文本提取
python3 {baseDir}/scripts/read_docx.py document.docx
# 指定输出格式
python3 {baseDir}/scripts/read_docx.py document.docx --format json
python3 {baseDir}/scripts/read_docx.py document.docx --format markdown
python3 {baseDir}/scripts/read_docx.py document.docx --format text
# 提取特定内容
python3 {baseDir}/scripts/read_docx.py document.docx --extract text
python3 {baseDir}/scripts/read_docx.py document.docx --extract tables
python3 {baseDir}/scripts/read_docx.py document.docx --extract metadata
python3 {baseDir}/scripts/read_docx.py document.docx --extract images
# 批量处理
python3 {baseDir}/scripts/read_docx.py ./docs_folder --batch --format json --output results.json
# 输出到文件
python3 {baseDir}/scripts/read_docx.py document.docx --format markdown --output output.md输出格式说明:
| 格式 | 特点 | 适用场景 |
|---|---|---|
text | 纯文本,段落分隔 | 快速预览 |
json | 结构化数据 | 程序处理 |
markdown | Markdown 格式 | 文档转换 |
python3 {baseDir}/scripts/edit_docx.py input.docx output.docx edits.json编辑规则格式 (edits.json):
{
"description": "修改说明",
"replacements": [
{
"search": "旧文本",
"replace": "新文本",
"style": "highlight"
}
],
"additions": [
{
"after": "在此文本之后",
"text": "添加的文本",
"style": "bold"
}
]
}支持的样式:
| 样式 | 效果 |
|---|---|
replace | 直接替换 |
highlight | 黄色高亮 |
delete | 删除线+高亮 |
bold | 加粗 |
underline | 下划线 |
适用于需要 tracked changes、精确格式保留的场景。
步骤 1:解包
python3 {baseDir}/scripts/office/unpack.py document.docx unpacked/步骤 2:编辑 XML
直接编辑 unpacked/word/document.xml。使用 Edit 工具进行字符串替换,不要写 Python 脚本。
Tracked Changes 语法:
<!-- 插入 -->
<w:ins w:id="1" w:author="Claude" w:date="2026-03-11T00:00:00Z">
<w:r><w:t>插入的文本</w:t></w:r>
</w:ins>
<!-- 删除 -->
<w:del w:id="2" w:author="Claude" w:date="2026-03-11T00:00:00Z">
<w:r><w:delText>删除的文本</w:delText></w:r>
</w:del>
<!-- 最小化编辑: 仅标记变化部分 -->
<w:r><w:t>期限为</w:t></w:r>
<w:del w:id="1" w:author="Claude" w:date="...">
<w:r><w:delText>30</w:delText></w:r>
</w:del>
<w:ins w:id="2" w:author="Claude" w:date="...">
<w:r><w:t>60</w:t></w:r>
</w:ins>
<w:r><w:t>天。</w:t></w:r>添加评论:
python3 {baseDir}/scripts/comment.py unpacked/ 0 "评论内容"
python3 {baseDir}/scripts/comment.py unpacked/ 1 "回复内容" --parent 0步骤 3:打包
python3 {baseDir}/scripts/office/pack.py unpacked/ output.docx --original document.docxpython3 {baseDir}/scripts/accept_changes.py input.docx output.docx# DOCX 转 PDF
python3 {baseDir}/scripts/convert_docx.py input.docx --to pdf --output output.pdf
# DOCX 转 Markdown
python3 {baseDir}/scripts/convert_docx.py input.docx --to markdown --output output.md
# DOC 转 DOCX(需要 LibreOffice)
python3 {baseDir}/scripts/convert_docx.py input.doc --to docx --output output.docx
# DOCX 转图片(需要 LibreOffice + Poppler)
python3 {baseDir}/scripts/convert_docx.py input.docx --to images --output ./pages/转换支持矩阵:
| 源格式 | 目标格式 | 工具 | 说明 |
|---|---|---|---|
| .docx | LibreOffice | ⭐ 高保真,保留表格/字体/排版 | |
| .docx | reportlab | 基础转换,仅适合纯文本文档 | |
| .docx | .md | python-docx | 结构化提取 |
| .doc | .docx | LibreOffice | 需要 soffice |
| .docx | images | LibreOffice+Poppler | 逐页转图片 |
💡 推荐:DOCX→PDF 优先使用 LibreOffice 命令:
soffice --headless --convert-to pdf --outdir 输出目录 input.docx
# 生成 Unified Diff 报告
python3 {baseDir}/scripts/diff_docx.py old.docx new.docx --output diff_report.md
# 输出到终端
python3 {baseDir}/scripts/diff_docx.py old.docx new.docx# 从上传获取最新文件
bash {baseDir}/scripts/fetch_file.sh upload output.docx
# 从本地路径
bash {baseDir}/scripts/fetch_file.sh ~/Documents/report.docx output.docx
# 从 URL 下载
bash {baseDir}/scripts/fetch_file.sh https://example.com/file.docx output.docx
# 从 SFTP
bash {baseDir}/scripts/fetch_file.sh sftp://user@host:/path/file.docx output.docx对文档内容进行智能分析,提取核心信息:
自动识别文档中的关键信息:
# 统计文档字数(输出到终端)
python3 {baseDir}/scripts/word_count.py document.docx
# 输出为 JSON 格式(方便程序处理)
python3 {baseDir}/scripts/word_count.py document.docx --format json
# 同时输出前 N 字预览
python3 {baseDir}/scripts/word_count.py document.docx --preview 200统计指标:
| 指标 | 说明 |
|---|---|
| 总字符数(含空格) | 文档全部字符计数 |
| 总字符数(不含空格) | 去除空格后的字符计数 |
| 中文字数 | 仅中文汉字数量 |
| 英文单词数 | 英文单词计数 |
| 数字串数 | 数字(连续数字算一个) |
| 标点符号数 | 中英文标点计数 |
| 段落数 | 文档段落总数 |
| 预估页数 | 按 A4 纸估算页数 |
向用户呈现文档分析结果时,应包含以下信息:
💡 使用方式:先用
word_count.py获取字数统计和文本内容,再结合 AI 能力生成摘要和关键词。
<w:pPr> 元素顺序: <w:pStyle>, <w:numPr>, <w:spacing>, <w:ind>, <w:jc>, <w:rPr> 最后<w:t> 必须设置 xml:space="preserve"00AB1234)<w:del> 内: 用 <w:delText> 替代 <w:t><w:t>这里’是引号:“你好”</w:t>| 实体 | 字符 |
|---|---|
‘ | ' 左单引号 |
’ | ' 右单引号/撇号 |
“ | " 左双引号 |
” | " 右双引号 |
<!-- 评论标记是 w:p 的直接子元素,不在 w:r 内部 -->
<w:commentRangeStart w:id="0"/>
<w:r><w:t>被评论的文本</w:t></w:r>
<w:commentRangeEnd w:id="0"/>
<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="0"/></w:r><w:r> 元素: tracked changes 替换整个 run,不在 run 内部注入标签<w:rPr> 格式: 复制原 run 的格式到新 run<w:pPr><w:rPr> 中添加 <w:del/>word/media/,注册 relationship 和 content type| 依赖 | 用途 | 必需 |
|---|---|---|
python-docx | 创建/读取/编辑 DOCX | ✅ |
reportlab | DOCX→PDF 基础转换 | ✅ |
defusedxml | 安全 XML 解析 | ✅ |
lxml | XSD 验证 | ✅ |
LibreOffice | 高保真 PDF 转换、DOC↔DOCX、接受修订 | ✅ |
pandoc | 高级文本提取 | ✅ |
Poppler | DOCX→图片 (pdftoppm) | ✅ |
antiword | .doc 文件读取 | ✅ |
所有依赖均通过
./install.sh一键安装。
cd {baseDir} && ./install.sh文本不完全匹配。先用 read_docx.py 预览准确文本。
确保系统安装中文字体:
sudo apt install fonts-noto-cjkDOC→DOCX 和接受修订功能需要 LibreOffice:
brew install --cask libreofficesudo apt install libreoffice© LeoYeAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 41 other files (scripts) in skills/tdoc-docx of LeoYeAI/openclaw-master-skills.
Open the folder on GitHubat commit e5199b5
Tdoc DOCX next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Tdoc DOCX this skillLeoYeAI/openclaw-master-skills | 2.2k | — | ~3.6k | Automated safety check: Notes | MIT | |
| DOCX Processing Toolkittelagod/code-abyss | 244 | — | ~668 | Automated safety check: Notes | MIT | |
| Office DOCXsingula-ai/alego | 109 | 1 repos | ~1.5k | Automated safety check: Pass | MIT | |
| Murmurxiaopengde/murmur | 109 | — | ~2.9k | Automated safety check: Notes | MIT | |
| DOCXguyi-a/pi-ling | 106 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Writeraiskillstore/marketplace | 433 | 3 repos | ~1.3k | Automated safety check: Pass | None |
telagod/code-abyss
Routes Word document tasks to the right tool: pandoc for text, raw OOXML for structure and comments, docx-js for new files, and a mandatory redlining flow for edits to others' documents.
singula-ai/alego
Create, read, edit, and check Word documents (.docx), including reports, letters, and formatted tables.
xiaopengde/murmur
把一段中文(或任意 Whisper 支持语言)的会议/面试录音用本地 Whisper large-v3 转成文本,再清洗成带说话人标签、修过 ASR 错字、分好章节的 markdown 文档(可选再转成 docx)。跨平台(macOS Apple Silicon 用 mlx-whisper,Windows/Linux/Intel Mac 用…
guyi-a/pi-ling
Word 文档(.docx)的日常处理:md → docx(生成简历/报告)、docx → PDF/图片(分享预览)、.doc → .docx(老格式升级)。触发场景:用户说"生成 Word 版" / "做份 Word 简历" / "把这份报告转 Word" / "这份 .doc 打不开" / "docx 转 PDF" 等。读 docx 内容走 agent 已有的…
aiskillstore/marketplace
Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.
cat-xierluo/legal-skills
Converts a lawyer's ordinary complaint or a described case into the Supreme People's Court's elements-style Word template, with layout checks on the result.
LeoYeAI/openclaw-master-skills
Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.
LeoYeAI/openclaw-master-skills
Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.
LeoYeAI/openclaw-master-skills
Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.
LeoYeAI/openclaw-master-skills
Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.
LeoYeAI/openclaw-master-skills
Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.
LeoYeAI/openclaw-master-skills
Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.
Categories
Word 文档全能处理技能 | Complete Word Document Processing Skill. An agent skill from LeoYeAI/openclaw-master-skills. Tdoc DOCX is an agent skill from LeoYeAI/openclaw-master-skills. Word 文档全能处理技能 | Complete Word Document Processing Skill.
Tdoc DOCX fits situations like: tasks that involve Word documents.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a claude-code`. Or copy the skill folder (skills/tdoc-docx in LeoYeAI/openclaw-master-skills) into .claude/skills/tdoc-docx in your project. Claude Code loads it when a task matches its description.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a codex`. Or copy the skill folder (skills/tdoc-docx in LeoYeAI/openclaw-master-skills) into .agents/skills/tdoc-docx in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill tdoc-docx -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdoc-docx, .gemini/skills/tdoc-docx, .github/skills/tdoc-docx and .opencode/skills/tdoc-docx in your project.
Going by SKILL.md and its folder, Tdoc DOCX needs Python and a shell for the scripts in its folder and the command-line tools its instructions call (python3, apt, brew, bash, pip3 and uv). Our summary lists: Python 3; Node.js; A Bash shell.
SKILL.md contains no URLs. Its commands use uv and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Tdoc DOCX is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.6k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Tdoc DOCX: DOCX Processing Toolkit (telagod/code-abyss, 244 stars), Office DOCX (singula-ai/alego, 109 stars), Murmur (xiaopengde/murmur, 109 stars) and DOCX (guyi-a/pi-ling, 106 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,161 GitHub stars. The repository holds 1,235 skills in this directory. The repository was last updated on July 20, 2026.
Source: LeoYeAI/openclaw-master-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.