doc-to-markdown
Skill3 starsChanged 33 days agoMITView on GitHub
Convert documents (PDF, DOCX) in a directory to well-formatted Markdown files with images extracted. Use this skill whenever the user wants to convert documents to markdown, make documents readable for future reference, extract content from PDFs or Word files into markdown format, or batch-convert a folder of documents. Trigger on phrases like "convert to markdown", "转成markdown", "转换成md", "文档转换", "把文档变成可读的", "提取文档内容", or any request involving turning PDF/DOCX files into a text-based readable format with images preserved. Not for the reverse direction: to turn Markdown into PDF, use md-to-pdf instead.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- joaoguirunas/team-ostheir own version, first seen Nov 1, 2026
- AllanSantos-DV/skill-kittheir own version, first seen Oct 15, 2026
- bnwe/claude-skillstheir own version, first seen Oct 11, 2026
- Sorinpsc/claude-skillstheir own version, first seen Aug 18, 2026
- Nico0713520/dsh-doc-to-markdowntheir own version, first seen Aug 17, 2026
- seonggukchoi/skillstheir own version, first seen Aug 10, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- sheepmao/doc-to-markdown-skill★ 9same name
- joaoguirunas/team-os★ 6same name
- seonggukchoi/skills★ 1same name
- AllanSantos-DV/skill-kit★ 0same name
- bnwe/claude-skills★ 0same name
- Nico0713520/dsh-doc-to-markdown★ 0same name
- Sorinpsc/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- anthropic-designSkill
- apple-designSkill
- atelier-designSkill
- datasheet-readingSkill
- design-evolveSkill
- design-plannerSkill
- design-reviewSkill
- design-tasteSkill
- doc-review-loopSkill
- eclat-designSkill
- ember-designSkill
- explain-ladderSkill
- gated-dual-clone-auditSkill
- gated-dual-cloneSkill
- glass-designSkill
- graphite-designSkill
- hardware-3dSkill
- kernel-explainSkill
- lectern-designSkill
- linux-kernel-devSkill
- md-to-pdfSkill
- primer-designSkill
- relief-designSkill
- sage-designSkill
- skills-syncSkill
- tech-pdf-readerSkill
- wechat-video-publisherSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 71
After the script runs, the output needs human-guided curation to become truly useful.
- Distinctive: line 82
Update the markdown references to match
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Doc-to-Markdown Converter
Convert PDF and DOCX files to clean Markdown with extracted images. Supports single file or batch directory conversion.
Output Structure
<output-dir>/
├── <doc1-name>.md
├── <doc2-name>.md
└── images/
├── <doc1-slug>/
│ ├── sec01_01.png
│ ├── sec01_02_boot_flow.png
│ └── sec02_01.png
└── <doc2-slug>/
└── ...Image naming convention: sec{章节号}_{序号}_{描述}.png — makes images easy to find and associate with document章节。
Workflow
1. Confirm with user
Identify the source (single file or directory) and confirm:
- What to convert
- Where to put output (default: create a
markdown/dir in project root, or user can specify)
2. Ensure dependencies
python3 -c "import fitz" 2>/dev/null || pip3 install pymupdf
python3 -c "from docx import Document" 2>/dev/null || pip3 install python-docx3. Run the converter
The bundled scripts/convert.py handles the core conversion.
Single file:
python3 <skill-dir>/scripts/convert.py /path/to/file.pdf --output /project/markdown/Batch directory:
python3 <skill-dir>/scripts/convert.py /path/to/docs/ --output /project/markdown/What the script handles:
- PDF: Extracts text with heading detection, extracts embedded images per page. For scanned PDFs (no text layer), exports full page as 2x PNG.
- DOCX: Extracts text preserving heading/list/code styles, extracts PNG/JPEG images, attempts EMF/WMF conversion via LibreOffice or PIL.
- Image placement: Images are inserted inline near the paragraphs that reference them, not dumped at the end.
- Tables: Converted to markdown table format.
4. Post-processing (important!)
After the script runs, the output needs human-guided curation to become truly useful. This is where you add value beyond raw conversion:
- Read the generated markdown to verify text quality — fix garbled headings, broken lists, or misformatted code blocks.
- Review extracted images — read the image files to check which are:
- Substantive (diagrams, flowcharts, architecture drawings, code screenshots) → keep
- Decorative (logos, horizontal rules, tiny icons, blank images) → delete
- Rename images to descriptive names based on content:
sec01_01.png→sec01_01_验签流程图.png(if it shows verification flow)sec03_02.png→sec03_02_efuse_layout.png(if it shows eFuse layout)- Update the markdown references to match
- For EMF/WMF diagrams that couldn't be extracted: If the user provides a screenshot or describes the diagram, recreate it using Python PIL and save as PNG. This is common for Visio diagrams embedded in Word docs — they're the most valuable images and worth recreating.
- Place images contextually — if images ended up in "Other Images" section at the end, move the
![...]()references to where they logically belong in the text.
5. Report results
Show the user:
- File tree of what was generated
- Number of images kept vs removed
- Any EMF/WMF files that couldn't be converted (suggest user provide screenshots from original doc)
- Any issues encountered
Edge Cases
- Scanned PDFs: Page images are exported as fallback; text will be empty. Note this in the markdown.
- Password-protected PDFs: Report to user if PyMuPDF can't open.
- Large PDFs (>50 pages): Still convert, but warn user. Consider extracting only pages with figures.
- Chinese content: PyMuPDF and python-docx handle CJK well, no special handling needed.
- Complex tables with merged cells: Best-effort markdown tables; suggest "see original" for very complex ones.
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.

