Docx convert

From SteelMorgan/1c-agent-based-dev-framework · View interactive version

Docx convert is an AI agent skill from the GitHub repository SteelMorgan/1c-agent-based-dev-framework. For converting DOCX to Markdown with images

How to use this skill

Skill file

Word → Markdown Conversion

A thin wrapper around pandoc for converting .docx to GitHub-Flavored Markdown while extracting embedded images. It also post-processes the result: fixes image paths and converts HTML tables (which pandoc leaves unchanged for complex cases) into Markdown pipe tables.

When to Use

| Situation | Action |

|----------|----------|

| The customer sent a spec in .docx, and it needs to be put into the repository as md | docx2md.sh input.docx |

| Vendor documentation is in Word, and it needs to be fed to the agent | docx2md.sh input.docx output_dir |

| A document with complex tables and styles - pandoc skips them | mammoth (see below) |

| Only the text portion is needed, without images | pandoc input.docx --to=gfm -o out.md directly |

When NOT to Use

Dependencies

Quick Start

# Результат рядом с файлом, в каталоге с тем же именем без расширения
bash framework/skills/tool-usage/content-generation/docx-convert/docx2md.sh "/path/to/file.docx"

# С указанием выходного каталога
bash framework/skills/tool-usage/content-generation/docx-convert/docx2md.sh "/path/to/file.docx" "/path/to/output"

Result:

When used from a project where the framework is installed via symlinks, the script path is: .claude/skills/docx-convert/docx2md.sh.

Manual Commands (without the script)

Text only

pandoc input.docx --from=docx --to=gfm --wrap=none -o output.md

Text + images

pandoc input.docx --from=docx --to=gfm --wrap=none \
    --extract-media=./images \
    -o output.md

Via mammoth (for complex tables/styles)

python3 -c "
import mammoth, pathlib
result = mammoth.convert_to_markdown(open('input.docx', 'rb'))
pathlib.Path('output.md').write_text(result.value)
"

Anti-Patterns

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.