agentleFS
ZCodium-projectZCodium-project/ZCodium/.agents/skills/docx/SKILL.md

docx

Skill247 starsChanged 10 days agoMITView on GitHub

Unified DOCX skill — create, template-apply, edit/fill, read, repair, and compare Word documents. Use for formal Word deliverables and DOCX diagnosis. Not for PDF/PPT or casual plain-text drafting.

  • Pipes a download into a shell

We split this skill into the rules it gives an agent

7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 189 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the read gate fails, the skill cannot load at all.

    line 79
  2. Very specific:

    Run before READ_RENDERED routes.

    line 83
  3. Distinctive:

    If the render gate fails, stop and report.

    line 92
  4. Very specific:

    Run before CREATE_DOCX, APPLY_TEMPLATE, EDIT_FILL_DOCX, REPAIR_LAYOUT routes.

    line 96
  5. Distinctive:

    If the full gate fails, stop and report.

    line 106
  6. Very specific:

    Never invoke a .sh script through git-bash on Windows — setup.sh will refuse to install anything on MINGW*/MSYS*/CYGWIN* and tell you to …

    line 141
  7. Very specific:

    Use these after CREATE_DOCX / APPLY_TEMPLATE is selected:

    line 232

“Common” is measured: kept by at least 6 in 10 of the 189 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Copied from MiniMaxAI/minimax-code (packages/local-runtime/assets/skills/docx) at revision 564e9166d81f87b0b767b005e4779d4697b512be. Copyright (c) 2026 MiniMax Code. Licensed under MIT. Modified by ZCode: added the provenance notice; added a ZCodium capability-matrix section (read / render / full and what each level needs), and documented that setup.sh is report-only unless --install-dotnet is passed. Skill instructions are otherwise unchanged. See THIRD-PARTY-NOTICES.md in the repository root for license and provenance. -->

docx

Replace <skill_dir> with the actual skill path shown by the loader.

Unified DOCX skill. SKILL.md is the dispatch layer. Pick the route that matches the user’s intent, read that route guide, then go straight into execution. Do not front-load every task with the full evidence/backend/acceptance waterfall.

Environment gates

The env gate ships in two equivalent dialects so the skill works on macOS, Linux/WSL, and Windows without any cygwin/git-bash hack:

PlatformSetupEnv check
macOS / Linux / WSLbash <skill_dir>/scripts/setup.shbash <skill_dir>/scripts/env_check.sh --level <lvl>
Windows (PowerShell 5.1+)powershell -ExecutionPolicy Bypass -File <skill_dir>\scripts\setup.ps1powershell -ExecutionPolicy Bypass -File <skill_dir>\scripts\env_check.ps1 -Level <lvl>

Both dialects accept the same three levels (read | render | full, default full) and produce the same [OK] / [FAIL] / Status: READY|NOT READY lines, so a route may be gated on either one.

The skill loader runs only the read gate at load time, so missing dotnet/soffice does not block read-only routes.

Read gate

Checked at skill load time (automatic). Applies to: READ_CONTENT, READ_STRUCTURE, COMPARE_TWO_DOCX.

# macOS / Linux / WSL
bash <skill_dir>/scripts/env_check.sh --level read

# Windows
powershell -ExecutionPolicy Bypass -File <skill_dir>\scripts\env_check.ps1 -Level Read

Requires: python3 (or python launcher on Windows), unzip (or tar.exe on Windows 10+), UTF-8 console.

If the read gate fails, the skill cannot load at all.

Render gate

Run before READ_RENDERED routes. Includes all read-level checks plus:

bash <skill_dir>/scripts/env_check.sh --level render                                # *nix
powershell -ExecutionPolicy Bypass -File <skill_dir>\scripts\env_check.ps1 -Level Render   # Windows

Requires (in addition to read): soffice / soffice.exe, pdftoppm (or pdftocairo).

If the render gate fails, stop and report. Do not silently fall back to structure-only reads.

Full gate

Run before CREATE_DOCX, APPLY_TEMPLATE, EDIT_FILL_DOCX, REPAIR_LAYOUT routes.

