Skip to content
Skillpedia
PDF, Word & slides14k Β· #11293

minimax-docx

What it does

This skill creates and edits Word documents using OpenXML tools. It is for people who need a professional document, such as a report, proposal, or formatted template.

When to use it

  • βœ“When you ask for a written report, proposal, or letter as a Word file.
  • βœ“When you want to fill in or change content in an existing Word document.
  • βœ“When you want a template's formatting applied to a document.

Skill link

https://github.com/MiniMax-AI/skills/blob/main/skills/minimax-docx/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/MiniMax-AI/skills/blob/main/skills/minimax-docx/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œI want a Word report about our quarterly results, with headings, a table, and a clean layout.”

5 new skills a week. 1 minute to read.

How it works

The agent sets up the tools, then writes or edits the document through the command line tools or a custom C# script. It checks the file against the Word format rules before finishing.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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:

// 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:

dotnet run --project scripts/dotnet/MiniMaxAIDocx.Cli --

Pipeline routing

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

User task
β”œβ”€ No input file β†’ Pipeline A: CREATE
β”‚   signals: "write", "create", "draft", "generate", "new", "make a report/proposal/memo"
β”‚   β†’ Read references/scenario_a_create.md
β”‚
└─ Has input .docx
    β”œβ”€ Replace/fill/modify content β†’ Pipeline B: FILL-EDIT
    β”‚   signals: "fill in", "replace", "update", "change text", "add section", "edit"
    β”‚   β†’ Read references/scenario_b_edit_content.md
    β”‚
    └─ Reformat/apply style/template β†’ Pipeline C: FORMAT-APPLY
        signals: "reformat", "apply template", "restyle", "match this format", "ε₯—樑板", "ζŽ’η‰ˆ"
        β”œβ”€ Template is pure style (no content) β†’ C-1: OVERLAY (apply styles to source)
        └─ Template has structure (cover/TOC/example sections) β†’ C-2: BASE-REPLACE
            (use template as base, replace example content with user content)
        β†’ Read references/scenario_c_apply_template.md

If the request spans multiple pipelines, run them sequentially (e.g., Create then Format-Apply).

Pre-processing

Convert .doc β†’ .docx if needed: scripts/doc_to_docx.sh input.doc output_dir/

Preview before editing (avoids reading raw XML): scripts/docx_preview.sh document.docx

Analyze structure for editing scenarios: $CLI analyze --input document.docx

Scenario A: Create

Read references/scenario_a_create.md, references/typography_guide.md, and references/design_principles.md first. Pick an aesthetic recipe from Samples/AestheticRecipeSamples.cs that matches the document type β€” do not invent formatting values. For CJK, also read references/cjk_typography.md.

Choose your path:

  • Simple (plain text, minimal formatting): use CLI β€” $CLI create --type report --output out.docx --config content.json
  • Structural (custom styles, multi-section, TOC, images, complex tables): write C# directly. Read the relevant Samples/*.cs first.

CLI options: --type (report|letter|memo|academic), --title, --author, --page-size (letter|a4|legal|a3), --margins (standard|narrow|wide), --header, --footer, --page-numbers, --toc, --content-json.

Then run the validation pipeline (below).

Scenario B: Edit / Fill

Read references/scenario_b_edit_content.md first. Preview β†’ analyze β†’ edit β†’ validate.

Choose your path:

  • Simple (text replacement, placeholder fill): use CLI subcommands.
  • Structural (add/reorganize sections, modify styles, manipulate tables, insert images): write C# directly. Read references/openxml_element_order.md and the relevant Samples/*.cs.

Available CLI edit subcommands:

  • replace-text --find "X" --replace "Y"
  • fill-placeholders --data '{"key":"value"}'
  • fill-table --data table.json
  • insert-section, remove-section, update-header-footer
$CLI edit replace-text --in
FAQ

Does it need special software?

The skill has a setup step for its tools, including .NET for the OpenXML scripts.

Can it edit a document I already have?

Yes. It has a pipeline for filling and editing content in existing Word files.

How does it make sure the file is valid?

It runs a validation step against the Word file format rules before reporting success.

Details

Original description by the author

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

repo: MiniMax-AI/skills

Popularity

GitHub stars
14k
Ranking position
#11293
License
MIT
Updated
4/18/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills