| name | office-word |
| description | Read and write Microsoft Word (.docx) files. Use when the user asks to read, analyze, create, or convert Word documents. |
Read a Word file
Converts a .docx to Markdown:
uv run --with python-docx ~/.kiro/skills/office-word/scripts/read_docx.py "<path_to_docx>"
Save as .md file:
uv run --with python-docx ~/.kiro/skills/office-word/scripts/read_docx.py "<path_to_docx>" "<output.md>"
Write a Word file
Preferred: Directly from markdown content (no intermediate file)
Pipe markdown content directly into the script using --stdin:
echo '<markdown_content>' | uv run --with python-docx ~/.kiro/skills/office-word/scripts/write_docx.py --stdin "<output.docx>"
For multi-line content, use a heredoc:
uv run --with python-docx ~/.kiro/skills/office-word/scripts/write_docx.py --stdin "<output.docx>" <<'EOF'
Some paragraph with **bold** text.
EOF
From an existing Markdown file
If a .md file already exists, use it directly:
uv run --with python-docx ~/.kiro/skills/office-word/scripts/write_docx.py "<input.md>" "<output.docx>"
If you had to create the .md file as an intermediate step (it didn't exist before), delete it after generating the docx.
Workflow to create a Word document
- Prefer piping content via
--stdin to avoid intermediate files.
- If content is too large for a heredoc, create a temporary
.md file, convert, then delete it.
Supported formatting
- Headings (H1-H4), bullet lists, numbered lists, tables
- Bold, italic, and bold-italic inline formatting
- Tables are converted bidirectionally between Markdown and Word Table Grid style