Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add MidnightDarling/collate/plugin install collateWrote 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.
[](https://agentmods.dev/skills/midnightdarling/collate/to-docx)<a href="https://agentmods.dev/skills/midnightdarling/collate/to-docx"><img src="https://agentmods.dev/badge/skills/midnightdarling/collate/to-docx.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00217 | $0.01762 |
| Opus 5 | $0.00109 | $0.00881 |
| Sonnet 5 | $0.00043 | $0.00352 |
| Haiku 4.5 | $0.00022 | $0.00176 |
Grade A, and why
to-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 6d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Markdown → Word
Task
把校对定稿的 Markdown 转成一份 .docx,供投稿、学界交流、编辑沟通使用。
输出规范(由 Alice 定义,所有输出一致):
| 元素 | 规范 |
|---|---|
| 正文字体 | 思源宋体 / Source Han Serif |
| 标题字体 | 思源宋体加粗 |
| 正文字号 | 12 pt(小四) |
| 一级标题 | 16 pt(三号) |
| 二级标题 | 14 pt(四号) |
| 段首缩进 | 2 字符 |
| 行距 | 1.2 |
| 字间距 | 0.2 pt |
| 页边距 | 上下左右全部 2 cm |
| 页码 | 底部居中 |
| 脚注 | 连续编号,思源宋体 9 pt |
| 引号 | 中文「""''」 |
Process
Step 1:确认输入
INPUT="<markdown-path>"
test -f "$INPUT" || { echo "文件不存在"; exit 1; }
推荐用校对完的 final.md,不要直接用 raw.md(仍含 OCR 错)。
输出路径约定:输出 docx 固定落在
<workspace>/output/<title>_<author>_<year>_final.docx。脚本优先读_internal/_import_provenance.json,缺失时再回退到meta.json与 Markdown 标题,不用显式指定。权威规范见插件的references/workspace-layout.md。
Step 2:优先尝试 Anthropic 的 docx skill
检查 Claude Code 环境里 anthropic-skills:docx 或 docx skill 是否可用。如可用:
- 读
<input>.md内容 - 按上表规范设置样式参数
- 调 anthropic docx skill 生成含标题层级、段首缩进、字体、页边距的
.docx - 它能给出更精细的 OOXML 控制(真正的分页符、脚注链接、交叉引用)
Step 3:Fallback — 用 bundled 脚本
Anthropic docx skill 不可用时(非 Claude Code 运行时、脱机环境等),跑:
# --output 省略;脚本会根据 workspace 约定把 docx 放到 <ws>/output/<title>_<author>_<year>_final.docx
python3 "${CLAUDE_PLUGIN_ROOT}/skills/to-docx/scripts/md_to_docx.py" \
--input "$INPUT" \
--title-from-first-h1
脚本会打印一行 [md_to_docx] wrote <path>,用这行来拿到实际输出路径(见 Step 7)。若要强制自定义路径,仍可显式 --output <path>——主要给 CI / 回归测试用,日常不要手写。
脚本用 python-docx 实现。支持:
- Markdown 标题 → 对应 Word Heading 样式
- 段首缩进 + 思源宋体 + 1.2 行距 + 0.2 pt 字间距
- 页边距上下左右全部 2 cm
- 中文引号自动规范
- 代码块 → Consolas 等宽
- 图片内嵌(从
assets/读) - 表格 → Word Table
- 脚注
[^1]→ Word 原生脚注
Step 4:题注与图表
Markdown 里的图片:

脚本会:
- 图片居中
- 下方加题注"图 1:乾隆年间北京城图"(10 pt,居中)
- 跟随引用自动连续编号
表格同理:
| 年份 | 事件 |
|------|------|
| 1840 | 鸦片战争 |
*表 1:近代史大事年表*
图表没有题注时不要自己编——留空让用户补。
Step 5:脚注
校对好的 Markdown 里可能用:
这是正文内容[^1]。
[^1]: 这是脚注内容。
脚本把 [^n] 变成 Word 原生脚注(每页底部显示,全文连续编号),不是 inline reference。
What ships with it
3 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.
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.
- 6d ago First seen · 161 lines · 217 tokens per session scan A c19a1ee4e921
to-docx is a skill published in the GitHub repository MidnightDarling/collate (6 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 217 tokens to every session and 1,762 once invoked, about $0.0011 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.
Other skills, from other repositories
honey-px
Read huge read-only text as PNG pages; big input cut.
pdf-conversion
Convert PDF documents to well-structured Markdown files. Use when user asks to convert PDFs, extract text from PDFs, or transform PDF documents to markdown format.
markitdown
Convert files, URLs, and documents to Markdown using the markitdown MCP server. Activate when the user asks to convert, extract, or read content from PDFs, Word docs, PowerPoints, spreadsheets, images, audio files, or any URL.
t-800-knowledge-base
A map of the T-800 plugin's knowledge base, which is the stored documentation used by its maintainers.
pn-financial-model-audit
Audit a financial model (spreadsheet, structured table, or agent-produced model) for hardcoded values, broken formula logic, balance-sheet balance, circular references, and missing cross-checks. Use after any DCF, LBO, comps, or 3-statement model is built before it is used in a deliverable.
pn-create-mcp-architecture
Create MCP.md documenting MCP servers in use, purpose, and integration points. Use when project uses multiple MCPs or needs MCP documentation.