Docling
Convert reference files (PDF, DOCX, PPTX, XLSX, HTML, images) to Markdown before reading or acting on them. Use when user provides a non-Markdown file as context for an implementation task — "use this doc", "based on this file", "implement from this", or any path ending in .pdf/.docx/.pptx/.xlsx/.html/.htm/.png/.jpg/.jpeg/.gif/.webp/.tiff.From its SKILL.md
npx -y skills add ops4life/claude4ops --skill doclingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.7 KB, as published. Nobody here has run it
Docling: Convert Reference Files Before Implementation
When a user provides a reference file in a non-Markdown format, convert it first, then read the result.
When to Apply
Trigger when the user:
- Drops a file path ending in
.pdf,.docx,.pptx,.xlsx,.html,.htm,.png,.jpg,.jpeg,.gif,.webp,.tiff - Says "use this doc", "based on this file", "implement from this", "use this reference", or similar
- References any file that isn't already
.mdor.txt
How to Convert
Primary: Python CLI (preferred)
docling "<file>" --to md --output /tmp/docling-output
Output lands in /tmp/docling-output/<filename>.md. Read that file, then proceed.
If docling is not installed:
pip install docling --break-system-packages -q
Image-based PDFs (blank pages / no embedded text)
If the output is empty or 0 bytes, the PDF is image-based. Add --force-ocr:
pip install onnxruntime --break-system-packages -q # required for rapidocr
docling "<file>" --to md --output /tmp/docling-output --force-ocr --ocr-engine rapidocr
Fallback: Docker script
Only use if Python CLI is unavailable. Fails in Docker-in-Docker environments (volume mounts reference host filesystem, not agent container).
~/.claude/scripts/docling.sh --to md --output /tmp/docling-output <file>
Example
User says: "Build the API based on spec.pdf"
docling "/path/to/spec.pdf" --to md --output /tmp/docling-output
# then read /tmp/docling-output/spec.md
Reading the Output
Strip embedded base64 images before reading large markdown files:
import re
with open('/tmp/docling-output/file.md') as f:
content = f.read()
clean = re.sub(r'!\[Image\]\(data:image/[^)]+\)', '[IMAGE]', content)
print(clean)
Notes
- Output filename matches input filename with
.mdextension - Files with spaces in path: quote the path — Python CLI handles spaces correctly
- First run downloads models (~500MB OCR models). Subsequent runs use cache
- Images: OCR applied automatically without
--force-ocrfor text-layer PDFs - HTML: strips markup, extracts structured text
- If output is 0 bytes after
--force-ocr, the PDF may have white-on-white content or DRM — use Claude's built-in PDF reader (Readtool) as last resort