Create, read, edit, and manipulate Microsoft Word documents (.docx files). Use when users ask to work with Word files, create documents, read .docx files, or format text documents.
This skill allows you to work with Microsoft Word documents using Node.js tools.
Invoke this skill when the user:
The Word tool is implemented as a TypeScript script at . You can invoke it using the Bash tool:
src/tools/word-tool.tsts-node src/tools/word-tool.ts read "/path/to/document.docx"
ts-node src/tools/word-tool.ts create "/path/to/new-document.docx" '{"title":"My Document","paragraphs":["First paragraph","Second paragraph"]}'
When creating documents, use this JSON format:
{
"title": "Document Title",
"paragraphs": ["Paragraph 1", "Paragraph 2"],
"headings": [{"text": "Section 1", "level": 1}],
"tables": [{"headers": ["Col1", "Col2"], "rows": [["A", "B"]]}]
}
Uses the docx and mammoth npm libraries for reading and writing Word documents.