Logo
ClawHub Skills Lib
HomeCategoriesUse CasesTrendingBlog
HomeCategoriesUse CasesTrendingBlog
ClawHub Skills Lib
ClawHub Skills Lib

Browse 25,000+ community-built AI agent skills for OpenClaw. Updated daily from clawhub.ai.

Explore

  • Home
  • Trending
  • Use Cases
  • Blog

Categories

  • Development
  • AI & Agents
  • Productivity
  • Communication
  • Data & Research
  • Business
  • Platforms
  • Lifestyle
  • Education
  • Design

Use Cases

  • Security Auditing
  • Workflow Automation
  • Finance & Fintech
  • MCP Integration
  • Crypto Trading
  • Web3 & DeFi
  • Data Analysis
  • Social Media
  • 中文平台技能
  • All Use Cases →
© 2026 ClawHub Skills Lib. All rights reserved.Built with Next.js · Supabase · Prisma
Home/Blog/Word / DOCX: Create and Edit Microsoft Word Documents With Deep Format Awareness
skill-spotlightdocs-officeword-docxclawhubopenclaw

Word / DOCX: Create and Edit Microsoft Word Documents With Deep Format Awareness

March 15, 2026·5 min read

12,500+ downloads and 26 stars — the Word / DOCX Skill by @ivangdavila is one of the few AI skills that genuinely understands the internal structure of Microsoft Word documents. Most tools treat DOCX as black-box binary — this skill treats it as what it actually is: a ZIP file containing structured XML.

The Problem It Solves

Every developer or content creator who has tried to programmatically generate Word documents has hit the same wall: styles break, numbering resets unexpectedly, track changes corrupt the visible content, or the document looks fine in Word but shifts in LibreOffice. The reason is that DOCX is deceptively complex — what looks like "bold text in a list" is actually a layered interaction of paragraph styles, character styles, numbering definitions, and direct formatting overrides.

The Word / DOCX Skill gives Clawdbot the structural knowledge to handle these correctly.

How DOCX Actually Works

The skill's core documentation demystifies the format:

DOCX is a ZIP archive containing XML files:

  • word/document.xml — main document content
  • word/styles.xml — named style definitions
  • word/numbering.xml — list and numbering patterns
document.zip (renamed .docx)
├── word/
│   ├── document.xml    ← body content
│   ├── styles.xml      ← style definitions
│   ├── numbering.xml   ← list patterns
│   └── header1.xml     ← header content
└── [Content_Types].xml

Text structure:

<w:p>                    <!-- paragraph -->
  <w:r>                  <!-- run (uniform formatting) -->
    <w:rPr>              <!-- run properties -->
      <w:b/>             <!-- bold -->
    </w:rPr>
    <w:t>Hello</w:t>     <!-- text -->
  </w:r>
</w:p>

One visible sentence may span multiple <w:r> runs — each run has uniform formatting.

Key Concepts the Skill Handles

Styles vs. Direct Formatting

Styles (Heading 1, Normal) → Named, reusable, in styles.xml
Direct formatting          → Inline, overrides styles, messy

The skill knows to clean up direct formatting to reveal underlying styles — essential for creating consistent, maintainable documents.

Numbering (Lists)

The most complex part of DOCX. The skill understands the three-layer system:

  1. abstractNum — defines the numbering pattern
  2. num — references abstractNum
  3. Paragraph numPr — references num

It knows that restarting numbering requires explicit flags, not just visual formatting — a common source of bugs in generated documents.

Track Changes

<w:del>                  <!-- deleted text (still in document!) -->
  <w:r><w:t>old</w:t></w:r>
</w:del>
<w:ins>                  <!-- inserted text -->
  <w:r><w:t>new</w:t></w:r>
</w:ins>

The skill knows that deleted text is still present in DOCX with <w:del> wrappers — crucial for correctly extracting visible content.

Dynamic Fields

{ DATE \@ "yyyy-MM-dd" }  → dynamic date (updates on open)
{ TOC }                    → auto-generated table of contents
{ MERGEFIELD ClientName }  → mail merge placeholder
{ PAGE }                   → page number

Fields have both a code (formula) and a cached result. The skill understands when to update fields vs. use cached values.

Practical Use Cases

Legal document generation:

  • Contracts with tracked changes for review
  • Standard clauses as named styles for easy updating
  • Dynamic fields for dates and client names

Academic reports:

  • Automatic table of contents via TOC field
  • Consistent heading hierarchy
  • List numbering that restarts correctly per section

Mail merge:

  • MERGEFIELD placeholders for personalized letters
  • Template documents with dynamic content

Technical documentation:

  • Complex lists with mixed bullets and numbering
  • Headers/footers that change per section
  • Cross-references between sections

Cross-Platform Compatibility

The skill explicitly addresses LibreOffice and Google Docs compatibility — documents created for Word may shift in rendering. Key considerations:

  • Compatibility mode — w:compat settings limit features to earlier Word versions; important for broad compatibility
  • Embedded fonts — may not transfer; use standard fonts for cross-platform docs
  • Complex formatting — test roundtrip through LibreOffice/Google Docs if distribution matters

Works on All Platforms

Unlike many ClawHub skills, Word / DOCX works on macOS, Linux, and Windows — reflecting the cross-platform nature of document processing.

Implementation Approach

The skill works at two levels depending on the task:

  • python-docx for structured document creation and straightforward editing (styles, tables, numbering)
  • Direct OOXML manipulation for complex cases: unpacking the ZIP archive, modifying word/document.xml directly, repacking — used for tracked changes and compatibility settings
  • Pandoc as a bridge for tracked-changes workflows: convert DOCX to markdown for AI-friendly editing, then repack to DOCX

This layered approach explains why the skill handles complex formatting that simpler DOCX libraries break on.

Considerations

  • Complexity scales with document — simple text generation is easy; complex documents with tracked changes, mail merge, and cross-references require careful handling
  • Intermediate complexity — the skill is rated intermediate; basic document creation is accessible, but full DOCX manipulation benefits from understanding the XML structure
  • No GUI preview — documents are generated as files; you need Word, LibreOffice, or Google Docs to visually verify the output
  • Style setup matters — for consistently formatted documents, define your styles upfront rather than relying on direct formatting

The Bigger Picture

The Word / DOCX Skill addresses a genuine gap in AI tooling: the ability to produce correct Word documents, not just plausibly-formatted ones. By grounding Clawdbot in the actual XML structure of DOCX, the skill enables reliable document automation for legal, business, and technical writing — workflows where formatting correctness is non-negotiable. With 12,500+ downloads and cross-platform support, it's filling a real need for teams that can't always escape the Word ecosystem.


View the skill on ClawHub: word-docx

← Back to Blog