bash <skill_dir>/scripts/env_check.sh --level full                                  # *nix
powershell -ExecutionPolicy Bypass -File <skill_dir>\scripts\env_check.ps1 -Level Full     # Windows

Requires (in addition to render): dotnet >= 9, pandoc, zip (or Compress-Archive on Windows), dotnet project built.

If the full gate fails, stop and report. Do not attempt generation with missing dependencies.

Capability matrix in ZCodium

The levels above assume a machine where the skill may install its own toolchain. In ZCodium the repo skills must not silently change the host, so scripts/setup.sh is report-only unless you opt in. Check the level you actually need before promising a deliverable:

LevelNeedsWithout it
readpython3 (+ pdftoppm for page images)—
renderread + soffice / pandocno PDF/PNG preview of the result
fullrender + dotnet >= 9 + zipcreation, template application, validation and track-changes editing are unavailable — say so instead of guessing

.NET is a global SDK and the upstream installer fetched it with curl | sh, so this fork makes it opt-in: run bash scripts/setup.sh --install-dotnet (writes ~/.dotnet, no sudo) only after the user agrees. The setup script never edits ~/.zprofile / ~/.zshrc and never installs global npm packages; it prints the lines the user may want to add themselves.

On an air-gapped or intranet host the curl | sh and package-manager paths cannot work at all. Plan for read / render and use the full gate only where a pre-provisioned SDK exists.

Cross-platform path & temp-dir convention

Examples in docs/ and references/ are written for *nix shells. When you execute on Windows, do these substitutions consistently:

In the exampleWindows substitute
<skill_dir>/scripts/foo.sh<skill_dir>\scripts\foo.ps1 (every .sh has a .ps1 peer)
python3 <skill_dir>/scripts/foo.pypython <skill_dir>\scripts\foo.py (the .py files are cross-platform)
/tmp/docx-<thing>$env:TEMP\docx-<thing>
bash <skill_dir>/scripts/setup.shpowershell -ExecutionPolicy Bypass -File <skill_dir>\scripts\setup.ps1
forward slashes in pathsbackslashes; quote any path containing spaces

Never invoke a .sh script through git-bash on Windows — setup.sh will refuse to install anything on MINGW*/MSYS*/CYGWIN* and tell you to switch to powershell.exe / pwsh.exe.

Operational rules — read before doing anything

1. Dispatch by user intent, not by backend.

Start with the shortest route choice:

  • creating a new formal Word deliverable -> CREATE_DOCX
  • preserving content but changing template / institutional style -> APPLY_TEMPLATE
  • editing an existing DOCX in place -> EDIT_FILL_DOCX
  • reading text / structure / rendered pages -> matching read route
  • fixing visible defects -> REPAIR_LAYOUT
  • comparing two DOCX files -> COMPARE_TWO_DOCX

Read docs/router.md only to settle the route. Do not read docs/evidence.md, docs/backends.md, and docs/acceptance.md before route selection.

2. For generation routes, choose style family / recipe before backend.

The old benchmarked generation core stays in this skill. For CREATE_DOCX and APPLY_TEMPLATE, the first substantive decision is the visual system, not the backend. Reuse these files as the generation core:

  • references/typography_guide.md
  • references/design_principles.md
  • references/cjk_typography.md
  • scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples*.cs

These are not optional decoration. They are the quality-preserving recipe layer.

3. Backend comes after route + recipe.

  • D is the default write backend for formal DOCX creation, template application, and most edits.
  • S is only for OpenXML graph work beyond the builtin CLI surface.
  • X is only for deterministic local XML patch / inspection work.
  • Formal CREATE_DOCX is never routed to pandoc as a generation backend.
  • If a chosen backend gate fails, stop and report it. Do not silently switch.

4. Rendered acceptance is a post-write gate, not a pre-dispatch hop.

For template, layout, TOC, multi-section, header/footer, and page-number work, finish the write first, then run rendered acceptance from docs/acceptance.md / docs/rendered-delivery.md.

5. Keep DOCX execution inside this skill.

Do not bounce rendered diagnosis to another skill. Do not treat raw XML string replace as a valid editing strategy. Do not use readlink, $0, or shell path tricks in skill docs; use <skill_dir> only.

