SuperAPI AI Directory

office-word

Office & productivity

View repository

Updated 10-15 17:22

About this skill

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'
# Title

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

  1. Prefer piping content via --stdin to avoid intermediate files.
  2. 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