DOCX Skill
Create Word-compatible .docx documents from structured content.
Routes
| Tool |
When to use |
docx.create |
Create a new .docx with a title, headings, and paragraphs |
Decision Rules
- Use
docx.create whenever the user wants a Word document, report, letter, or article as a .docx file.
- For rich formatting (tables, images, footnotes), the current tool covers basic structure. Advise the user to open in Word to add advanced formatting.
- Output path must be under
/tmp/ or <project-root>/data/docx/.
Path Constraints
outputPath must be under:
/tmp/ — for ephemeral files
<project-root>/data/docx/ — for persistent files
Examples
Create a simple report
{
"tool": "docx.create",
"params": {
"outputPath": "/tmp/report-2026.docx",
"title": "Q1 Sales Report",
"sections": [
{
"heading": "Executive Summary",
"paragraphs": [
"Q1 revenue reached $88,000 across both regions, exceeding the $80,000 target.",
"North region led with $50,000; South followed with $38,000."
]
},
{
"heading": "Recommendations",
"paragraphs": [
"Invest in South region marketing to close the gap.",
"Maintain North region momentum with Q2 incentives."
]
}
]
}
}
Error Handling
| Error message |
Cause |
Fix |
outputPath must be under /tmp/... |
Path outside allowed dirs |
Use /tmp/ or /data/docx/ |
title is required |
Missing required param |
Always include a title |
Each section must have at least one paragraph |
Empty paragraphs array |
Add at least one paragraph string |
sections array is required |
No sections provided |
Provide at least one section |
Output
Returns {path, sizeBytes} on success. The file is a valid .docx that can be opened in:
- Microsoft Word (Windows, macOS)
- Google Docs (upload)
- LibreOffice Writer
- Any OOXML-compatible application
1---2name: docx3description: Microsoft Word (.docx) document creation using the docx npm package4version: 1.0.05libs: docx@9.5.06metadata:7 source: https://skillmd.com/skills/matrixx0070/docx8---910# DOCX Skill1112Create Word-compatible `.docx` documents from structured content.1314## Routes1516| Tool | When to use |17|------|-------------|18| `docx.create` | Create a new .docx with a title, headings, and paragraphs |1920## Decision Rules21221. Use `docx.create` whenever the user wants a Word document, report, letter, or article as a .docx file.232. For rich formatting (tables, images, footnotes), the current tool covers basic structure. Advise the user to open in Word to add advanced formatting.243. Output path must be under `/tmp/` or `<project-root>/data/docx/`.2526## Path Constraints2728`outputPath` must be under:29- `/tmp/` — for ephemeral files30- `<project-root>/data/docx/` — for persistent files3132## Examples3334### Create a simple report35```json36{37 "tool": "docx.create",38 "params": {39 "outputPath": "/tmp/report-2026.docx",40 "title": "Q1 Sales Report",41 "sections": [42 {43 "heading": "Executive Summary",44 "paragraphs": [45 "Q1 revenue reached $88,000 across both regions, exceeding the $80,000 target.",46 "North region led with $50,000; South followed with $38,000."47 ]48 },49 {50 "heading": "Recommendations",51 "paragraphs": [52 "Invest in South region marketing to close the gap.",53 "Maintain North region momentum with Q2 incentives."54 ]55 }56 ]57 }58}59```6061## Error Handling6263| Error message | Cause | Fix |64|---------------|-------|-----|65| `outputPath must be under /tmp/...` | Path outside allowed dirs | Use /tmp/ or <project-root>/data/docx/ |66| `title is required` | Missing required param | Always include a title |67| `Each section must have at least one paragraph` | Empty paragraphs array | Add at least one paragraph string |68| `sections array is required` | No sections provided | Provide at least one section |6970## Output7172Returns `{path, sizeBytes}` on success. The file is a valid `.docx` that can be opened in:73- Microsoft Word (Windows, macOS)74- Google Docs (upload)75- LibreOffice Writer76- Any OOXML-compatible application