Creating, Checking, and Editing Word / DOCX: Enabling Agents to Reliably Handle Styles and Numbering

Introduction

In office automation, Word documents are often the kind of artifact that “looks simple but is troublesome to modify”: lists get renumbered inexplicably, headers, footers, and section breaks get messed up easily, and files with track changes and comments cannot be treated as plain text for replacement. Stitching XML rigidly with scripts or performing full-text replacement often leads to layout drift after opening the file between Word, LibreOffice, and Google Docs.

Below is an introduction to the Word / DOCX skill on SkillHub (coordinate @clawhub_ivangdavila/word-docx, often referred to as “Create, Inspect, Edit” capability on the SkillHub page). It treats DOCX as an OOXML package for understanding and operation, guiding the Agent to consider styles, numbering, revisions, and compatibility during creation, inspection, and editing, rather than just changing visible text.

What is this

Word / DOCX is an Agent Skill designed for Microsoft Word and .docx files. The current version is 1.0.2, categorized under office-efficiency, published by ivangdavila, sourced from clawhub. For upstream documentation, see ClawHub. SkillHub inclusion page: Word / DOCX. Official entry: https://api.skillhub.cn/zcwl/word-docx.

The positioning in the introduction is: to create, inspect, and edit Microsoft Word documents and DOCX files, covering scenarios such as styles, numbering, track changes, tables, section breaks, and compatibility checks. The tags indicate requires_api_key=false, meaning no additional API Key is required.

Core Capabilities

The following capabilities are derived from the official descriptions on SkillHub and ClawHub, which can be understood by task type:

  1. Creation & Generation: Generate new documents based on style systems, prioritizing named styles over stacking direct formatting to facilitate subsequent manual editing.
  2. Inspection & Reading: Treat .docx as XML parts within a ZIP (e.g., word/document.xml, styles.xml, numbering.xml, and header/footer relationships). In “read-only, extract, review” scenarios, follow a structure-preserving path first before deciding whether to dive deep into modifying OOXML.
  3. Editing Existing Files: Perform OOXML-aware editing on existing documents, emphasizing minimizing format drift during round-trip editing; especially applicable for files with track changes, comments, fields, tables, templates, or pagination constraints.
  4. Styles & Numbering: Distinguish between paragraph styles, character styles, and direct formatting; lists rely on Word numbering definitions (abstractNum, num, etc.) rather than pasting Unicode bullet points.
  5. Layout & Sections: Handle margins, orientation, headers, footers, and page numbers by section; use section breaks to change layout rather than using empty paragraphs to force spacing.
  6. Revisions, Comments & Fields: Distinguish between insertions, deletions, and comment metadata when track changes are enabled; treat Table of Contents (TOC), page numbers, and cross-references as fields, paying attention to refreshing cached display values.
  7. Compatibility Checks: Consider round-trip differences between Word, LibreOffice, Google Docs, and conversion tools before delivery; provide risk warnings for formats like .docm and legacy .doc.

The ClawHub page also lists related skills (to be installed after user confirmation): documents (general documents and conversion), brief (concise business writing), article (long-form structure and drafting).

Installation & Enablement

Via SkillHub (Domestic Index)

The installation method provided on the SkillHub page is: let the Agent install the coordinate @clawhub_ivangdavila/word-docx according to the SkillHub Installation Instructions.

If the skillhub CLI is already available on the machine, you need to use --dir to point to the current Agent’s skills directory during installation; otherwise, installing to the default ./skills/ might not be recognized. Example for Cursor common directory:

command -v skillhub && skillhub --version
skillhub install clawhub_ivangdavila/word-docx --dir ~/.cursor/skills/

If the CLI is not installed, you can perform a one-click installation (full or CLI only) according to SkillHub documentation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Via ClawHub / OpenClaw Upstream

The installation command provided by the upstream ClawHub is:

openclaw skills install @ivangdavila/word-docx

The coordinate is @clawhub_ivangdavila/word-docx on the SkillHub side, and @ivangdavila/word-docx on the clawhub source. Please refer to the store and CLI you are currently using for installation.

After installation, clarify the task and the .docx path in the conversation, and specify whether track changes, comments, fields, or layout constraints are involved to facilitate the workflow within the Skill.

Typical Usage

The official “When to Use” trigger conditions can be summarized as:

  • The main deliverable is Word or .docx;
  • The file contains revisions, comments, headers/footers, numbering, fields, tables, templates, or pagination limits;
  • It is necessary to maintain layout and review information stability after multiple opens and edits.

Combined with the Skill body, a common operational sequence could be:

  1. Determine Task Type: Creating a new document, read-only extraction/review, or making minimal changes to an existing reviewed draft—these three workflows are different, and “rewriting the whole paragraph” should not be mixed in.
  2. Read Fragile Documents: First, perform structured extraction or inspect internal package parts, then modify OOXML; do not assume one word corresponds to one XML node (text may be distributed across multiple runs).
  3. Modify Lists & Styles: Change numbering definitions and paragraph numbering properties, rather than manually making it “look aligned”; pay attention to external styles and numbering definitions being imported when pasting across documents.
  4. Change Layout: Adjust margins and headers/footers at the section level; table width relates to page width and margins. For complex tables, explicit widths are recommended rather than relying entirely on each editor’s interpretation of auto-fit.
  5. Review Scenarios: Default to span-level replacement to avoid revision noise, bookmark, or comment anchor misalignment caused by whole-paragraph rewriting; this is especially true for legal, academic, and business review drafts.
  6. Before Delivery: Check pagination, tables, field refresh, and cross-references in the target environment (or equivalent editor) to avoid “text is correct, but layout changed after opening.”

The above steps are a summary of the built-in best practices of the Skill. The specific implementation is executed by the Agent according to the SKILL.md guidelines after enabling this Skill.

Scenarios and Caveats

Who it is for

  • Teams that need Agents to generate or maintain formal Word templates, reports, and contract review drafts;
  • Automation pipelines that need to fill Markdown/data into DOCX, requiring maintainable styles, multi-level lists, and section headers;
  • Those who need to make local modifications while preserving track changes, comments, and fields, rather than full-text replacement.

Limitations and Common Pitfalls (from official “Common Traps”, should be aware of before installation)

  • Copy-pasting easily brings in redundant styles and numbering definitions; header/footer images rely on part relationships, and blindly reusing IDs will break links.
  • Using empty paragraphs for spacing makes templates fragile; “restarting” lists by eye often fails because numbering state is not in the visible text.
  • Deleting all paragraph text may still leave empty paragraph marks or unstable list items; tables may interpret auto-fit and percentage widths inconsistently between editors.
  • Compatibility mode may limit new features; changing page size or default margins will affect TOC, footnotes, and cross-references.
  • Legacy .doc usually needs to be converted first and then processed according to modern .docx assumptions; .docm contains macros and poses higher risks.

SkillHub Statistics (based on crawled data): Rating 100000, Downloads 275304, Installs 23940.

Conclusion

If your workflow frequently encounters situations where “the Agent modified the DOCX, but the numbering is messed up when the colleague opens it” or “the review draft was rewritten entirely,” you can make Word / DOCX a default Skill, letting creation, inspection, and editing follow OOXML and Word semantics. For installation and instructions, refer to SkillHub: https://api.skillhub.cn/zcwl/word-docx, page details: https://www.skillhub.cn/skills/clawhub_ivangdavila/word-docx.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye