New to Claude Skills? Learn how to install them →

daymade on GitHub

DOCX Creator

Free

Generate production-grade Word documents with ease.

Get this skill

Free · Opens the source repo

What DOCX Creator does

DOCX Creator is a specialized skill designed for creating production-grade Word (.docx) documents, particularly optimized for Chinese formal documents. This skill acts as an incremental layer over the minimax-docx engine, providing essential functionality that enhances the document generation process. It is particularly useful for developers and designers who need to produce documents that adhere to specific formatting and typographical standards required for formal agreements, contracts, and other official documents.

The skill leverages the capabilities of the minimax-docx engine while addressing its limitations, especially when it comes to generating documents with complex structures like Chinese contracts. It includes a verified markdown-to-docx generator that ensures proper formatting and typography, which is critical in legal and formal contexts. The skill also implements hard rules for document alignment and typography that prevent common formatting errors, such as improper justification of text blocks that can distort the appearance of essential information.

To ensure the quality of the generated documents, DOCX Creator incorporates a mandatory visual verification process. This process includes converting the generated .docx files to PDF and checking for visual correctness, which is vital for ensuring that the document appears as intended when opened in Microsoft Word. This attention to detail makes it a reliable choice for users who cannot afford to ship documents that may appear correct but contain hidden formatting issues.

Overall, DOCX Creator is tailored for users who require precision in document generation, particularly in contexts where the presentation of information is as crucial as the content itself. It is an ideal tool for developers and designers working in legal, academic, or formal business environments where document integrity is paramount.

When to use it

Use this skill when you need to create .docx files that require specific formatting, such as contracts or formal documents, especially in Chinese.

When not to use it

This skill is not suitable for simple documents that do not require advanced formatting or for editing existing .docx files.

What you can build with it

Creating a Chinese Contract

Generate a formal contract in .docx format, ensuring all necessary typographical rules are followed.

Drafting an Official Agreement

Produce an agreement document that adheres to specific formatting requirements for legal documents.

Converting Markdown to DOCX

Transform markdown content into a well-formatted .docx file suitable for professional use.

How to install DOCX Creator

View source

1. Install with the skills CLI

npx skills add daymade/claude-code-skills/docx-creator --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by daymade

DOCX Creator

Thin incremental layer over minimax-skills:minimax-docx. Not a document engine.

Read this first. The OpenXML SDK capability lives in minimax-docx. This skill contains zero engine code. What it contains is the part that took a full debugging session to learn: where that engine's CLI stops being usable, how to drive its SDK correctly for Chinese formal documents, and how to verify the output so you don't ship a file that looks fine to you and broken in Word.

Division of labor

LayerOwnerWhat lives there
OpenXML SDK (DocumentFormat.OpenXml), WordprocessingDocument API, XSD validator, style templates, OpenXML encyclopediaminimax-skills:minimax-docxEngine + reference docs. Never duplicated here.
Where the CLI's expressiveness ceiling is, and when to abandon it for C#this skillISSUE-001, ISSUE-002
A verified markdown-to-docx generator for Chinese formal documentsthis skillscripts/Program.cs
Chinese formal-document typography rules that OpenXML lets you get wrongthis skillHard rules below + ISSUE-004…007
Real end-to-end visual verification chainthis skillreferences/verification_protocol.md

Locate the engine at the marketplace install path, typically ~/.claude/plugins/marketplaces/minimax-skills/skills/minimax-docx/.

