any2md
Skill8 starsChanged 3 months agoMITView on GitHub
Universal document to Markdown converter with automatic format routing. Auto-detects DOCX math and routes to word2md; uses markitdown for PPTX/XLSX/HTML/EPUB/etc; supports PyMuPDF for high-fidelity PDF. Fixes markdownify math-escaping bugs.
- Installs packages
In this repository32 other files it gives its agents.
- ai-genSkill
- assignment-wordSkill
- cheatsheatSkill
- claude2antiSkill
- claude2codexSkill
- codex2claudeSkill
- fincomp-deckSkill
- github-trendingSkill
- git-pushSkill
- html2mdSkill
- html2pdfSkill
- html2texSkill
- html-slidesSkill
- img-readerSkill
- latex-beamerSkill
- markitdownSkill
- md2docxSkill
- md2texSkill
- mergeSkill
- notesSkill
- paper-html-onepageSkill
- paper-reproSkill
- pdf2wordSkill
- pdf-readerSkill
- posterSkill
- repo-docsSkill
- repo-docs-zhSkill
- resume-builderSkill
- web-search-fallbackSkill
- word2htmlSkill
- word2mdSkill
- word2pdfSkill
The file
Files
any2md — Universal Document to Markdown
Automatically routes to the best backend based on file format and content:
| Format | Backend | Why |
| DOCX with math | /word2md | Correct OMML→LaTeX, no escaping bugs |
| DOCX no math | markitdown | General-purpose conversion |
| markitdown | Table-aware extraction | |
| PDF (high fidelity) | PyMuPDF | --pdf-backend pymupdf |
| PPTX / XLSX / HTML / EPUB / etc | markitdown | Broad format support |
When to Use
- User mentions: "any2md", "/any2md", "convert to md", "转 markdown", "万能转 md"
- User has a document of unknown type and wants Markdown output
- User wants one command that handles any format
How to Use
PYTHONIOENCODING=utf-8 python ~/.claude/skills/any2md/any2md.py "<INPUT_FILE>" ["<OUTPUT.md>"]Arguments
| Arg | Required | Description |
input | Yes | Input file path |
output | No | Output .md path (default: stdout) |
--math | No | auto (default) / yes / no — math detection |
--pdf-backend | No | markitdown (default) / pymupdf |
Examples
# Auto-detect format, print to stdout
PYTHONIOENCODING=utf-8 python ~/.claude/skills/any2md/any2md.py "document.docx"
# Convert and save
PYTHONIOENCODING=utf-8 python ~/.claude/skills/any2md/any2md.py "slides.pptx" "slides.md"
# Force math mode for DOCX
PYTHONIOENCODING=utf-8 python ~/.claude/skills/any2md/any2md.py "report.docx" "report.md" --math yes
# PDF with PyMuPDF (high fidelity, no tables)
PYTHONIOENCODING=utf-8 python ~/.claude/skills/any2md/any2md.py "paper.pdf" "paper.md" --pdf-backend pymupdfKey Features
- Auto math detection: Scans DOCX for
oMathelements; routes toword2mdif found - Math escaping fix: Post-processes markitdown output to fix
\_→_inside$...$ - Image extraction: DOCX with math → word2md extracts images to
images/folder - PDF backends: Choose between table-aware (markitdown) or high-fidelity text (PyMuPDF)
Dependencies
markitdown—pip install markitdownpython-docx— for word2md backend (auto-detected)PyMuPDF(optional) — for--pdf-backend pymupdf
Rules
- Always use
PYTHONIOENCODING=utf-8on Windows - For DOCX with math, this skill auto-routes to word2md — no need to call
/word2mdseparately - For pure PDF reading (no conversion needed), prefer
/pdf-readerwhich has 3 extraction modes - For DOCX to HTML (not Markdown), use
/word2htmlinstead
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

