docx

Create, read, edit, and format Word documents via Python XML manipulation.

7|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/KrishavRajSingh/computer --skill docx-krishavrajsingh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/KrishavRajSingh/computer/tree/main/sandbox/opencode/skills/docx
Command: npx skills add https://github.com/KrishavRajSingh/computer --skill docx-krishavrajsingh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, lxml, pdf2image, and includes scripts (resource) components.

What problem does it solve?

Word document workflows are often tedious and error-prone when creating, reading, editing, or formatting Word documents (.docx). This Skill provides automation to streamline DOCX tasks, ensuring consistency and reducing manual effort across document generation and modification.

Core Features & Use Cases

  • DOCX creation: programmatically generate new Word documents with formatted content, headers/footers, and tables.
  • Reading and analysis: extract and analyze content from existing .docx files, including text, structure, and formatting.
  • Editing & formatting: modify text, insert images, adjust styles, and update layouts while preserving valid Word XML.
  • Validation & repair: validate document structure and relationships, fix common XML issues, and re-pack into a valid DOCX.

Quick Start

Process an existing Word document to apply a standardized formatting pass and produce a polished final .docx.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I automate Word document creation and formatting?

You can automate Word document creation and formatting by using scripts to generate .docx files with formatted text, headers, footers, and tables. This approach applies Python-based XML manipulation to build valid Word documents, ensuring consistent formatting while reducing manual editing effort across report generation workflows.

How do I extract and analyze text from an existing .docx file?

Extract and analyze text from a .docx file by unpacking the document XML to read its content, structure, and formatting. This Skill provides scripts to parse existing Word documents, enabling automated content extraction for data processing or document review workflows.

Can I edit and update Word templates without breaking the document structure?

Yes, you can edit and update Word templates while preserving valid Word XML structure. This Skill modifies text, inserts images, and adjusts styles within .docx files, then validates relationships and repacks the document to ensure the final output remains a structurally sound Word file.

Does this DOCX automation approach work with Python and lxml?

Yes, this DOCX automation approach works with Python and relies specifically on lxml and defusedxml for robust XML manipulation. These dependencies allow the scripts to securely unpack, edit, and validate the underlying XML structure of Word documents.

What is the best way to fix corrupted or invalid XML in a Word document?

The best way to fix invalid XML in a Word document is to use validation and repair scripts that check document structure and relationships. This Skill fixes common XML issues during the repacking process to produce a valid, polished final .docx file.

How do I convert a draft into a polished final Word document?

Convert a draft into a polished final Word document by applying a standardized formatting pass via automated scripts. This process adjusts styles, updates layouts, and validates the XML structure, transforming rough drafts into consistently formatted .docx files ready for distribution.