minimax-docx
Skill2 starsChanged 5 months agoMITView on GitHub
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.
17 other projects use a version of this, 14 of them edited.
Adopted by
Most recently taken up by
- martgueritainaccurate875/skillsedited, first seen Nov 8, 2026
- ChasePassion/skillsedited, first seen Nov 1, 2026
- AlekseiUL/heisenberg-team-GPTedited, first seen Nov 1, 2026
- AlekseiUL/heisenberg-teamedited, first seen Nov 1, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- jhy0285/monofieldtheir own version, first seen Oct 13, 2026
Used with
Projects with it also use pptx-generator, browser-use and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
coleam00Skillpptx-generator
Generate and edit presentation slides as PPTX files. Also create LinkedIn carousels and manage reusable slide layouts.
Also in 8 projects that use this
Saik0sSkillbrowser-use
AI-driven browser automation via Model Context Protocol
Also in 3 projects that use this
OpenAISkillsystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Also in 4 projects that use this
OpenAISkillwriting-plans
Use when you have a spec or requirements for a multi-step task, before touching code
Also in 3 projects that use this
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 14
- MiniMax-AI/skills★ 14k100% same
- loongclaw-ai/loongclaw★ 640100% same
- ninehills/skills★ 280100% same
- AlekseiUL/heisenberg-team★ 17100% same
- AlekseiUL/heisenberg-team-GPT★ 9100% same
- HK-hub/AgentSkills★ 6100% same
- martgueritainaccurate875/skills★ 6100% same
- huangzida/skills★ 2100% same
- idexal/idexal-skills★ 2100% same
- X-FRI/skills★ 2100% same
4 more not listed
Wrote their own version · 3
- jhy0285/monofield★ 6same name
- jpoindexter/theft-kit★ 1same name
- davidanthonyn/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository71 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- academic-searchSkill
- agent-reachSkill
- anysearchSkill
- brainstormingSkill
- brave-searchSkill
- clash-verge-controlSkill
- drawio-skillSkill
- find-skillsSkill
- fireworks-tech-graphSkill
- github-trending-discoverySkill
- html-pptSkill
- humanizer-zhSkill
- ai-news-collectorSkill
- info-andrej-karpathy-rssSkill
- info-daily-hot-topicsSkill
- karpathy-guidelinesSkill
- markdown-to-docxSkill
- mcp-builderSkill
- minimax-pdfSkill
- minimax-xlsxSkill
- office-docxSkill
- office-pdfSkill
- office-pptxSkill
- office-pywordSkill
- office-xlsxSkill
- ontologySkill
- openclaw-optimizationSkill
- pd-architectureSkill
- pd-bddSkill
- pd-brainstormingSkill
- pd-diagnoseSkill
- pd-docSkill
- pd-executionSkill
- pd-grill-with-docsSkill
- pd-improve-codebase-architectureSkill
- pd-planSkill
- pd-postgresSkill
- pd-prototypeSkill
- pd-puaSkill
- pd-reviewSkill
- pd-rules-checkSkill
- pd-setupSkill
- pd-simplifySkill
- pd-tddSkill
- pd-to-issuesSkill
- pd-to-prdSkill
- pd-triageSkill
- pd-zoom-outSkill
- pi-drawioSkill
- pi-githubSkill
- pi-llm-serverSkill
- pi-memorySkill
- pi-painterSkill
- pi-sketch-readerSkill
- pr-academic-searchSkill
- pr-arxiv-watcherSkill
- pr-critic-mentor-reviewSkill
- pr-daily-research-papersSkill
- pr-deep-researchSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 10 are common, 0 are distinctive, and 9 are very specific to this project.
10
Common
Most of the 13 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 37
Create, edit, and format DOCX documents via CLI tools or direct C# scripts built on OpenXML SDK (.NET).
- Very specific: line 61
If env_check.sh reports [FAIL] dotnet and you cannot install .NET SDK, use pandoc as a simple fallback for basic Markdown-to-DOCX …
- Common: line 71
When the task requires structural document manipulation (custom styles, complex tables, multi-section layouts, headers/footers, TOC, …
- Very specific: line 95
All CLI commands below use $CLI as shorthand for:
- Common: line 123
If the request spans multiple pipelines, run them sequentially (e.g., Create then Format-Apply).
- Very specific: line 135
Read references/scenario_a_create.md, references/typography_guide.md, and references/design_principles.md first.
- Very specific: line 147
Read references/scenario_b_edit_content.md first.
- Very specific: line 171
Read references/scenario_c_apply_template.md first.
- Common: line 179
Run the validation pipeline, then the hard gate-check:
- Common: line 189
Run after every write operation.
- Common: line 197
If XSD fails, auto-repair and retry:
- Common: line 203
If XSD still fails, fall back to business rules + preview:
- Very specific: line 227
Direct format contamination: When copying content from a source document, inline rPr (fonts, color) and pPr (borders, shading, spacing) …
- Very specific: line 233
Heading styles MUST have OutlineLevel: When defining heading styles (Heading1, ThesisH1, etc.), always include new OutlineLevel { Val = N } …
- Very specific: line 235
Multi-template merge: When given multiple template files (font, heading, breaks), read references/scenario_c_apply_template.md section …
- Very specific: line 238
NEVER insert empty/blank paragraphs as padding or section separators.
- Common: line 244
Use C-2 Base-Replace: copy the TEMPLATE as output base, then replace body content.
- Common: line 245
NEVER recreate headers/footers from scratch — copy template header/footer XML byte-for-byte.
- Common: line 246
NEVER add formatting (borders, alignment, font size) not present in the template header XML.
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
minimax-docx
Create, edit, and format DOCX documents via CLI tools or direct C# scripts built on OpenXML SDK (.NET).
Fallback: pandoc for simple conversions
When .NET SDK is unavailable or env_check fails with NOT READY, and the task is a simple Markdown → DOCX conversion (no complex formatting, tables, or template requirements):
pandoc input.md -o output.docxThis covers basic reports, letters, and plain documents with headings, paragraphs, lists, and bold/italic text. Limitations: no custom styles, no headers/footers, no complex tables, no images embedded from relative paths.
Fallback decision rule:
- Simple text report from Markdown → pandoc (5 seconds, no deps)
- Needs styling, tables, headers, images, or template matching → must install .NET first (
bash scripts/setup.sh --minimal)
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.)
⚠️ Fallback: pandoc when .NET is unavailable
If env_check.sh reports [FAIL] dotnet and you cannot install .NET SDK, use pandoc as a simple fallback for basic Markdown-to-DOCX conversion:
pandoc input.md -o output.docxThis works for plain text + headings + basic formatting. It will NOT handle custom styles, complex tables, headers/footers, images, or professional formatting — for those, .NET + OpenXML is required. But for quick report/thesis drafts, pandoc is sufficient.
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.mdIf 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/*.csfirst.
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.mdand the relevantSamples/*.cs.
Available CLI edit subcommands:
replace-text --find "X" --replace "Y"fill-placeholders --data '{"key":"value"}'fill-table --data table.jsoninsert-section,remove-section,update-header-footer
$CLI edit replace-text --input in.docx --output out.docx --find "OLD" --replace "NEW"
$CLI edit fill-placeholders --input in.docx --output out.docx --data '{"name":"John"}'Then run the validation pipeline. Also run diff to verify minimal changes:
$CLI diff --before in.docx --after out.docxScenario C: Apply Template
Read references/scenario_c_apply_template.md first. Preview and analyze both source and template.
$CLI apply-template --input source.docx --template template.docx --output out.docxFor complex template operations (multi-template merge, per-section headers/footers, style merging), write C# directly — see Critical Rules below for required patterns.
Run the validation pipeline, then the hard gate-check:
$CLI validate --input out.docx --gate-check assets/xsd/business-rules.xsdGate-check is a hard requirement. Do NOT deliver until it passes. If it fails: diagnose, fix, re-run.
Also diff to verify content preservation: $CLI diff --before source.docx --after out.docx
Validation pipeline
Run after every write operation. For Scenario C the full pipeline is mandatory; for A/B it is recommended (skip only if the operation was trivially simple).
$CLI merge-runs --input doc.docx # 1. consolidate runs
$CLI validate --input doc.docx --xsd assets/xsd/wml-subset.xsd # 2. XSD structure
$CLI validate --input doc.docx --business # 3. business rulesIf XSD fails, auto-repair and retry:
$CLI fix-order --input doc.docx
$CLI validate --input doc.docx --xsd assets/xsd/wml-subset.xsdIf XSD still fails, fall back to business rules + preview:
$CLI validate --input doc.docx --business
scripts/docx_preview.sh doc.docx
# Verify: font contamination=0, table count correct, drawing count correct, sectPr count correctFinal preview: scripts/docx_preview.sh doc.docx
Critical rules
These prevent file corruption — OpenXML is strict about element ordering.
Element order (properties always first):
| Parent | Order |
w:p | pPr → runs |
w:r | rPr → t/br/tab |
w:tbl | tblPr → tblGrid → tr |
w:tr | trPr → tc |
w:tc | tcPr → p (min 1 <w:p/>) |
w:body | block content → sectPr (LAST child) |
Direct format contamination: When copying content from a source document, inline rPr (fonts, color) and pPr (borders, shading, spacing) override template styles. Always strip direct formatting — keep only pStyle reference and t text. Clean tables too (including pPr/rPr inside cells).
Track changes: <w:del> uses <w:delText>, never <w:t>. <w:ins> uses <w:t>, never <w:delText>.
Font size: w:sz = points × 2 (12pt → sz="24"). Margins/spacing in DXA (1 inch = 1440, 1cm ≈ 567).
Heading styles MUST have OutlineLevel: When defining heading styles (Heading1, ThesisH1, etc.), always include new OutlineLevel { Val = N } in StyleParagraphProperties (H1→0, H2→1, H3→2). Without this, Word sees them as plain styled text — TOC and navigation pane won't work.
Multi-template merge: When given multiple template files (font, heading, breaks), read references/scenario_c_apply_template.md section "Multi-Template Merge" FIRST. Key rules:
- Merge styles from all templates into one styles.xml. Structure (sections/breaks) comes from the breaks template.
- Each content paragraph must appear exactly ONCE — never duplicate when inserting section breaks.
- NEVER insert empty/blank paragraphs as padding or section separators. Output paragraph count must equal input. Use section break properties (
w:sectPrinsidew:pPr) and style spacing (w:spacingbefore/after) for visual separation. - Insert oddPage section breaks before EVERY chapter heading, not just the first. Even if a chapter has dual-column content, it MUST start with oddPage; use a second continuous break after the heading for column switching.
- Dual-column chapters need THREE section breaks: (1) oddPage in preceding para's pPr, (2) continuous+cols=2 in the chapter HEADING's pPr, (3) continuous+cols=1 in the last body para's pPr to revert.
- Copy
titlePgsettings from the breaks template for EACH section. Abstract and TOC sections typically needtitlePg=true.
Multi-section headers/footers: Templates with 10+ sections (e.g., Chinese thesis) have DIFFERENT headers/footers per section (Roman vs Arabic page numbers, different header text per zone). Rules:
- Use C-2 Base-Replace: copy the TEMPLATE as output base, then replace body content. This preserves all sections, headers, footers, and titlePg settings automatically.
- NEVER recreate headers/footers from scratch — copy template header/footer XML byte-for-byte.
- NEVER add formatting (borders, alignment, font size) not present in the template header XML.
- Non-cover sections MUST have header/footer XML files (at least empty header + page number footer).
- See
references/scenario_c_apply_template.mdsection "Multi-Section Header/Footer Transfer".
References
Load as needed — don't load all at once. Pick the most relevant files for the task.
The C# samples and design references below are the project's knowledge base ("encyclopedia"). When writing OpenXML code, ALWAYS read the relevant sample file first — it contains compilable, SDK-version-verified patterns that prevent common errors. When making aesthetic decisions, read the design principles and recipe files — they encode tested, harmonious parameter sets from authoritative sources (IEEE, ACM, APA, Nature, etc.), not guesses.
Scenario guides (read first for each pipeline)
| File | When |
references/scenario_a_create.md | Pipeline A: creating from scratch |
references/scenario_b_edit_content.md | Pipeline B: editing existing content |
references/scenario_c_apply_template.md | Pipeline C: applying template formatting |
C# code samples (compilable, heavily commented — read when writing code)
| File | Topic |
Samples/DocumentCreationSamples.cs | Document lifecycle: create, open, save, streams, doc defaults, settings, properties, page setup, multi-section |
Samples/StyleSystemSamples.cs | Styles: Normal/Heading chain, character/table/list styles, DocDefaults, latentStyles, CJK 公文, APA 7th, import, resolve inheritance |
Samples/CharacterFormattingSamples.cs | RunProperties: fonts, size, bold/italic, all underlines, color, highlight, strike, sub/super, caps, spacing, shading, border, emphasis marks |
Samples/ParagraphFormattingSamples.cs | ParagraphProperties: justification, indentation, line/paragraph spacing, keep/widow, outline level, borders, tabs, numbering, bidi, frame |
Samples/TableSamples.cs | Tables: borders, grid, cell props, margins, row height, header repeat, merge (H+V), nested, floating, three-line 三线表, zebra striping |
Samples/HeaderFooterSamples.cs | Headers/footers: page numbers, "Page X of Y", first/even/odd, logo image, table layout, 公文 "-X-", per-section |
Samples/ImageSamples.cs | Images: inline, floating, text wrapping, border, alt text, in header/table, replace, SVG fallback, dimension calc |
Samples/ListAndNumberingSamples.cs | Numbering: bullets, multi-level decimal, custom symbols, outline→headings, legal, Chinese 一/(一)/1./(1), restart/continue |
Samples/FieldAndTocSamples.cs | Fields: TOC, SimpleField vs complex field, DATE/PAGE/REF/SEQ/MERGEFIELD/IF/STYLEREF, TOC styles |
Samples/FootnoteAndCommentSamples.cs | Footnotes, endnotes, comments (4-file system), bookmarks, hyperlinks (internal + external) |
Samples/TrackChangesSamples.cs | Revisions: insertions (w:t), deletions (w:delText!), formatting changes, accept/reject all, move tracking |
Samples/AestheticRecipeSamples.cs | 13 aesthetic recipes from authoritative sources: ModernCorporate, AcademicThesis, ExecutiveBrief, ChineseGovernment (GB/T 9704), MinimalModern, IEEE Conference, ACM sigconf, APA 7th, MLA 9th, Chicago/Turabian, Springer LNCS, Nature, HBR — each with exact values from official style guides |
Note: Samples/ path is relative to scripts/dotnet/MiniMaxAIDocx.Core/.
Markdown references (read when you need specifications or design rules)
| File | When |
references/openxml_element_order.md | XML element ordering rules (prevents corruption) |
references/openxml_units.md | Unit conversion: DXA, EMU, half-points, eighth-points |
references/openxml_encyclopedia_part1.md | Detailed C# encyclopedia: document creation, styles, character & paragraph formatting |
references/openxml_encyclopedia_part2.md | Detailed C# encyclopedia: page setup, tables, headers/footers, sections, doc properties |
references/openxml_encyclopedia_part3.md | Detailed C# encyclopedia: TOC, footnotes, fields, track changes, comments, images, math, numbering, protection |
references/typography_guide.md | Font pairing, sizes, spacing, page layout, table design, color schemes |
references/cjk_typography.md | CJK fonts, 字号 sizes, RunFonts mapping, GB/T 9704 公文 standard |
references/cjk_university_template_guide.md | Chinese university thesis templates: numeric styleIds (1/2/3 vs Heading1), document zone structure (cover→abstract→TOC→body→references), font expectations, common mistakes |
references/design_principles.md | Aesthetic foundations: 6 design principles (white space, contrast/scale, proximity, alignment, repetition, hierarchy) — teaches WHY, not just WHAT |
references/design_good_bad_examples.md | Good vs Bad comparisons: 10 categories of typography mistakes with OpenXML values, ASCII mockups, and fixes |
references/track_changes_guide.md | Revision marks deep dive |
references/troubleshooting.md | Symptom-driven fixes: 13 common problems indexed by what you SEE (headings wrong, images missing, TOC broken, etc.) — search by symptom, find the fix |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

