DOCX Creation, Editing, and Analysis: Orchestrating Agents for .docx Workflows

Introduction

When asking models to “write a Word document” in environments like Cursor or Claude Code, the common results are Markdown or structurally messy export files. It is difficult to get the table of contents, track changes, comments, and headers/footers right in one go. Writing your own scripts requires wrestling with OOXML, the quirks of docx-js, and the pipeline of unpacking, modifying XML, and repacking.

The following introduces the DOCX Creation, Editing & Analysis skill (@org-02qudk26/docx, v1.0.0) available on SkillHub. It uses a standard SKILL.md to embed the steps and commands for reading, creating, modifying, and validating Word documents into the Agent’s context. Users simply describe their needs in natural language, and the Agent executes the flow defined within the skill.

What is this

DOCX Creation, Editing & Analysis is an Agent Skill designed for .docx files. When a task involves creating, reading, editing, or manipulating Word documents, this skill should be loaded preferentially.

Item Description
Coordinates @org-02qudk26/docx
Version 1.0.0
Publisher Zhiyu Technology
Source enterprise (SkillHub)
Category office-efficiency
Tags requires_api_key=false (No additional API Key required)
SkillHub Page https://www.skillhub.cn/skills/org-02qudk26/docx
Skill API Address https://api.skillhub.cn/org-02qudk26/docx

The README within the skill package summarizes its capabilities as: creating, reading, editing, and validating professional Word documents, covering styles, tables of contents, tables, headers/footers, images, comments, track changes, and OOXML-level editing.

Core Features

The following content is derived from the skill’s SKILL.md and accompanying scripts. After installation, the Agent routes tasks according to this document.

Trigger Scope

Beyond literal mentions of “Word doc” or “.docx”, the skill instructions also cover: generating formal documents with tables of contents, headings, page numbers, or letterheads; extracting or restructuring content from .docx; inserting or replacing images; find and replace; handling track changes or comments; and delivering .docx files in the form of reports, memos, letters, or templates. It is explicitly not intended for PDFs, spreadsheets, Google Docs, or general coding unrelated to Word generation.

Three Main Paths

The skill treats .docx as a “ZIP package of XML files” and selects the method based on the task:

Task Method
Read / Analyze pandoc, or unpack to read raw XML
Create New docx-js (npm package docx)
Edit Existing Unpack → Modify XML → Repack

Reading and Previewing

  • Text with track changes: pandoc --track-changes=all document.docx -o output.md
  • Unpack: python scripts/office/unpack.py document.docx unpacked/
  • Convert to PDF / Paginated images: scripts/office/soffice.py and pdftoppm (used for layout verification within the skill)

Creating New Documents

Generate files via Node scripts calling the docx library, and validate using python scripts/office/validate.py. The document emphasizes error-prone points such as page size (default A4), dual table widths, using numbering configurations for lists instead of Unicode bullets, requiring type for ImageRun, and requiring HeadingLevel for the table of contents.

Editing Existing Documents

A fixed three-step process:

  1. python scripts/office/unpack.py document.docx unpacked/
  2. Edit the XML under unpacked/word/; comments can be added using python scripts/comment.py; track changes must conform to OOXML patterns.
  3. python scripts/office/pack.py unpacked/ output.docx --original document.docx

Legacy .doc files must be converted first:

python scripts/office/soffice.py --headless --convert-to docx document.doc

To accept all track changes:

python scripts/accept_changes.py input.docx output.docx

Dependencies

Runtime dependencies listed by the skill: pandoc, docx (npm install -g docx), LibreOffice (via scripts/office/soffice.py), and Poppler’s pdftoppm.

Installation & Activation

Refer to the official SkillHub instructions for the installation process: https://skillhub.cn/install/skillhub.md. The installation coordinates provided on the skill details page are @org-02qudk26/docx.

1. Install SkillHub CLI (if not already installed)

command -v skillhub && skillhub --version

If not installed, run the full installation or just the CLI:

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

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

2. Install the skill to the current Agent’s skills directory