Go read minimax-docx directly for anything structural this skill does not cover — images, track changes, comments, TOC, multi-section layouts, template application. Its minimax-docx/references/ folder (cjk_typography.md, openxml_element_order.md, openxml_units.md, troubleshooting.md) and its Samples/*.cs are the authority for SDK patterns. Do not reinvent them here.

Routing: which path for this document?

SituationPath
Chinese contract / agreement / 公文 / any doc with 甲乙方 info blocks, numbered clauses, signature block, tablesC# OpenXML via scripts/Program.cs (this skill)
Plain prose, headings and paragraphs only, no bold / lists / tablesminimax-docx CLI create --content-json is enough
Fill or edit an existing .docxminimax-docx pipeline B (edit-content) — this skill has nothing to add
Match an existing .docx's formattingminimax-docx pipeline C (apply-template)
Output should be a PDF, not Worddaymade-docs:pdf-creator — wrong skill, stop here

Rule of thumb: the CLI's --content-json understands exactly three block types (heading, paragraph, pagebreak). Bold, lists, tables, borders, footers, fonts, alignment — none of it is expressible. A Chinese contract needs all of them. See ISSUE-001.

Quick start

The generator reads markdown and writes a formatted .docx. Copy it next to your document so build artifacts stay out of the skill directory:

# 1. Stage the generator beside your markdown
mkdir -p _docxgen && cp <skill-dir>/scripts/Program.cs <skill-dir>/scripts/mmdocx-gen.csproj \
   <skill-dir>/scripts/.gitignore _docxgen/

# 2. Generate (first run restores DocumentFormat.OpenXml + Markdig, ~20s)
dotnet run --project _docxgen -- your-doc.md your-doc.docx

# 3. Structural validation via the engine's XSD validator (note the roll-forward env — ISSUE-003)
DOTNET_ROLL_FORWARD=Major dotnet run \
  --project ~/.claude/plugins/marketplaces/minimax-skills/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli \
  -- validate --input your-doc.docx

# 4. MANDATORY visual verification — never skip, never substitute qlmanage
soffice --headless --convert-to pdf --outdir /tmp/docxcheck your-doc.docx
pdftoppm -png -r 100 /tmp/docxcheck/your-doc.pdf /tmp/docxcheck/page
# then Read every /tmp/docxcheck/page-NN.png

Full command details and troubleshooting: scripts/README.md. Full verification steps and pass/fail criteria: references/verification_protocol.md.

Hard rules (violating these means rework)

1. Alignment is layered — this is the expensive one

Never justify the whole document. Three layers, three alignments:

ContentAlignmentWhy
Document title (H1)CenterConvention
Clause headings (H2+)LeftConvention
Info blocks and signature blocks — 甲方/乙方/统一社会信用代码/法定代表人/日期, i.e. any paragraph whose lines are joined by markdown soft or hard line breaksLeftJustification stretches every line except the paragraph's last. A multi-line info block is one paragraph, so all but its final line get blown out into huge inter-character gaps.
Ordinary body proseJustified (Both)Clean right edge

The rule is machine-checkable, so do not eyeball it: if the markdown paragraph's inline tree contains a LineBreakInline, left-align that paragraph; otherwise justify it. Implemented at scripts/Program.cs lines 144-147, with the break detection at lines 59-64. Full write-up: ISSUE-004.

2. Every list restarts at 1

Each markdown list must get its own NumId plus a LevelOverride carrying StartOverrideNumberingValue = 1. Reuse one NumId across clauses and clause 3's list silently continues from 4. Implemented at scripts/Program.cs lines 148-162 and 183-197. Two SDK traps come with it (wrong class name, wrong element order) — ISSUE-005, ISSUE-006.

3. CJK fonts need both slots

A run must set RunFonts { Ascii, HighAnsi, EastAsia }. Setting only the Latin slots leaves Chinese characters to Word's fallback, and the document renders in whatever the reader's machine picks. Shipped defaults: Latin Times New Roman; East Asian 宋体 for body, 黑体 for headings. Sizes are OpenXML half-points — body 24 (12pt), H1 36 (18pt), clause heading 28 (14pt). ISSUE-007.

4. Page and table basics

A4 is 11906 × 16838 twips with 1440 twip margins; page number goes in a centered footer PAGE field. Tables need all six borders (top/bottom/left/right/insideH/insideV) — set fewer and cells look unruled in print. Implemented at scripts/Program.cs lines 93-125 and 175-177.

Verification is not optional

Banned: qlmanage thumbnails as visual proof. macOS Quick Look renders with a different engine than Word and will happily show a clean-looking page for a document whose info blocks are stretched apart. A document was declared "verified perfect" on qlmanage evidence and opened broken in Word — that is the origin of this rule. ISSUE-008.

Required chain: generate → XSD validate → soffice --headless --convert-to pdfpdftoppm -pngRead every page image → check the five failure modes (info blocks not stretched / each list restarting at 1 / table borders present / signature block intact / no orphaned pagination). Details, prerequisites and the "what counts as failure" list: references/verification_protocol.md.

Before overwriting a delivered .docx, check for a sibling ~$<name>.docx — that is Word's owner lock, meaning the recipient has the old version open. Overwriting works, but they will keep seeing the stale document until they close and reopen it. Tell them. ISSUE-011.

Customizing

scripts/Program.cs is ~215 lines of straightforward OpenXML. Edit it directly for fonts, sizes, spacing, borders, or new block types — that is the intended workflow. Before adding a structural feature (images, TOC, headers, track changes), read the corresponding Samples/*.cs in minimax-docx first; those patterns are SDK-version-verified and will save you a compile-error loop.

References

  • references/known_issues.md — ISSUE-001…011: symptom / root cause / fix / verification for every trap hit while building this pipeline. Read before debugging anything.
  • references/verification_protocol.md — the full end-to-end verification chain, its prerequisites, its pass criteria, and the substitutions that are forbidden.
  • scripts/README.md — how to run the generator, what markdown it supports, environment requirements.

Frequently asked questions about DOCX Creator

Similar skills