AGENT SKILL

docx

暂无简介

License 许可
MIT
最近更新
2026-11-15
Stars
★ 0
Forks
0

02 资源文件 83

03 SKILL.md 正文

Docx Skill

Create, read, edit, and template Microsoft Word .docx files with python-docx via small CLIs. It handles text, styles, lists, tables, images, headers/footers, {{token}} templating, tracked changes (list/accept/reject), comments (list/add/delete), TOC and page-number fields, and package health checks. It does not render documents itself (PDF needs LibreOffice — see Converting to PDF in references/usage.md) or edit legacy .doc.

Global rules

  • Run every helper through scripts/; never sed or unzip-edit the XML. Raw text substitution in document.xml corrupts files easily — use the provided scripts (see references/xml-editing.md for the toolchain).
  • Verify after every produce-or-edit action. Re-read the output with docx_read.py --text/--structure, and run docx_validate.py after any revision, comment, or field surgery (checklist in references/usage.md).
  • Always normalize before find-replace on Word-edited documents. Word fragments text into runs; docx_edit.py normalize merges equal-format adjacent runs so later matches succeed.
  • Template redlining requires reading references/xml-editing.md first. The raw-XML toolchain under scripts/xml-toolchain/ is for direct OOXML access only; edit the template in place, never recreate it.

Routing

Step Reference Purpose
Commands + procedure references/usage.md Prerequisites, quick-reference command table, end-to-end procedure, Converting to PDF, and the post-edit verification checklist.
Raw-XML toolchain references/xml-editing.md Unpack/repack, redlining, .dotx templates, tracked changes via LibreOffice.
Tracked changes + comments references/revisions-and-comments.md Revision types, acceptance flow, comment threading, and which edge cases to hand to Word.
Edge-case behaviors references/pitfalls.md Run fragmentation, revision coverage limits, field results, validation semantics, style numbering, cell formatting, and encoding.

04 同仓库更多 Skills