docx

Create, edit, and redline Word documents with tracked changes and OOXML manipulation.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/svpfahad/RES200 --skill docx-svpfahad
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/svpfahad/RES200/tree/main/claude-scientific-writer-main/.claude/skills/document-skills/docx
Command: npx skills add https://github.com/svpfahad/RES200 --skill docx-svpfahad

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, pandoc, docx, libreoffice, poppler-utils, and includes scripts (resource) components.

What problem does it solve? Working with Word documents programmatically is difficult because .docx files are ZIP archives of XML, making tasks like tracked changes, comments, and formatting preservation error-prone when done manually. ## Core Features & Use Cases - Document Creation: Generate new Word documents with docx-js (JavaScript/TypeScript), including styles, tables, lists, images, headers, footers, and tables of contents. - Editing & Redlining: Apply tracked changes and comments to existing documents using a Python Document library that handles RSIDs, validation, and OOXML infrastructure automatically. - Text Extraction & Analysis: Convert documents to Markdown with pandoc, unpack raw XML for comments and metadata, and render pages to images via LibreOffice and pdftoppm. - Use Case: Review a legal contract by converting it to Markdown, planning batched edits, implementing minimal tracked changes in the XML, and verifying the final redlined document. ## Quick Start Ask the AI to create a new Word report with headings and a table, or to add tracked changes and comments to an existing .docx file.

Frequently Asked Questions about docx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add tracked changes to a Word document programmatically?

Unpack the .docx file, then use the Python Document library to insert <w:ins> and <w:del> elements around changed runs. The library auto-injects RSIDs, author, and timestamps, and validates the result when you save and repack.

How do I extract text from a .docx file?

Convert the document to Markdown with pandoc using --track-changes=all to preserve insertions and deletions. For comments, embedded media, or complex formatting, unpack the file and read the raw XML in word/document.xml directly.

What library should I use to create Word documents in JavaScript?

Use the docx npm package (docx-js), which provides Document, Paragraph, TextRun, Table, and ImageRun components. Export the result with Packer.toBuffer() and write it to a .docx file.

Why does my generated Word document fail to open?

Common causes include standalone PageBreak elements outside a Paragraph, using ShadingType.SOLID on table cells, unicode bullets instead of numbering config, and missing ImageRun type parameters. Follow the documented formatting rules to produce valid OOXML.

Can I convert a Word document to images for visual review?

Yes. Convert the .docx to PDF with LibreOffice (soffice --headless --convert-to pdf), then render pages to JPEG with pdftoppm at your chosen DPI. You can also restrict conversion to a specific page range.