Omh long document reading

From rlaope/oh-my-hermes · View interactive version

Omh long document reading is an AI agent skill from the GitHub repository rlaope/oh-my-hermes. [omh] Huge PDF or document to read in full: read a very large PDF, contract, manual, or report through Hermes in page-anchored ranges with a coverage ledger. Use when the user says: long-document-reading, long document reading, summarize this pdf, read this pdf, process this pdf, go through this pdf

How to use this skill

Skill file

Long Document Reading

This is a Hermes-native long-document-reading workflow skill.

Why This Exists

long-document-reading exists because a 300-page PDF is about 500,000 characters and Hermes' read_file returns 100,000 per call with no page numbers, re-converting the whole file each time; five unanchored reads then sit in the conversation until the ratio-based compressor summarizes them without a page number, so without a ledger the session either truncates, loses the early ranges to compaction, or claims a summary of pages it never read.

Do Not Use When

Examples

Good example:

Bad example:

Completion Checklist

Recovery Notes

Workflow Lane

When to Use

Use when Hermes must read a supplied document that does not fit one read: a contract, manual, annual report, specification, or any PDF past about 60 pages. The skill plans page ranges sized to the read_file budget, keeps a page-anchored chunk ledger with covered / next / missing state, and delegates ranges when there are more than 4, so a compacted or resumed session continues instead of restarting.

Strong routing signals: long-document-reading, long document reading, summarize this pdf, read this pdf, process this pdf, go through this pdf, summarize this document, read this document, process this document, read this whole document, summarize this manual, read this manual, summarize this contract, read this contract, summarize this annual report, read this annual report, read the whole pdf, chunk this pdf, pdf in chunks, pdf too big, pdf too large, このpdfを要約, この文書を要約, この契約書を要約, マニュアルを要約, 긴 문서 읽기, 이 pdf 요약해줘, 이 pdf 읽어줘, 이 문서 요약해줘, 이 문서 읽어줘, 계약서 요약해줘, 매뉴얼 요약해줘, 연간 보고서 요약해줘, pdf 전체 읽어, 문서 전체 읽어, прочитай pdf, прочитай этот документ, большой документ прочитай, суммаризируй pdf, прочитай документ, 总结这个pdf, 总结这份文档, 总结这份合同, 总结这本手册, baca seluruh dokumen ini, rangkum PDF panjang ini, tolong baca laporan ini sampai selesai, ringkas dokumen ini tanpa melewatkan bagian, baca manual ini dari awal sampai akhir, bantu rangkum seluruh isi PDF ini, đọc toàn bộ tài liệu này, hãy đọc báo cáo này đến hết, tóm tắt tài liệu này không bỏ sót phần nào, đọc tài liệu hướng dẫn này từ đầu đến cuối

Catalog Metadata

Category: research

Phase: long-document-reading

Hermes role: researcher

Quality tier: long-document-gated

Reasoning demand: standard

Quality bar:

Handoff policy:

Keep document reading in Hermes: read_file, the built-in pdf skill scripts, delegate_task range children, and vision_analyze for scanned pages. Route file export to omh-materials-package, paper tutoring to omh-paper-learning, and source acquisition to omh-source-finder.

Required inputs:

Expert clarification questions:

Expected outputs:

Artifact expectations:

Safety rules:

Long Document Reading Protocol

Every command below runs through the terminal tool from Hermes' built-in pdf skill. On current Hermes main all four scripts sit in skills/productivity/pdf/scripts/ (the ocr-and-documents skill was merged into it); on older Hermes trees extract_pymupdf.py and extract_marker.py live in skills/productivity/ocr-and-documents/scripts/ instead. Locate the directory with skills_list or search_files before the first run. Outputs differ per script: pdf_read.py, pdf_split.py, and pdf_page_image.py print JSON; extract_pymupdf.py prints plain text with --- Page N/M --- separators (JSON only with --metadata); and pdf_page_image.py exits 0 with {"rendered": false, "missing": [...]} when no rasterizer is installed, so read rendered before trusting a render. Measured Hermes limits are in references/hermes-pdf-limits.md.

