docx

Automate docx reading, editing, and generation with docx-js and XML workflows.

641|104|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/loongclaw-ai/loongclaw --skill docx-loongclaw-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/loongclaw-ai/loongclaw/tree/main/skills/anthropic-office/docx
Command: npx skills add https://github.com/loongclaw-ai/loongclaw --skill docx-loongclaw-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Word document generation and editing typically requires juggling XML, tracked changes, and conversion steps that break if a detail is missed, so this skill gathers the docx-js creation notes, unpack/edit/pack sequence, and LibreOffice helpers to keep formatting intact while steering away from PDFs, spreadsheets, or Google Docs.

Core Features & Use Cases

  • Structured Document Production: Follow the docx-js examples to set explicit page sizes, override built-in heading styles, configure tables with dual widths, insert compliant images, and avoid unicode bullets or stray page breaks.
  • Safe Editing & Redlining: Use the unpack, simplify, merge, comment, and pack scripts to edit XML, manage tracked changes and comments attributed to Claude, and accept or reject revisions without corrupting the archive.
  • Validation & Conversion Tools: Run the validate, accept_changes, and pack utilities plus LibreOffice wrappers when converting legacy DOCs, generating PDFs, or keeping table-of-contents and footer/numbering guarantees, particularly for reports, memos, and templates destined for professional audiences.

Quick Start

Request a US Letter memo built with docx-js guidance, clean tracked change handling, dual-width tables, and LibreOffice conversion validation.

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 tracked changes and formatting?

Automate tracked changes in Word documents by unpacking the docx XML, modifying content with lxml, and repacking the archive. The skill provides scripts to add, accept, or reject revisions attributed to specific authors while maintaining formatting integrity.

What is the best way to edit docx XML without corrupting the document archive?

The safest way to edit docx XML is unpacking the archive, modifying the target XML files with lxml, and repacking. This prevents archive corruption and preserves table-of-contents, footer numbering, and tracked change guarantees.

Can I use LibreOffice to convert legacy DOC files to docx and validate formatting?

Yes, LibreOffice wrappers convert legacy DOC files to docx format. Validation scripts check the output to ensure page sizing, dual-width tables, and footer numbering remain correct during the conversion process.

How do I configure dual-width tables and compliant images in docx-js?

To configure dual-width tables and compliant images in docx-js, follow the skill's structured document production notes to set explicit page sizes, override heading styles, and ensure image compliance for professional audiences.

Does this docx automation approach work for generating professional reports and templates?

Yes, the docx automation workflow is designed for professional reports, memos, and templates. It ensures explicit page sizing, dual-width tables, and tracked change management to produce compliant documents for professional audiences.

Why should I avoid PDFs and spreadsheets when using docx automation tools?

The docx automation skill focuses exclusively on Word document workflows, avoiding PDFs, spreadsheets, and Google Docs. This narrow focus ensures XML editing, tracked changes, and LibreOffice conversions function correctly without format conflicts.