Oma pdf

From first-fluke/oh-my-agent · View interactive version

Oma pdf is an AI agent skill from the GitHub repository first-fluke/oh-my-agent. Extract PDF text, headings, tables, and images into Markdown using opendataloader-pdf. Use for PDF parsing, not PDF layout creation.

How to use this skill

Skill file

PDF Skill - PDF to Markdown Conversion

Scheduling

Goal

Convert PDF files into structured Markdown or another requested extraction format while preserving readable document structure for LLM context, RAG, or downstream review.

Intent signature

When to use

When NOT to use

Expected inputs

Expected outputs

Dependencies

Structural Flow

Transitions

Failure and recovery

| Failure | Recovery |

|---------|----------|

| uvx unavailable | Ask user to install uv before conversion |

| opendataloader-pdf-hybrid not found | Invoke via uvx --from "opendataloader-pdf[hybrid]" opendataloader-pdf-hybrid; the bare package name does not exist on PyPI |

| Password-protected PDF | Ask for password or unlocked PDF |

| Garbled output | Retry with tagged structure or hybrid mode |

| Missing tables | Retry with --table-method cluster or --markdown-with-html first; hybrid mode for scanned tables |

| OCR language mismatch | Retry with explicit OCR languages, for example ko,en |

| Large file or memory pressure | Split into page ranges using distinct output directories or --to-stdout; never reuse one output directory for the same basename |

Exit

Logical Operations

Canonical command path

  1. Confirm that the input path exists and is a readable PDF file, PDF folder, or supported batch input, and that the output location is writable or can be created. Resolve output_dir and the expected output filename. Defaults come from the pdf: section of .agents/oma-config.yaml, falling back to config/pdf-config.yaml for unset keys; explicit user options override both, and output.overwrite: false requires confirmation before replacing an existing output file. Check file size and warn when the input is large enough to risk slow conversion or memory pressure.
  2. Assess whether the PDF has a readable text layer by extracting a text preview:

```bash

uvx opendataloader-pdf "{input_path}" -f text --pages 1-3 --to-stdout -q # text-layer probe (no temp files)

```

  1. Convert in the mode the preview and Transitions select (standard, tagged-structure, or hybrid OCR). Standard conversion:

```bash

uvx opendataloader-pdf "{input_path}" --format markdown --output-dir "{output_dir}"

```

For scanned/image-based PDFs, start OCR first and then convert through hybrid mode. Attempt OCR only when the hybrid server is available or can be started:

```bash

uvx --from "opendataloader-pdf[hybrid]" opendataloader-pdf-hybrid --port 5002 --force-ocr --ocr-lang "{languages}"

uvx opendataloader-pdf --hybrid docling-fast --hybrid-mode full "{input_path}" --format markdown --output-dir "{output_dir}"

```

  1. For Markdown output, normalize it and inspect the result for readable structure:

```bash

uvx mdformat "{output_path}"

```

  1. Report the output path, page count, format, and any extraction quality issues.

On-request flags — --sanitize (PII masking), --pages (range extraction), --threads (parallel pages), --detect-strikethrough, hybrid --enrich-formula / --enrich-picture-description — are detailed in resources/execution-protocol.md. The two enrichment flags require client-side --hybrid-mode full.

Resource scope and effects

Reads the input PDFs and does not modify the source PDF. Creates or overwrites extraction output in the output directory, depending on configuration and user intent. Runs uvx subprocesses and, for OCR, may start a local hybrid server on the configured port. Large or scanned PDFs may consume significant CPU, memory, or time.

Guardrails

  1. Do not invent missing content when extraction is incomplete.
  2. Always report garbled text, missing tables, OCR uncertainty, or partial extraction.
  3. Prefer standard conversion first when the text layer is readable.
  4. Use OCR only when the PDF is scanned, image-based, or standard extraction quality is insufficient.
  5. Keep detailed command sequences in resources/execution-protocol.md rather than duplicating every variant here.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.