document-conversion
Document-to-markdown conversion with tiered fallback: MCP markitdown, native tools, or user notice
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/athola/nm-leyline-document-conversionNight Market Skill — ported from claude-night-market/leyline. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
Document Conversion
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.
When To Use
- Converting PDF, DOCX, PPTX, XLSX, HTML, or images to markdown for downstream processing
- Any skill that ingests external documents
- File format is not plain text or markdown
When NOT To Use
- Content is already markdown or plain text
- You only need to read a small text file (use Read directly)
Format Detection
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.
Conversion Protocol
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)
Tier 1: MCP markitdown
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.
Tier 2: Native Claude Code Tools
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.
Tier 3: User Notification
When neither Tier 1 nor Tier 2 can handle the format:
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-athola-nm-leyline-document-conversion": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
extract
Analyze a codebase and build a knowledge base of business logic, architecture, data flow, and engineering patterns. The foundation for gauntlet challenges and agent integration
discourse
>- Scan community discussion channels (HN, Lobsters, Reddit, tech blogs) for experience reports and opinions on a topic
synthesize
>- Merge, deduplicate, rank, and format research findings from multiple channels into a coherent report. Use after research agents return their results
workflow-monitor
Detect workflow failures and inefficient patterns, then create GitHub issues for improvement via /fix-workflow
architecture-paradigm-hexagonal
Hexagonal (Ports and Adapters) architecture isolating domain logic from infrastructure