docx

Create, edit, and validate Word .docx documents via XML manipulation.

26|12|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/insmtx/Lework --skill docx-insmtx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/insmtx/Lework/tree/main/backend/skills/worker/docx
Command: npx skills add https://github.com/insmtx/Lework --skill docx-insmtx

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Creating and editing Word documents manually is slow and inconsistent, especially when dealing with tracked changes, complex tables, or batch processing. This Skill gives you programmatic control over .docx files so you can generate, review, and transform documents with precision and repeatability.

Core Features & Use Cases

  • Programmatic Document Generation: Build professional Word documents from scratch using JavaScript with full control over styles, tables, images, headers, footers, and page layouts.
  • XML-Level Editing & Review: Unpack existing documents, apply tracked changes, add comments, and repack—perfect for contract review, collaborative editing, and audit trails.
  • Format Conversion & Validation: Convert legacy .doc files, extract text with pandoc, render to PDF/images with LibreOffice, and validate output against OOXML schemas.

Quick Start

Use the docx skill to create a formatted project status report with a table of contents, executive summary heading, and company letterhead, then save it as 'Status-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 generation with precise formatting control?

Automate Word document generation by programmatically manipulating OOXML structures and using JavaScript generation. This method provides full control over styles, tables, headers, footers, and page layouts to produce schema-compliant .docx files.

Can I review and apply tracked changes to existing .docx files programmatically?

Review and apply tracked changes by unpacking existing .docx files, editing the underlying XML directly to insert comments and revisions, then repacking the document. This ensures precise audit trails for contract review and collaborative editing workflows.

What's the best way to convert legacy .doc files to modern .docx format?

Convert legacy .doc files to modern .docx format using LibreOffice for batch processing and format transformation. The process validates output against OOXML schemas to ensure the resulting documents are fully schema-compliant.

Do I need LibreOffice and pandoc to extract text and render Word documents?

You need LibreOffice and pandoc to extract document text and render .docx files to PDF or images. These dependencies are required alongside Poppler and docx-js to generate validated, schema-compliant documents with precise formatting control.

How does XML-level editing improve Word document automation workflows?

XML-level editing improves Word document automation by unpacking .docx files to directly manipulate their OOXML structure. This bypasses application-level interfaces, enabling precise programmatic control over tracked changes, complex tables, and batch processing with repeatability.

When should I not use programmatic .docx generation for document assembly?

Avoid programmatic .docx generation when manual formatting is preferred or when documents lack complex structural elements like tracked changes and tables. It is designed for workflows requiring professional assembly, batch conversion, and precise formatting control rather than simple text editing.