docx

docx is a skill for Claude Code, Codex from MrSGSA/math-modeling-skill-dify. It costs 36 tokens per session (1,741 once invoked), scanned A, original, MIT.

A document tool for creating, editing, checking, and converting Microsoft Word DOCX files. It includes support for mathematical formulas, three-line tables, revisions, and comments.

In plain words
What is it for?
Use it for mathematical modelling papers, formula replacement, formatted tables, and DOCX validation or conversion.
Why use it?
It helps produce Word documents with consistent formatting and native Word formulas while checking the resulting file for structural problems.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mrsgsa/math-modeling-skill-dify/docx
Any agent
npx skills add MrSGSA/math-modeling-skill-dify --skill docx
Clone the repo
git clone --depth 1 https://github.com/MrSGSA/math-modeling-skill-dify

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docx

README.md
[![agentmods](https://agentmods.dev/badge/skills/mrsgsa/math-modeling-skill-dify/docx.svg)](https://agentmods.dev/skills/mrsgsa/math-modeling-skill-dify/docx)
Your own site
<a href="https://agentmods.dev/skills/mrsgsa/math-modeling-skill-dify/docx"><img src="https://agentmods.dev/badge/skills/mrsgsa/math-modeling-skill-dify/docx.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,741 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.01741
Opus 5 $0.00018 $0.00870
Sonnet 5 $0.00007 $0.00348
Haiku 4.5 $0.00004 $0.00174

Measured 5d ago against content hash 35d65a401e08, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

docx scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

The scan reads SKILL.md. This mod also ships 18 executable files (scripts/__init__.py, scripts/accept_changes.py, scripts/check_env.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/math-modeling/tools/docx/SKILL.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DOCX 工具

许可:专有;完整条款见 LICENSE.txt

路径与写入

  • 当前目录为本工具根目录,只读。
  • 模板和脚本从本目录读取。
  • 生成或修改后的 DOCX 必须写入用户 PROJECT_ROOT
  • 默认不覆盖输入文件或 Skill 文件。

数学建模论文推荐流程

采用“当届官方参考模板 + python-docx 构建 + OMML 公式 + OOXML 校验 + 渲染抽检”。官方模板控制页面、样式、分节、页眉页脚和编号;代码负责稳定写入内容。

from pathlib import Path
import sys

scripts = Path("<SKILL_ROOT>") / "tools" / "docx" / "scripts"
sys.path.insert(0, str(scripts))
import paper_format as pf

doc = pf.new_document(
    contest="cumcm",
    template_path=Path("<PROJECT_ROOT>") / "当届官方模板.docx",
    preserve_template_content=False,
)
# 此示例只借用模板样式后追加正文。
# 若官方模板包含固定摘要页或编号页,应改为 True 并在原位置填充。
pf.title(doc, "论文题目")
pf.abstract_title(doc)
pf.body(doc, "摘要正文。")
pf.keywords(doc, "优化;预测")
pf.equation(doc, r"\min f(x)=\sum_{i=1}^{n}x_i^2")
pf.three_line_table(doc, [["符号", "说明"], ["x", "决策变量"]])
pf.save_document(doc, Path("<PROJECT_ROOT>"), filename="论文候选稿.docx", contest="cumcm")

公式

直接写入

scripts/equations.py 把常用 LaTeX 子集转成 Word 原生 OMML。未知命令、未闭合分组和不支持环境会报错,不会静默生成错误文本。

python scripts/equations.py replace "输入.docx" `
  --replace "EQ_OBJECTIVE" "\min f(x)=\sum_{i=1}^{n}x_i^2" `
  --output "<PROJECT_ROOT>/输出.docx"

同一占位符出现多次时会全部替换。支持分式、上下标、根式、n 次根、常用希腊字母与关系符号、反三角函数和常见矩阵,包括 \nu\mu\approx\arcsin\arccos\arctan

复杂公式

复杂 LaTeX 优先使用 Pandoc 的成熟转换:

python scripts/equations.py generate "论文.md" `
  --output "<PROJECT_ROOT>/论文.docx" `
  --template "官方模板.docx"

转换后仍须校验和渲染抽检。

解包、校验与重打包

DOCX/XLSX 共用的 OOXML 基础工具只保留在 scripts/office/

python scripts/office/unpack.py "输入.docx" "<PROJECT_ROOT>/unpacked"
python scripts/office/validate.py "<PROJECT_ROOT>/输出.docx"
python scripts/office/pack.py "<PROJECT_ROOT>/unpacked" "<PROJECT_ROOT>/输出.docx" --original "输入.docx"

不要在不理解 OOXML 关系和内容类型的情况下直接修改压缩包。

修订

python scripts/accept_changes.py "输入.docx" "<PROJECT_ROOT>/已接受修订.docx"

工具使用隔离的 LibreOffice 配置。超时、非零退出或残留修订标记都会失败,失败时不发布输出文件。

批注

先解包,再添加批注元数据和文档标记。父批注不存在或批注 ID 重复时,工具会在写入前失败。

Read the full file on GitHub · 127 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 127 lines · 36 tokens per session scan A 35d65a401e08

Subscribe to this mod's changes

docx is a skill published in the GitHub repository MrSGSA/math-modeling-skill-dify (4 stars, last pushed 1mo ago), licensed MIT. It adds 36 tokens to every session and 1,741 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

markdown-exporter

Convert Markdown text to DOCX, PPTX, XLSX, PDF, PNG, SVG, HTML, IPYNB, MD, CSV, JSON, JSONL, XML files, and extract code blocks in Markdown to Python, Bash,JS and etc files.

bowenliang123/markdown-exporter · 57 tokens

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when…

apconw/Aix-DB · 168 tokens

xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or…

apconw/Aix-DB · 201 tokens

pptx

Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying…

apconw/Aix-DB · 152 tokens

pdf

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

apconw/Aix-DB · 50 tokens

mineru

PDF / 图片 / 网页高质量解析为 Markdown。三种部署形态全部免费:本地 CLI(开源)、 云 API(注册免费 token + 配额,超额才付费)、网页 flash(零注册,单文件 ≤10MB / ≤20页)。 在中文学术 PDF / 表格 / 公式上识别质量显著高于 pdfplumber。.

woodfishhhh/EZ_math_model · 86 tokens