docx

Automates Word document creation, editing, and analysis via OOPP.

Updated Oct 23, 2025
One-click install
npx skills add https://github.com/igorferreira/gestao-projetos-exemplo --skill docx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/igorferreira/gestao-projetos-exemplo/tree/main/.claude/skills/docx
Command: npx skills add https://github.com/igorferreira/gestao-projetos-exemplo --skill docx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, defusedxml, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Manually creating and editing complex Microsoft Word documents, such as detailed reports, legal contracts, or proposals, is a time-consuming and error-prone process. This Skill automates document generation, content updates, and advanced formatting, ensuring consistent, professional, and error-free outputs, allowing you to rest while AI handles the document heavy lifting.

Core Features & Use Cases

  • Dynamic Document Generation: Create new .docx files programmatically, populating them with text, tables, images, and applying advanced formatting and styles.
  • Content Analysis & Modification: Read, analyze, and modify existing Word documents, preserving original styles, sections, and complex layouts.
  • Advanced Document Structure: Manage headers, footers, page breaks, and potentially integrate elements like tracked changes or comments through direct OOXML manipulation.
  • Use Case: Automatically generate personalized legal contracts or detailed technical reports by merging data from various sources into a pre-defined Word template, ensuring all formatting and content are perfectly aligned.

Quick Start

Example: Create a simple Word document with text and a table

from docx import Document from docx.shared import Inches

document = Document() document.add_heading('Project Report', level=1) document.add_paragraph('This is an automated report generated by AI.')

Add a simple table

table = document.add_table(rows=1, cols=3) hdr_cells = table.rows[0].cells hdr_cells[0].text = 'Metric' hdr_cells[1].text = 'Value' hdr_cells[2].text = 'Status'

document.add_paragraph('') # Add a blank line for spacing document.save('automated_report.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 with Python?

Automate Word document creation by using python-docx to programmatically generate .docx files with text, tables, images, and formatting. You can create new documents, populate them with content from data sources, and apply styles without manual editing.

Can I edit existing Word documents and preserve formatting?

Yes, you can read and modify existing .docx files while preserving original styles, sections, and layouts. The Skill supports content updates, structural changes, and advanced formatting preservation through OOXML manipulation.

What's the best way to generate personalized reports from templates?

Merge data from multiple sources into pre-defined Word templates to generate personalized reports automatically. This approach ensures consistent formatting and content alignment across all output documents without manual intervention.

How do I handle tracked changes and comments in Word documents?

Manage tracked changes, comments, and metadata through direct OOXML manipulation and workflows like pandoc integration. This enables advanced document redlining and collaborative editing automation.

Can I extract and analyze text or raw XML from .docx files?

Extract text content and raw XML from Word documents for analysis and processing. Direct XML access enables deep inspection of document structure, formatting, and metadata.

Does this work for complex documents like legal contracts?

Yes, the Skill handles complex document structures including headers, footers, page breaks, and advanced formatting needed for legal contracts, proposals, and detailed reports requiring precise layout control.