Help us improve
Share bugs, ideas, or general feedback.
From leyline
Converts PDFs, DOCX, PPTX, XLSX, HTML, images, URLs, CSV, JSON, and more to markdown via tiered fallbacks: MCP markitdown, native tools, or user notice. For ingesting non-plain-text files.
npx claudepluginhub athola/claude-night-market --plugin leylineHow this skill is triggered — by the user, by Claude, or both
Slash command
/leyline:document-conversionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Convert documents and URLs to markdown using a three-tier
Converts files and URLs to clean Markdown using MarkItDown. Supports PDF, DOCX, XLSX, PPTX, HTML, images (OCR), audio, CSV, and YouTube transcripts. Optimized for LLM ingestion pipelines.
Converts local PDF, DOCX, XLSX, PPTX, images via OCR, and audio files to clean Markdown using Microsoft's markitdown CLI. Best for text extraction from local documents.
Converts files (PDF, DOCX, images, audio, etc.) to Markdown for LLM-friendly text. Supports OCR and transcription.
Share bugs, ideas, or general feedback.
Convert documents and URLs to markdown using a three-tier fallback strategy. This skill is infrastructure: consumer skills reference it via dependency rather than reimplementing conversion logic.
Identify the document type from the URI before converting.
| Extension | Format | Tier 1 | Tier 2 |
|---|---|---|---|
.pdf | Yes | Read tool (pages) | |
.docx, .doc | Word | Yes | None |
.pptx, .ppt | PowerPoint | Yes | None |
.xlsx, .xls | Excel | Yes | None |
.html, .htm | HTML | Yes | WebFetch |
.csv | CSV | Yes | Read tool |
.json | JSON | Yes | Read tool |
.xml | XML | Yes | Read tool |
.png, .jpg, .jpeg, .gif, .webp | Image | Yes | Read tool (visual) |
.mp3, .wav, .m4a | Audio | Yes | None |
.zip | Archive | Yes | None |
.epub | E-book | Yes | None |
See modules/format-matrix.md for quality comparison
across tiers.
To convert a document to markdown:
1. DETECT -- Identify format from URI extension or context
2. TRY -- Tier 1: MCP markitdown (best quality)
3. DEGRADE -- Tier 2: native Claude Code tools (if Tier 1 fails)
4. INFORM -- Tier 3: tell user what's needed (if no coverage)
5. SANITIZE -- Apply content-sanitization (external content)
Call the convert_to_markdown MCP tool with the document URI.
See modules/uri-construction.md for URI formatting rules.
If the tool is available and succeeds, you have the best possible conversion. Proceed to the SANITIZE step.
If the tool is not available (not found, connection error) or fails, proceed to Tier 2.
Use built-in tools as format-specific fallbacks.
See modules/fallback-tiers.md for per-format instructions.
Supported in Tier 2: PDF, HTML, images, CSV, JSON, XML. Not supported in Tier 2: DOCX, PPTX, XLSX, audio, archives, e-books. Proceed to Tier 3 for these.
When neither Tier 1 nor Tier 2 can handle the format:
I cannot convert this {format} file without the markitdown MCP server. To enable conversion, add this to
.mcp.json:{ "mcpServers": { "markitdown": { "type": "stdio", "command": "uvx", "args": ["markitdown-mcp"] } } }Alternatively, convert the file to PDF or HTML first, which I can read with built-in tools.
All converted content is external. Apply the
leyline:content-sanitization checklist:
Consumer skills depend on this skill and reference the protocol by name:
dependencies:
- leyline:document-conversion
Then in their workflow: "Convert the document using the
leyline:document-conversion protocol."
modules/format-matrix.mdmodules/fallback-tiers.mdmodules/uri-construction.md