docx

Create, edit, and analyze .docx files with tracked changes and comments.

2.9k|257|Updated Apr 7, 2025
One-click install
npx skills add https://github.com/snyk/agent-scan --skill docx-snyk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/snyk/agent-scan/tree/main/tests/skills/docx
Command: npx skills add https://github.com/snyk/agent-scan --skill docx-snyk

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the creation, editing, and analysis of professional documents, handling complex formatting, tracked changes, and comments efficiently.

Core Features & Use Cases

  • Document Creation: Generate new .docx files from scratch using JavaScript/TypeScript.
  • Document Editing: Modify existing .docx files, including tracked changes and comments, using Python.
  • Content Analysis: Extract text and raw XML for detailed document inspection.
  • Use Case: Automatically redline a legal contract by applying specific tracked changes based on a set of instructions, ensuring all modifications are correctly formatted and preserved.

Quick Start

Use the docx skill to convert the document 'report.docx' into a markdown file named 'report.md' while preserving tracked changes.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I apply tracked changes to a .docx file automatically?

You can programmatically apply tracked changes to a .docx file using Python and OOXML manipulation. This Skill modifies existing documents while preserving formatting, ensuring all redlining and comments are correctly formatted and maintained.

Can I generate a new .docx document from scratch using JavaScript?

Yes, you can generate new .docx files from scratch using JavaScript or TypeScript. This Skill utilizes the docx-js library to create professional documents with complex formatting directly in your code.

What is the best way to extract text and raw XML from a .docx file for analysis?

The best way to extract text and raw XML for detailed document inspection is by using pandoc. This Skill leverages pandoc for text extraction and tracked change conversion, enabling comprehensive content analysis.

Does this approach support converting a .docx file to markdown while preserving tracked changes?

Yes, it supports converting .docx files to markdown while preserving tracked changes. Using pandoc, you can transform a document like 'report.docx' into a markdown file named 'report.md' without losing revision history.

What libraries do I need to edit OOXML and manage document formatting?

You need libraries including pandoc, docx, libreoffice, poppler-utils, and defusedxml. These dependencies enable comprehensive document editing, OOXML manipulation, and formatting preservation for .docx files.

Why use OOXML manipulation instead of standard document parsers for editing .docx files?

OOXML manipulation is necessary to accurately preserve complex formatting, comments, and tracked changes when editing .docx files. Standard parsers often lose revision history and intricate styling details during document modification.