6. DOCX→PDF is native to this skill. If the user asks to convert an existing Word/DOCX document to PDF while preserving layout, do it here via python3 <skill_dir>/scripts/docx_to_pdf.py (or soffice --headless --convert-to pdf as fallback), then verify the PDF. Do not route DOCX→Markdown/HTML→PDF for a preservation task: DOCX already carries page geometry, sections, headers/footers, fields, numbering, and table layout. HTML/PDF belongs to redesign/recomposition after native render fails or when explicitly requested.

Routes — pick one, then read that guide

WRITE / GENERATE a DOCX

IntentGuideWhat happens next
CREATE_DOCX — author a new report / proposal / contract / memo / thesis / 公文docs/task-create.mdnormalize source -> choose recipe family -> choose D/S -> write -> acceptance
APPLY_TEMPLATE — preserve content but move into a template / institutional visual systemdocs/task-apply-template.mdchoose template mode -> align recipe family -> read only the needed structure -> choose D/S -> write -> strict rendered acceptance
EDIT_FILL_DOCX — mutate content in an existing DOCX while keeping it the same documentdocs/task-edit-fill.mdchoose edit mode -> choose X/D/S -> mutate -> acceptance

READ / DIAGNOSE / REPAIR a DOCX

IntentGuidePrimary truth
READ_CONTENT — summarize / quote / retrieve textdocs/task-read-content.mdcontent
READ_STRUCTURE — inspect styles / sections / numbering / TOC / comments / revisionsdocs/task-read-structure.mdstructure
READ_RENDERED — inspect what the pages actually look likedocs/task-read-rendered.mdrendered + structure
REPAIR_LAYOUT — fix page-level defectsdocs/task-repair-layout.mdrendered -> structure -> rendered
COMPARE_TWO_DOCX — explain before/after or source/template differencesdocs/task-compare-two-docx.mdcontent + structure + rendered

Deep docs — only after the route is clear

FileUse when
docs/router.mdsettle route choice
docs/evidence.mdthe selected route needs truth-source clarification
docs/backends.mdthe selected route needs backend arbitration
docs/acceptance.mdyou are ready to validate deliverables
docs/rendered-delivery.mdrendered issue report shape is required

Generation core references

Use these after CREATE_DOCX / APPLY_TEMPLATE is selected:

FileRole
references/scenario_a_create.mdcreate-from-scratch mechanics
references/scenario_c_apply_template.mdtemplate transfer and multi-section rules
references/typography_guide.mdfont pairings, sizes, spacing, page layout, table rules
references/design_principles.mdvisual judgment rules when exact specs are missing
references/cjk_typography.mdCJK fonts, 字号, mixed-script rules, 公文 defaults
scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples*.csbenchmarked recipe families; choose one instead of inventing values

Runtime shorthands

# macOS / Linux / WSL
CLI="dotnet run --project <skill_dir>/scripts/dotnet/MiniMaxAIDocx.Cli --"
TMPDIR_DOCX="${TMPDIR:-/tmp}"
# Windows PowerShell
$CLI = "dotnet run --project <skill_dir>\scripts\dotnet\MiniMaxAIDocx.Cli --"
$TmpDocx = $env:TEMP

Common commands (substitute $TMPDIR_DOCX / $TmpDocx for the literal /tmp examples elsewhere in docs/):

$CLI analyze --input in.docx --json
$CLI diff --before before.docx --after after.docx
$CLI merge-runs --input out.docx
$CLI validate --input out.docx --xsd <skill_dir>/assets/xsd/wml-subset.xsd
$CLI validate --input out.docx --business
$CLI validate --input out.docx --gate-check <skill_dir>/assets/xsd/business-rules.xsd
python3 <skill_dir>/scripts/docx_to_pdf.py --input in.docx --output "$TMPDIR_DOCX/docx-render.pdf"
python3 <skill_dir>/scripts/render_docx_pages.py in.docx --output-dir "$TMPDIR_DOCX/docx-pages"

On Windows substitute python3 -> python, / -> \, and $TMPDIR_DOCX -> $env:TEMP. The underlying .py scripts use tempfile.TemporaryDirectory and Path(...).expanduser().resolve() so they do not care which slash style you pass in.

