Converts DOCX, PDF, PPTX, and saved HTML/HTM files to high-quality Markdown with automatic post-processing. Fixes pandoc grid tables, image paths, CJK bold spacing, and code blocks. Strips OCR garbage, headers/footers, and watermarks from PDFs.
Ships in daymade-docs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Convert documents to high-quality markdown with intelligent multi-tool orchestration and automatic DOCX post-processing.
# DOCX → Markdown
uv run --with pymupdf --with pymupdf4llm --with "markitdown[pdf]" scripts/convert.py document.docx -o output.md --assets-dir ./media
# PDF → Markdown
uv run --with pymupdf --with pymupdf4llm --with "markitdown[pdf]" scripts/convert.py document.pdf -o output.md
# Saved HTML → Markdown (Pandoc required; no remote fetching)
uv run scripts/convert.py page.html -o page.md
# Run tests
uv run --with pytest pytest scripts/test_convert.py -v
| Mode | Speed | Selection | Use Case |
|---|---|---|---|
| Quick (default) | Fast | Single converter | Drafts, simple documents |
| Heavy | Slower | Compares converter candidates | Complex layouts needing source review |
Read select_tools for format preferences and availability
filtering. HTML/HTM follows the saved HTML procedure.
For Heavy Mode selection and failure handling, read
its procedure.
Before delivering a PDF conversion or changing its structure, follow the PDF acceptance procedure. It owns source comparison, structural review, actual-reader checks and original-file handoff.
For HTML/HTM, read references/html-conversion.md
before converting. Use scripts/convert.py; the default converts the whole body
and does not trim navigation. An explicit --html-selector selects exactly one
tag, #id or .class. --html-heading-offset shifts parsed headings for assembly
and rejects overflow beyond H6. Relative assets are not downloaded or copied.
Verify source href occurrences against the emitted Markdown AST, then rerun
scripts/html_to_markdown.py after cleanup or merging. For manuals, map the book,
chapters, lessons and internal headings before assembly; preserve code fences and
reconcile rewritten anchors. Conversion success does not certify that figures
are readable inside the recipient's actual Markdown reader.
When converting DOCX via pandoc, these cleanups are applied automatically:
| Problem | Fix |
|---|---|
Grid tables (+:---+) | Single-column → blockquote, multi-column → pipe table |
Simple tables ( ---- ----) | Multi-column images → pipe table with captions |
Image path nesting (media/media/) | Remove doubled media/; CLI references resolve relative to the Markdown output |
Pandoc attributes ({width="..."}) | Removed |
CJK bold spacing (**粗体**中文) | Add space around ** for CJK bold spans |
| Indented dashed code blocks | → fenced ``` with language detection |
Escaped brackets (\[...\]) | → [...] |
Double-bracket links ([[text]](url)) | → [text](url) |
For Word questionnaires and generated list labels, follow DOCX numbering before conversion and validation.
When converting PDF via pymupdf4llm, these cleanups are applied automatically (skip with --no-postprocess):
| Problem | Fix |
|---|---|
Tesseract OCR garbage on image regions (<!-- Start of picture text -->...) | Block removed; images themselves kept |
| Repeated header/footer/watermark lines (including diagonal watermarks) | Detected via pymupdf cross-page scan, removed from markdown; bold-wrapped and merged-with-page-number variants also caught |
Absolute image paths () | Rewritten relative to the output markdown file (portable output) |
For engine availability and failure handling, read Heavy Mode selection.
Known limits:
dn, uFE, ...); the repeating-line stripper removes full lines only, not intra-cell shards. Watermark-heavy PDFs need cell-level rebuild (collect non-watermark spans per cell bbox).DOCX uses run-level styling (no spaces between bold/normal runs in CJK text). Markdown renderers need whitespace around ** to recognize bold boundaries.
Rule: if a **content** span contains any CJK character, ensure both sides have a space — unless already spaced or at line boundary. This handles CJK punctuation, emoji adjacency, and mixed content.
Before: 打开**飞书**,就可以 → some renderers fail to bold
After: 打开 **飞书** ,就可以 → inspect bold rendering in the target reader
Before choosing Heavy Mode, read its selection and degradation behavior. For explicit segment-level merging, use Merge Outputs Manually.
# Extract images with metadata
uv run --with pymupdf scripts/extract_pdf_images.py document.pdf -o ./extracted-images
# Generate markdown references file
uv run --with pymupdf scripts/extract_pdf_images.py document.pdf --markdown refs.md
Output:
extracted-images/img_page1_1.png, extracted-images/img_page2_1.jpgextracted-images/images_metadata.json (page, position, dimensions)For the validator's command, prerequisites, result fields and exit handling, read Mechanical comparison. The CLI accepts PDF or DOCX source files; the remainder of that procedure covers PDF structural and recipient acceptance.
From this Skill's source checkout, run the validator's bidirectional controls with
python3 -m unittest discover -s tests -v (Pandoc required). Default packages
exclude this development test directory; a zero-test run is not validation.
# Merge multiple markdown files
python scripts/merge_outputs.py output1.md output2.md -o merged.md
# Show segment attribution
python scripts/merge_outputs.py output1.md output2.md -o merged.md --verbose
# Windows to WSL conversion
python scripts/convert_path.py "C:\Users\<windows-user>\Documents\file.pdf"
# Output: /mnt/c/Users/<windows-user>/Documents/file.pdf
"No conversion tools available" Follow converter installation, then rerun the selected conversion command. Check imports in the same Python runtime as the converter; a distribution name alone does not prove an engine is available.
FontBBox warnings during PDF conversion
Images missing from output
scripts/extract_pdf_images.pyTables broken in output
references/benchmark-2026-03-22.md - Historical converter benchmarkreferences/heavy-mode-guide.md - Detailed Heavy Mode documentationreferences/tool-comparison.md - Tool capabilities comparisonreferences/conversion-examples.md - Batch operation examplesreferences/html-conversion.md - Saved HTML scope, link retention, assets and manual heading assemblyreferences/pdf-acceptance.md - PDF text/structure checks, synthetic boundary controls, reader and original-file handoffreferences/obsidian-link-examples.md - Native heading/citation and same-name book-index navigation controlsassets/obsidian-links/fixed.md (opens in a new tab)assets/obsidian-links/legacy.md (opens in a new tab)assets/obsidian-links/nested-vault/index.md (opens in a new tab)assets/obsidian-links/nested-vault/products/equipment-book/01-questions.md (opens in a new tab)assets/obsidian-links/nested-vault/products/equipment-book/index.md (opens in a new tab)assets/obsidian-links/nested-vault/products/index.md (opens in a new tab)assets/obsidian-links/nested-vault/storage/README.md (opens in a new tab)assets/obsidian-links/source.html (opens in a new tab)assets/pdf-fidelity/broken.md (opens in a new tab)assets/pdf-fidelity/expected.md (opens in a new tab)assets/pdf-fidelity/source.html (opens in a new tab)assets/pdf-fidelity/source.pdf (opens in a new tab)assets/reader-pilot-evidence-template.json (opens in a new tab)references/benchmark-2026-03-22.md (opens in a new tab)references/conversion-examples.md (opens in a new tab)references/docx-numbering.md (opens in a new tab)references/heavy-mode-guide.md (opens in a new tab)references/html-conversion.md (opens in a new tab)references/obsidian-link-examples.md (opens in a new tab)references/pdf-acceptance.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
document-conversion, markdown, pandoc, docx, pdf, pptx, html-to-markdown
/daymade-docs:doc-to-markdownfrom daymade-docs
npx claudepluginhub daymade/claude-code-skills --plugin daymade-docs11 skills in this plugin
/docs-cleanerConsolidates redundant documentation while preserving all valuable content; keeps a doc set truthful after things change. Modes: (1) POST-CHANGE GOVERNANCE — when code, scripts, config, env vars, ports, paths, deployment, auth, tests, or a documented procedure changed; also "which docs are now wrong", "check docs for inconsistencies", "过时的命令/路径", "文档同步". Use it even when the user mentions only the change and never the docs — updating them is part of the change, not optional cleanup. (2) CONSOLIDATION — "clean up docs", "documentation bloat", "reduce documentation sprawl", "consolidate documentation", "too many doc files", "merge redundant docs", "merge these docs", "文档太多/太乱", multiple files covering the same topic, or documentation exceeding 500 lines across multiple files on similar topics. Finds stale copies of a fact changed in only one place, values that should never have been persisted (counts, totals, "N items", restated summaries), rival definitions that drift apart, and orphaned cross-references./docs-routerWord/PDF/PPTX/HTML→MD;MD/Word→PDF;new Word;PDF HTML/translate;Excel/xlsm/Mac;photo/signed scan;Mermaid;DOCX review;doc cleanup Reads one bundled Daymade specialist. New slide decks use deck-creator when installed; generic PDF reading/editing and spreadsheet analysis stay with their own Skills. Retired ppt-creator stays manual-only./docx-creatorProduces Word (.docx) and exports existing Word/WPS manuscripts to PDF, preserving revisions, tables and images, especially Chinese formal documents via a verified OpenXML generator with mandatory visual verification. Use for 生成 Word 文档 / 写合同 docx / 把 markdown 转成 Word / 中文排版. Not for Markdown → PDF (use daymade-docs:pdf-creator)./excel-automationCreates formatted Excel reports with openpyxl, parses complex xlsm financial models with stdlib zipfile+xml when openpyxl fails, and controls Excel windows on macOS via AppleScript. Reconstructs images or scans of paper forms as editable XLSX files with printable layouts./mermaid-toolsExtracts Mermaid diagrams from markdown files and generates high-quality PNG images using bundled scripts. Activates when working with Mermaid diagrams, converting diagrams to PNG, extracting diagrams from markdown, or processing markdown files with embedded Mermaid code./pdf-creatorConverts Markdown to print-ready PDF with proper Chinese typography, themes and a visual self-check. Use for Markdown → PDF, including documents formatted for printing or mobile reading. Not for Word/WPS files or Word output (use docx-creator).Other plugins' skills for the same job