docx-md for Openclaw

A low-level OOXML processing tool designed to bridge the gap between AI agents and Microsoft Word documents through token-efficient Markdown conversion.

yanweiliang323868-del
v1.0.1
Feb 23, 2026
0
1.5k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install docx-md

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install docx-md using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is docx-md?

docx-md is a specialized utility for AI document review and manipulation that interacts directly with OOXML, the underlying ZIP and XML structure of .docx files. It circumvents the need for heavy commercial Word libraries, providing a lightweight and high-performance solution for developers building Openclaw Skills. The tool creates a bidirectional bridge: it converts complex Word documents into a compact, token-efficient Markdown format for AI processing and subsequently applies AI-generated edits back into the document as native tracked changes and comments.

docx-md Use Cases

  • AI-powered legal contract review and redlining where track changes are required.
  • Automated technical documentation updates based on agent-generated content.
  • Batch processing of Word documents to extract structured Markdown for LLM context windows.
  • Collaborative AI workflows where model suggestions must be reviewed by humans in Microsoft Word.

How docx-md Works

  1. The tool parses the word/document.xml and word/comments.xml files within the DOCX container.
  2. Content is converted into Markdown or JSON, using blockIndex markers to allow precise targeting of edits.
  3. The structured output is sent to an LLM, which returns an edit JSON containing the proposed modifications.
  4. The modify script converts these JSON edits back into OOXML tags like w:ins and w:del.
  5. Revisions are injected back into the document, preserving the original formatting while adding track changes.
  6. A finalize step can be triggered to programmatically accept all revisions and remove all comments for a clean delivery version.

docx-md Setup

First, ensure you have the necessary dependencies installed:

pip install docx-revisions

To read a document and generate token-efficient Markdown:

python3 skills/docx-md/scripts/read_docx.py document.docx -o result.md

To apply edits generated by an AI agent:

python3 skills/docx-md/scripts/apply_edits_docx.py document.docx edits.json -o modified.docx

To accept all changes and finalize the document:

python3 skills/docx-md/scripts/finalize_docx.py modified.docx -o final.docx

docx-md Data Schema & Taxonomy

The docx-md skill uses a specific schema to ensure the AI can precisely modify document sections. Each block is identified by a blockIndex.

Property Description
blockIndex A unique numeric marker (e.g., <!-- b:1 -->) used to target specific paragraphs.
originalContent The raw text found in the document before any AI intervention.
content The updated text provided by the agent to replace the original content.
basis The reasoning or justification for the change, often used in comments.
modifications An array containing the objects above for batch processing.

docx-md Advanced Features

  • Token-efficient Markdown output that includes block markers to minimize context window usage in Openclaw Skills.
  • Direct OOXML manipulation allowing for track changes (redlining) without requiring a Microsoft Word installation.
  • Support for custom revision author attribution during the modification phase.
  • Automated 'Finalize' mode that strips metadata, removes comments, and flattens all revisions into a final state.
  • Seamless integration with complex workflows such as multi-agent contract review pipelines.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*