docx-md
SKILL.md
Word DOCX (OOXML) – docx-md
Overview
Three entry points: Read – output compact Markdown (default, token-efficient) or full JSON; Modify – apply AI-returned edits to the docx; Finalize – accept all revisions and remove all comments. Implemented via OOXML (ZIP + XML). No commercial Word libraries required.
Workflow
| Goal | Action |
|---|---|
| Get document for AI | Read: run read script → Markdown (default) or JSON. Markdown includes <!-- b:N --> blockIndex markers for edit targeting. |
| Apply AI edits to docx | Modify: run apply script with docx + edits JSON → new docx with track changes and comments. |
| Deliver final version | Finalize: run finalize script → new docx with no revisions/comments. |
LLM-oriented pipeline
- Read – Parse docx; output Markdown (default) or JSON. Markdown uses
<!-- b:N -->prefix per block; revisions:{+inserted+}{-deleted-}; comments:[comment: text]. - Send the output + task prompt to the model; require the model to output only the edit JSON:
blockIndex,originalContent,content,basis. - Modify – Script infers op from
blockIndex,originalContent,content,basis; converts to OOXML (w:ins/w:del/ comment anchors), then write back to Word.