Overview
Professional DOCX tools for creating, editing, and manipulating Word documents.
With this skill you can:
- Create new .docx files with full control over styles, tables, and layout
- Open and edit existing documents at the OOXML (XML) level when you need surgical precision
- Read and clean up tracked changes and comments
- Convert between formats such as .doc, .docx, PDF, HTML, and ODT
- Validate and repair OOXML structure before sending documents to clients
- Compare two versions of a document and generate a redline with tracked changes
Getting Started
Add your source materials to the project workspace, then activate the DOCX Tools skill. The agent will guide you through the process step by step.
Typical workflows
- Draft a polished Word document: Ask the agent to create a new .docx with the sections, headings, tables, and styles you need. The agent uses
docx_buildbehind the scenes so the resulting file opens cleanly in Word. - Review tracked changes: When a document has heavy editing history, the agent can use
docx_extract_textto show a clean Markdown view, ordocx_accept_changesto bake all accepted changes into a new, final version. - Deep XML surgery: For tricky formatting or corruption issues, the agent can
docx_unpackthe file, edit XML directly, rundocx_validateto catch structural issues, and thendocx_packeverything back into a clean .docx. - Convert formats safely: Use
docx_convertwhen you need to move between .doc, .docx, PDF, HTML, or ODT while preserving as much structure as possible. - Compare versions with a redline: After editing a contract or report, the agent can run
docx_compareto generate a redlined version that opens in Word’s Track Changes view so stakeholders can quickly see what changed. - Generate images from PDFs: Use
docx_pdf_to_imagesto produce page-by-page images of a PDF for visual inspection or embedding in other documents.
Tool Reference
The DOCX Tools skill exposes ten specialized tools. You do not need to remember their names—the agent will choose the right one—but this reference explains what is available.
Create new documents
docx_build: Programmatically builds new .docx files using thedocxJavaScript library. Best for generating structured documents (contracts, reports, templates) with precise control over sections, paragraphs, tables, and styling.
Read and clean up content
docx_extract_text: Extracts the text of a .docx file as Markdown. You can choose whether to:- Show both insertions and deletions
- Show only the final text (as if all changes were accepted)
- Show the original text (as if all changes were rejected)
docx_accept_changes: Accepts all tracked changes in a .docx and writes the result to a new file. Useful when you want a clean, final version without any editing history.
XML‑level editing workflow
These tools are used together when the agent needs to work directly with OOXML:
docx_unpack: Unzips a .docx into an editable directory of XML files, merging adjacent runs and pretty‑printing the XML for readability.docx_validate: Checks a .docx or an unpacked directory for structural issues (missing required files, malformed XML, broken relationships) and can optionally repair common problems.docx_pack: Re‑packs an unpacked XML directory into a new .docx file once validation passes.
Review comments and collaboration
docx_add_comment: Adds a review comment—or a reply to an existing comment—to an unpacked document. Comments are anchored to specific text so they appear in the expected location in Word.
Conversions and comparisons
docx_convert: Uses LibreOffice in headless mode to convert documents between formats, such as:.doc→.docx.docx→pdf.docx→html.odt→.docx
docx_compare: Compares an “original” and a “modified” .docx and produces a third, redlined document. When you open the result in Word, you see insertions, deletions, and moves as tracked changes so reviewers can quickly understand the diffs.
PDF pages to images
docx_pdf_to_images: Converts PDF pages into JPEG or PNG images at a chosen resolution. Helpful for visual QA, slide decks, or embedding page snapshots into other documents.
Best Practices
- Never overwrite the original file: The agent always writes to a new path (for example,
_clean,_final,_redlined) so you can compare and revert. - Validate before sharing: For important client documents, ask the agent to run
docx_validateso any OOXML issues are caught before the file is sent. - Use build vs. XML wisely: Prefer
docx_buildfor new documents and the unpack/validate/pack workflow only when you need low‑level fixes or inspection.