docx

Create, read, edit, and format Word documents programmatically.

1|Updated Sep 21, 2022
One-click install
npx skills add https://github.com/mohamedhabibwork/mohamedhabibwork --skill docx-mohamedhabibwork
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/mohamedhabibwork/mohamedhabibwork/tree/main/habib-app/.opencode/skills/docx
Command: npx skills add https://github.com/mohamedhabibwork/mohamedhabibwork --skill docx-mohamedhabibwork

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Word document creation, formatting, and editing are time-consuming and error-prone when done manually, especially for complex documents with headings, tables, images, and tracked changes.

Core Features & Use Cases

  • Automated Word document generation and editing with professional formatting
  • Insertion of images, tables, headers/footers, and computed content into .docx files
  • Tracking and validating changes, comments, and markup for collaboration-ready documents
  • Use cases include producing reports, memos, templates, letters, and client-ready documents from structured content

Quick Start

Generate a polished Word document from provided content with proper structure and styling.

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 generation from structured content?

Automating Word document generation is achieved by programmatically creating and formatting .docx files. This process inserts headings, tables, images, and computed content into reports, memos, and templates using an Office Open XML toolchain.

Can I programmatically insert tracked changes and comments into a .docx file?

You can insert tracked changes and comments into a .docx file programmatically. The toolchain manipulates Office Open XML to track, validate, and add markup, ensuring your documents are collaboration-ready with visible revisions.

What is the best way to edit and format existing Word documents programmatically?

Editing and formatting Word documents programmatically involves manipulating the underlying Office Open XML structure. This approach ensures formatting and content integrity across .docx files while applying professional styles like headers, footers, and tables.

Does this approach require Python to unpack and pack Office Open XML files?

This approach requires a Python-based toolchain to unpack and pack Office Open XML files. It uses specific libraries like lxml and defusedxml to safely parse and manipulate the internal structure of .docx files.

What are the limitations of manipulating Office Open XML directly for document generation?

Manipulating Office Open XML directly requires strict adherence to the schema to maintain content integrity. While it offers deep control over formatting and tracked changes, incorrect unpacking or packing can corrupt the .docx file structure.

How do I create client-ready proposals with tables and images in a .docx format?

Creating client-ready proposals in .docx format involves programmatically inserting structured content, tables, and images. The toolchain applies professional formatting and polishes the document to ensure it is ready for client delivery.