docx-editor

Installation
SKILL.md

Safety Rules

参见 _shared/core/safety-rules.md — 所有安全规则从共享层加载,避免跨技能重复维护。

关键补充:生产环境不覆盖原文件。所有编辑输出写为新文件(<原名>-edited.docx 或用户指定路径)。原地保存 doc.save() 虽走临时文件+原子移动,但仍属破坏性操作,仅在用户明确要求时使用。

Docx 文档编辑 (DocxEditor / Lossless DOCX Editor)

严格"只改要改的,其余一字不动"的 DOCX 编辑技能。核心原则:把 .docx 当 ZIP 容器,用 lxml 直接操作里面的原始 XML,保存时未修改的部件逐字节复制,只有被改动的部件才重新序列化。绝不用 python-docx 重新生成整个文档——那样会让每个被加载的部件都被重写,导致格式漂移和"打开→保存"不再幂等。

The one rule that matters: a .docx is a ZIP of OOXML parts. Edit only the parts you mean to change; on save, copy every other part byte-for-byte from the original. Never regenerate the whole document.

Quick Commands

Installs
1
GitHub Stars
11
First Seen
2 days ago
docx-editor — cycleuser/skills