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 package4---56# DOCX Skill78Create Word-compatible `.docx` documents from structured content.910## Routes1112| Tool | When to use |13|------|-------------|14| `docx.create` | Create a new .docx with a title, headings, and paragraphs |1516## Decision Rules17181. Use `docx.create` whenever the user wants a Word document, report, letter, or article as a .docx file.192. For rich formatting (tables, images, footnotes), the current tool covers basic structure. Advise the user to open in Word to add advanced formatting.203. Output path must be under `/tmp/` or `<project-root>/data/docx/`.2122## Path Constraints2324`outputPath` must be under:25- `/tmp/` — for ephemeral files26- `<project-root>/data/docx/` — for persistent files2728## Examples2930### Create a simple report31```json32{33 "tool": "docx.create",34 "params": {35 "outputPath": "/tmp/report-2026.docx",36 "title": "Q1 Sales Report",37 "sections": [38 {39 "heading": "Executive Summary",40 "paragraphs": [41 "Q1 revenue reached $88,000 across both regions, exceeding the $80,000 target.",42 "North region led with $50,000; South followed with $38,000."43 ]44 },45 {46 "heading": "Recommendations",47 "paragraphs": [48 "Invest in South region marketing to close the gap.",49 "Maintain North region momentum with Q2 incentives."50 ]51 }52 ]53 }54}55```5657## Error Handling5859| Error message | Cause | Fix |60|---------------|-------|-----|61| `outputPath must be under /tmp/...` | Path outside allowed dirs | Use /tmp/ or <project-root>/data/docx/ |62| `title is required` | Missing required param | Always include a title |63| `Each section must have at least one paragraph` | Empty paragraphs array | Add at least one paragraph string |64| `sections array is required` | No sections provided | Provide at least one section |6566## Output6768Returns `{path, sizeBytes}` on success. The file is a valid `.docx` that can be opened in:69- Microsoft Word (Windows, macOS)70- Google Docs (upload)71- LibreOffice Writer72- Any OOXML-compatible application