agentsclimarketplace

Docling

Skill ops4life/claude4ops/skills/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

Install
npx -y skills add ops4life/claude4ops --skill docling

Assembled 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 .md or .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 .md extension
  • 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-ocr for 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 (Read tool) as last resort

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.