In agent workflows, generating structured long-form Chinese documents (such as lab reports and graduation theses) usually requires handling complex typesetting rules. Manual formatting is time-consuming and error-prone. word-docx-writer is designed to address this problem. It is a plugin that provides an Agent Skill and a toolkit, capable of generating well-formed .docx documents and normalizing existing documents.
Core Capabilities¶
The plugin mainly includes the following features:
- Lightweight dependencies: The core document generation logic depends only on the Python standard library. Pillow is required when inserting images.
- Dual implementation modes: Supports
OOXML(cross-platform, no Word required) andWord COM(Windows + Microsoft Word). OOXML handles basic generation, while Word COM handles advanced features such as .doc conversion and table of contents refresh. - Template and normalization: Supports applying a cover page, table of contents, headers, and footers from a template while replacing only the body text. It also supports one-click application of font, font size, paragraph formatting, and color to any existing .docx document.
- Multi-agent compatibility: Distributable as a DSH plugin and compatible with agent tools such as Claude and Gemini.
Installation and Enablement¶
Install the plugin from the official DeepSeek Harness (DSH) catalog:
dsh plugin --profile web add dsh-pluginword-docx-writer@latest
After installation, the plugin provides built-in skills and a script toolkit.
Typical Usage¶
Before use, ensure the environment has Python 3.8+ and Pillow.
- Generate a document
Generate a Word document from a marked-up source. Assumingcontent.txtexists, run the following command:
python scripts/build_docx.py --content content.txt --out report.docx
- Normalize an existing document
Apply typesetting standards to a generated or existing .docx document. Word COM is preferred by default, with automatic fallback to OOXML mode on failure:
python scripts/word_style.py report.docx
To force OOXML mode on non-Windows platforms, add the `--method ooxml` parameter.
- Validate document structure
Read and transform the .docx document structure for validation:
python scripts/read_docx.py report.docx
Use Cases and Considerations¶
- Use cases: Suitable for generating and formatting a wide range of long Chinese documents, including lab reports, course design reports, graduation theses, and project summaries.
- Platform limitations:
- Non-Windows platforms:
build_docx.pyandword_style.py --method ooxmlare fully available. - .doc conversion and table of contents refresh: Require a Windows + Microsoft Word (COM) environment, or can be completed manually using LibreOffice/Word.
- Non-Windows platforms:
- License: The plugin is licensed under the MIT License. Please retain the copyright notice when using it.
Summary¶
word-docx-writer provides DSH and other agent tools with a standardized solution for processing Chinese documents. Through lightweight Python scripts and a dual implementation model, it balances cross-platform capability with deep Office integration on Windows, making it suitable for workflow scenarios that require batch generation or standardization of Word documents.
For more details, see the plugin catalog: https://www.skillhub.cn/plugins/RempleXI/word-docx-writer