# Minimax DOCX

Professional DOCX document creation, editing, and formatting using OpenXML SDK (.NET).

- Repository: https://github.com/MiniMax-AI/skills (13760 stars)
- Category: Documents
- License: MIT
- Last updated: 2026-04-18
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add MiniMax-AI/skills --skill minimax-docx -g -a claude-code -y`
Codex: `npx skills add MiniMax-AI/skills --skill minimax-docx -g -a codex -y`
Cursor: `npx skills add MiniMax-AI/skills --skill minimax-docx -g -a cursor -y`
Gemini CLI: `npx skills add MiniMax-AI/skills --skill minimax-docx -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add MiniMax-AI/skills`

## Description

Professional DOCX document creation, editing, and formatting using OpenXML SDK (.NET). Three pipelines: (A) create new documents from scratch, (B) fill/edit content in existing documents, (C) apply template formatting with XSD validation gate-check. MUST use this skill whenever the user wants to produce, modify, or format a Word document, including when they say "write a report", "draft a proposal", "make a contract", "fill in this form", "reformat to match this template", or any task whose final output is a .docx file. Even if the user doesn't mention "docx" explicitly, if the task implies a printable/formal document, use this skill.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# minimax-docx

Create, edit, and format DOCX documents via CLI tools or direct C# scripts built on OpenXML SDK (.NET).

## Setup

**First time:** `bash scripts/setup.sh` (or `powershell scripts/setup.ps1` on Windows, `--minimal` to skip optional deps).

**First operation in session:** `scripts/env_check.sh`, do not proceed if `NOT READY`. (Skip on subsequent operations within the same session.)

## Quick Start: Direct C# Path

When the task requires structural document manipulation (custom styles, complex tables, multi-section layouts, headers/footers, TOC, images), write C# directly instead of wrestling with CLI limitations. Use this scaffold:

```csharp
// File: scripts/dotnet/task.csx  (or a new .cs in a Console project)
// dotnet run --project scripts/dotnet/MiniMaxAIDocx.Cli -- run-script task.csx
#r "nuget: DocumentFormat.OpenXml, 3.2.0"

using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;

using var doc = WordprocessingDocument.Create("output.docx", WordprocessingDocumentType.Document);
var mainPart = doc.AddMainDocumentPart();
mainPart.Document = new Document(new Body());

// --- Your logic here ---
// Read the relevant Samples/*.cs file FIRST for tested patterns.
// See Samples/ table in References section below.
```

**Before writing any C#, read the relevant `Samples/*.cs` file**, they contain compilable, SDK-version-verified patterns. The Samples table in the References section below maps topics to files.

## CLI shorthand

All CLI commands below use `$CLI` as shorthand for:
```bash
dotnet run --project scripts/dotnet/MiniMaxAIDocx.Cli --
```

## Pipeline routing

Route by checking: does the user have an input .docx file?

The rest: https://github.com/MiniMax-AI/skills/blob/HEAD/skills/minimax-docx/SKILL.md