Structural non-negotiables

  • w:p = pPr -> runs
  • w:r = rPr -> text-like children
  • w:tbl = tblPr -> tblGrid -> rows
  • w:body ends with sectPr
  • heading styles need OutlineLevel
  • direct formatting contamination must be stripped unless explicitly preserved
  • template and multi-section work must preserve section graph, titlePg, and per-section headers/footers

Out of scope

  • PDF / PPT deliverables -> use pdf / pptx
  • casual plain-text drafting with no DOCX output
  • pretending a Word-authored DOCX can be safely round-tripped through pandoc for formal output

Download now (ZIP)

  • Other versions194 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 194

    1. anthropics/skills★ 186ksame name
    2. spinabot/brigade★ 11ksame name
    3. netease-youdao/LobsterAI★ 6.2ksame name
    4. OpenBMB/PilotDeck★ 4.9ksame name
    5. nextlevelbuilder/goclaw★ 3.7ksame name
    6. jjyaoao/HelloAgents★ 3.2ksame name
    7. anthropics/claude-agent-sdk-demos★ 2.8ksame name
    8. K-Dense-AI/claude-scientific-writer★ 2.4ksame name
    9. OpenCoworkAI/open-cowork★ 2.2ksame name
    10. ChenglinPoly/infiAgent★ 1.2ksame name

    184 more not listed

    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.

  • Used alongsideProjects with it also use gift-evaluator, Podcast Generate and 10 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.
    • dav-niu474Skill

      gift-evaluator

      The PRIMARY tool for Spring Festival gift analysis and social interaction generation. Use this skill when users upload photos of gifts (alcohol, tea, supplements, etc.) to inquire about their value, authenticity, or how to respond socially. Integrates visual perception, market valuation, and HTML card generation.

      Also in 5 projects that use this

    • dav-niu474Skill

      Podcast Generate

      Generate podcast episodes from user-provided content or by searching the web for specified topics. If user uploads a text file/article, creates a dual-host dialogue podcast (or single-host upon request). If no content is provided, searches the web for information about the user-specified topic and generates a podcast. Duration scales with content size (3-20 minutes, ~240 chars/min). Uses z-ai-web-dev-sdk for LLM script generation and TTS audio synthesis. Outputs both a podcast script (Markdown) and a complete audio file (WAV).

      Also in 5 projects that use this

    • huang-x-hSkill

      Video Generation

      Implement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or images, create video content programmatically, or build applications that produce video outputs. Supports asynchronous task management with status polling and result retrieval.

      Also in 6 projects that use this

    • huang-x-hSkill

      VLM

      Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images, describe visual content, or create applications that combine image understanding with conversational AI. Supports image URLs and base64 encoded images for multimodal interactions.

      Also in 6 projects that use this

    • SeifBenayedSkill

      file-reading

      Use this skill when a file has been uploaded but its content is NOT in your context — only its path at /mnt/user-data/uploads/ is listed in an uploaded_files block. This skill is a router: it tells you which tool to use for each file type (pdf, docx, xlsx, csv, json, images, archives, ebooks) so you read the right amount the right way instead of blindly running cat on a binary. Triggers: any mention of /mnt/user-data/uploads/, an uploaded_files section, a file_path tag, or a user asking about an uploaded file you have not yet read. Do NOT use this skill if the file content is already visible in your context inside a documents block — you already have it.

      Also in 5 projects that use this

    • SeifBenayedSkill

      pdf-reading

      Use this skill when you need to read, inspect, or extract content from PDF files — especially when file content is NOT in your context and you need to read it from disk. Covers content inventory, text extraction, page rasterization for visual inspection, embedded image/attachment/table/form-field extraction, and choosing the right reading strategy for different document types (text-heavy, scanned, slide-decks, forms, data-heavy). Do NOT use this skill for PDF creation, form filling, merging, splitting, watermarking, or encryption — use the pdf skill instead.

      Also in 6 projects that use this

    • +1 more from huang-x-h
    • +5 more from dav-niu474
  • In this repository14 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.