You must use --dir to point to the skills directory actually read by the Agent; otherwise, it defaults to ./skills/ and may not be loaded.

skillhub install @org-02qudk26/docx --dir <skills directory>

Common paths (subject to official documentation):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

Upon successful installation, the local directory structure resembles: .../@org-02qudk26/docx/SKILL.md and scripts/ etc., totaling 22 files (consistent with the file_count in the platform’s signed metadata).

3. (Optional) Verify package integrity

SkillHub supports signature verification for installed versions. The CLI version must be 2026.7.29 or higher:

skillhub self-upgrade
skillhub verify @org-02qudk26/docx

When successful, the terminal will indicate that signature and content verification passed. See https://skillhub.cn/docs/verify-signature?namespace=org-02qudk26&slug=docx&version=1.0.0 for specific meanings.

4. Enable in conversation

Simply explain your needs to the Agent, for example: “Please install @org-02qudk26/docx based on https://skillhub.cn/install/skillhub.md.” After installation and restarting/refreshing skill loading, tasks mentioning Word / .docx should automatically trigger this skill.

Typical Usage

Natural Language Driven

Once installed, you can directly describe business goals, and the Agent will select the path to read, create, or modify. Example scenarios in the skill package README include: unifying headings and tables of contents for contract drafts; handling client documents with track changes; and adding illustrations and footnotes to reports with rendering verification. These are instructions provided within the skill documentation, not third-party cases.

Reading Existing Documents as Markdown

pandoc --track-changes=all document.docx -o output.md

Suitable for first understanding the body text and revision content before deciding whether to unpack and modify XML.

Generating from Scratch and Validating

The Agent writes a docx-js script according to SKILL.md to generate doc.docx, then:

python scripts/office/validate.py doc.docx

If visual inspection is needed, the skill suggests converting to PDF first and then exporting paginated images (see the “Convert to images” section in SKILL.md for commands).

Unpack, Edit, and Repack

python scripts/office/unpack.py document.docx unpacked/
# Edit unpacked/word/document.xml etc.
python scripts/office/pack.py unpacked/ output.docx --original document.docx

Comments can be coordinated with:

python scripts/comment.py unpacked/ 0 "Comment body (mind XML escaping)"

Scenarios & Notes

Who it is for

  • Developers, legal, operations, consulting, and other roles that frequently deliver .docx files via Agents.
  • Teams requiring track changes, comments, and OOXML-level modifications, not just “exporting a chunk of text”.
  • Users already using clients like Cursor / Claude Code / Codex that support Skill directories.

Limitations & Notes

  • The skill explicitly does not handle PDFs, spreadsheet files, or Google Docs; .doc files must be converted to .docx first.
  • Document creation relies on Node and the global or available docx package; preview and conversion rely on LibreOffice, pandoc, and Poppler. Corresponding steps will fail if components are missing from the environment.
  • The editing path requires adherence to OOXML and the schema order instructions in the skill; automatic repair during the packing stage can only handle partial issues (like some IDs, whitespace retention) and cannot replace legitimate XML.
  • SkillHub Statistics (based on crawled data): Rating 100000, Downloads 37141; enterprise skills are installed the same way as public registry skills, both via skillhub install @org-02qudk26/docx.

Conclusion

DOCX Creation, Editing & Analysis embeds the standard pipeline for Word documents in Agent scenarios into SKILL.md: using pandoc/unpacking for reading, docx-js for creation, unpack-edit-repack for modification, along with script conventions for validation, comments, and track changes. If .docx files frequently appear in your workflow, you can install @org-02qudk26/docx via SkillHub to reduce the cost of figuring out OOXML from scratch every time.

Official Entry Points:

  • SkillHub Details: https://www.skillhub.cn/skills/org-02qudk26/docx
  • Skill API: https://api.skillhub.cn/org-02qudk26/docx
  • Installation Guide: https://skillhub.cn/install/skillhub.md
羽毛球分组比赛记分
小程序二维码

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

Xiaoye