| name | docx |
| description | Read, edit, or create Microsoft Word `.docx` files. Trigger this skill whenever the user mentions a Word document, .docx file, contract, report, brief, memo, or asks to extract text, modify an existing doc, generate one from a brief, or audit tracked changes. Three execution paths: text-and-structure extraction, in-place edit-by-run (preserves styles), and create-from-scratch with python-docx. Falls back to OOXML unzip-and-patch for layout work python-docx cannot reach. |
| description_zh | 读取、编辑或创建Microsoft Word .docx 文件。当用户提到Word文档、.docx文件、合同、报告、简报、备忘录,或要求提取文本、修改现有文档、根据简报生成文档或审查修订记录时触发。支持三种执行路径:文本与结构提取、按run就地编辑(保留样式)、用python-docx从零创建;处理python-docx无法完成的排版时回退到OOXML解压补丁。 |
| homepage | https://python-docx.readthedocs.io/ |
| provenance | {"origin":"clawhub-mit0","license":"MIT-0","upstream_url":"https://clawhub.ai/word-docx","maintained_by":"OpenSquilla"} |
| metadata | {"platform":{"emoji":"📘","requires":{"anyBins":"[Truncated]"},"install":["[Truncated]"]}} |
| entrypoint | {"command":"python {baseDir}/scripts/export_markdown_docx.py","args":["--out","{{ with.output_path }}"],"stdin":"{{ with.markdown }}","parse":"text","timeout":60} |
docx
Work with Microsoft Word .docx files. The format is OOXML — a zip container
holding XML parts (word/document.xml, styles.xml, numbering.xml, headers,
footers, relationships). Treat structure as primary; rendered text is a view.
Decide the path first
Pick one path up front. The right path depends only on what is on disk
before you start.
| You have | Goal | Path |
|---|
Existing .docx | Read text/structure | A. Inspect |
Existing .docx | Modify content while keeping styles | B. Edit-in-place |
| Nothing or a brief | Build a new doc | C. Create from scratch |
If the user hands you a doc and asks for changes, default to path B and treat
the input as the visual style baseline. Only choose path C when the user says
"start fresh" or there is no input.
Path A: Inspect
Dump structure as JSON for inspection without mutating anything.
python {baseDir}/scripts/inspect_docx.py /path/to/doc.docx
Output schema:
{
"paragraphs": [{"index": 0, "text": "...", "style": "Heading 1"}, ...],
"tables": [[["row0,col0", ... ...