Environment. Resolve two interpreters once and call them by absolute path (command -v <name> for a system one, the full <venv>/bin/python for a virtual environment), <PY_DOCS> for pdf_read.py, pdf_split.py and pdf_page_image.py and <PY_MUPDF> for extract_pymupdf.py; a shell variable such as $PY does not reach a delegated child. When the pdf skill's Prerequisites section gives a documents-environment block (hermes pm environment documents ...) and the pdf skill's references/ocr-extraction.md gives a pdf-pymupdf block, take each interpreter from them. When the skill has no such block (Hermes before it, including the floor v2026.9.7), build a task-local virtual environment (python3 -m venv <task dir>/pdfvenv, then install into it only the packages the scripts name) and use its interpreter for both. Never pip install into the interpreter that runs Hermes or into a hermes pm environment one. If no environment can be built, name the missing extractor and stop.

  1. Scope. Confirm the path and the reading goal (full summary, clauses or sections, obligations and dates, or one question). If the goal is one lookup, dump the text layer once (<PY_MUPDF> extract_pymupdf.py <file> into a file in the task directory), search_files that file, and read the pages around each hit; report an absence only as "not found in the text layer of pages X; pages Y are image-only and unsearched".
  2. Probe. Run <PY_DOCS> pdf_read.py <file> --meta for the page count, encrypted flag, and scanned flag. Each script names its own missing dependency (pdfplumber and, for --meta, pypdf here; pypdf for pdf_split.py; pymupdf for extract_pymupdf.py; pypdfium2 or poppler pdftoppm for pdf_page_image.py); run it with the interpreter above and say which one you used. For an encrypted file ask for the password (--password) or stop.
  3. Plan. At about 1,600 characters per page one read_file call (100,000 characters) holds about 60 pages, so split the page count into ranges of 60 pages. A document under 60 pages of prose is one read; answer directly. Record the plan as the chunk ledger: call omh_document_plan with action=plan, the path as source, the pages count and an outline of {title, page} anchors when the front matter shows one, and write the returned plan_id into your notes (action=show needs it; planning again with the same numbers returns the same plan and keeps its ledger). Use only its chunk numbers and page spans: ignore its read_window and brief, which paginate with read_file. It writes the plan under the OMH home, so a compacted or resumed session calls action=show and resumes at the next range. If that tool is absent, keep the ledger in a file in the task directory, one row per range with pages, offset, chars, and state (covered, next, missing), and reread it after compaction. For Korean or other CJK text a character costs more context than English: measure one probe range and size the ranges from its observed characters per page and the model's window, passing budget_chars lower when the window is small, before the first plan.
  4. Extract with page anchors. For each range run <PY_MUPDF> extract_pymupdf.py <file> --pages <start0>-<end0> (0-indexed; plain text with a --- Page N/M --- line before each page, which is the page anchor to keep; that number is the PDF page index, so when the printed page numbers differ (roman front matter) record the offset and give both) or <PY_DOCS> pdf_split.py <file> --pages <start>-<end> -o <range>.pdf (1-based, JSON) followed by read_file on the split file (for an encrypted file use pdf_split.py --password or pdf_read.py --text --password; extract_pymupdf.py has no --password and cannot open it). Never read the whole file with read_file and paginate by offset: every call re-converts the entire document, and the extraction has no page numbers. If a range read truncates, halve the range, record the observed characters per page in the range's mark note, and read the range in two halves; do not plan again with new numbers, which creates a new plan with an empty ledger.
  5. Delegate above 4 ranges. Send each range to a delegate_task child with this brief, unchanged except for the page numbers, then merge the notes in page order keeping every page anchor: Read pages <start>-<end> only. Return: page-anchored key points, every defined term or obligation with its page, open questions, and the exact pages you could not read. Do not summarize pages outside this range. A child sees only its goal and context, so put the absolute <PY_MUPDF> path and the exact command in its context: <PY_MUPDF> <scripts dir>/extract_pymupdf.py <file> --pages <start0>-<end0> (0-indexed), with the extractor given by absolute path (find the pdf skill's scripts directory with skills_list or search_files) because a bare script name fails from a child's working directory. For an encrypted file the parent first splits each range with <PY_DOCS> <scripts dir>/pdf_split.py <file> --password ... --pages <start>-<end> -o <range>.pdf and gives the child that split file; the child runs <PY_MUPDF> <scripts dir>/extract_pymupdf.py <range>.pdf with no --pages (the range's 0-indexed numbers return nothing on a split file), and its --- Page N/M --- anchors count from 1, so the parent adds the range's start page minus one when merging. A child that returns no missing-page list has not proven its range was readable.
  6. Close every range. After each range mark it (omh_document_plan action=mark, plan_id, chunk, state=covered) or write covered / next / missing into the ledger file before moving on, so a compacted or resumed session rereads the ledger and continues from next instead of page 1. Say done only when every row is covered and every scanned range is read or declined.
  7. Scanned ranges. The read_file coverage warning names page ranges that yielded no text. For the few pages the goal needs, run <PY_DOCS> pdf_page_image.py <file> --pages <n> --out-dir <dir> and vision_analyze one page per call; the script exits 0 either way, so a result with "rendered": false means no rasterizer (pypdfium2 or poppler pdftoppm) is installed and nothing was rendered. Hosted OCR is not a knob to turn on: read_file uses it by itself when FIRECRAWL_API_KEY is set (file_tools.hosted_ocr: false turns it off), and its NEEDS OCR notice says whether it was attempted. For bulk OCR of a large range the coverage warning points at marker-pdf, extract_marker.py from the same skill, a multi-gigabyte install that needs its own approval. Decline ranges the goal does not need and record the decision: a 300-page scan at one vision call per page is a separate approved job, not a side effect of a summary.

Runtime Evidence

Preferred harness for this skill: long-document-reading.

omh runtime record --skill long-document-reading --harness long-document-reading --status started

Record observed delegation results; otherwise return not_available or not_observed.

Prepared OMH routing is not execution, review, CI, merge-readiness, or merge evidence.

Preserve workflow intent and stop conditions; verify before claiming completion.

Reply in the user's own words and the host's own voice: its SOUL.md persona owns reply language, tone, speech level, and sentence endings, progress updates included (where it sets no language, use the one the user wrote in), and OMH shapes structure and content only. When the requested output is delivered, put any open points inside the result and end with no question or offer; only when the person asked to choose or decide and that choice is still theirs, end with one specific question about it, not a list, a generic offer, or a footer; the shared rail's Reply Language And Host Voice and Turn Ending sections hold the full rule.

Use Hermes-native subagent/delegation features when available: native subagents -> Hermes delegation when available, otherwise sequential lanes.

Shared product, compatibility, topology, memory, harness, and execution rules: skill_view(name='omh-routing', file_path='references/skill-common-rail.md'). Load it when applicable; otherwise name an unavailable capability.

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.