一键导入
word-basic
Word 文档读取、编辑与内容生成
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Word 文档读取、编辑与内容生成
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
通过 Python 脚本 (python-docx) 处理复杂 Word 文档操作
Use when performing systematic codebase health checks, proactive bug hunting, or comprehensive code review across a repository. Trigger for requests like "find bugs", "code audit", "check code quality", "find dead code", "race condition review", and periodic maintenance inspections.
Scaffold MCP server projects and baseline tool contract checks. Use for defining tool schemas, generating starter server layouts, and validating MCP-ready structure.
Lightweight helper to enforce TDD-style loops for non-deterministic agents.
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Systematic debugging and problem-solving methodology. Activate when encountering unexpected errors, service failures, regression bugs, deployment issues, or when a fix attempt has failed twice. Also activate when proposing ANY fix to verify it addresses root cause (not a workaround). Prevents patch-chaining, wrong-environment restarts, workaround addiction, and "drunk man" random fixes.
| name | word_basic |
| description | Word 文档读取、编辑与内容生成 |
| file_patterns | ["*.docx","*.doc"] |
| version | 1.0.0 |
优先使用结构化工具处理 Word 文档:
inspect_word 了解文档结构(标题树、段落数、表格分布)再进行操作。read_word 分页读取内容,避免一次加载过多段落。write_word 的 operations 数组批量操作,减少调用次数。{
"file_path": "report.docx",
"operations": [
{"action": "replace", "index": 5, "text": "更新后的段落内容"}
]
}
{
"file_path": "report.docx",
"operations": [
{"action": "append", "text": "新增的结论段落", "style": "Normal"},
{"action": "append", "text": "参考文献", "style": "Heading 1"}
]
}
先用 search_word 定位段落索引,再用 write_word 的 replace 操作:
{"query": "旧版本号", "file_path": "release.docx"}
获取到 paragraph_index 后替换。
批量替换、邮件合并、模板填充等复杂场景,建议使用 run_code 编写 python-docx 脚本:
from docx import Document
doc = Document("template.docx")
for para in doc.paragraphs:
if "{{name}}" in para.text:
para.text = para.text.replace("{{name}}", "张三")
doc.save("output.docx")