Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add kennethkhoocy/legal-scholarship-skills --skill pdfgit clone --depth 1 https://github.com/kennethkhoocy/legal-scholarship-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kennethkhoocy/legal-scholarship-skills/pdf)<a href="https://agentmods.dev/skills/kennethkhoocy/legal-scholarship-skills/pdf"><img src="https://agentmods.dev/badge/skills/kennethkhoocy/legal-scholarship-skills/pdf/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kennethkhoocy/legal-scholarship-skills/pdf"><img src="https://agentmods.dev/badge/skills/kennethkhoocy/legal-scholarship-skills/pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Rogue Agent · line 52 Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00143 | $0.03322 |
| Opus 5 | $0.00072 | $0.01661 |
| Sonnet 5 | $0.00029 | $0.00664 |
| Haiku 4.5 | $0.00014 | $0.00332 |
Grade A, and why
pdf scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PDF Skill — Unified Extraction and Manipulation
One auto-triggered entry point for all PDF work. The skill probes the PDF first, then routes to the cheapest sufficient backend. GPU OCR (LightOnOCR-2-1B, ~3 GB VRAM) is reserved for scans; dolphin v2 remains as fallback.
Step 1 — Probe first (ALWAYS)
Run this before any other PDF action:
python ~/.claude/skills/pdf/scripts/probe_pdf.py <input.pdf>
The probe returns JSON with:
classification: one ofencrypted,scanned,born_digital_footnotes,born_digital_simple,born_digital_formulas,born_digital_tables,born_digital_complex,uncertain,errorformula_density: fraction of sampled pages carrying a math signal (math fonts such as CMMI/CMSY/CMEX, or math glyphs). Above0.2the PDF is classifiedborn_digital_formulasand must be routed to a LaTeX-capable backend.footnote_density: fraction of sampled pages that look footnote-bearing. At/above0.5the PDF is classifiedborn_digital_footnotesand routed to Docling-direct, which reconstructs footnotes (and emits formula LaTeX) — opendataloader-pdf discards footnote structure.recommended_backend: one ofhalt_password_required,lightonocr,docling,pypdf,pdfplumber,opendataloader_hybrid,opendataloader_then_lightonocr,fallback(doclingdrivesscripts/docling_extract.py, the footnote-and-formula-aware path;lightonocrdrivesscripts/lightonocr_run.py)reasoning: one-sentence rationalewarnings: list of strings; non-empty when a density-measurement helper (pdfplumber image/table probes) failed. When present, the classifier will not returnborn_digital_simpleeven if other signals look clean.
Cost: ~1 second, no GPU. Use the result to pick the next step.
Step 2 — Route by task
A. The user wants to READ / EXTRACT content from a PDF
Read extraction.md. Follow its decision tree based on the probe's classification:
| Classification | Backend |
|---|---|
encrypted |
Halt; ask the user for a password; re-probe. |
scanned |
scripts/lightonocr_run.py (GPU, ~3 GB VRAM, ~1–2 s/page, LaTeX-aware). Fallback: dolphin (7.5 GB VRAM, ~10 s/page). |
born_digital_footnotes |
scripts/docling_extract.py — footnote-aware (inlines each footnote at its reference point as a pandoc inline footnote ^[…], and routes any note whose marker cannot be located to an ## Endnotes section so nothing is dropped) and formula-aware (LaTeX). The right path for academic papers (math or not). Then run sanitize_math.py. See extraction.md §"Footnotes + academic papers → Docling". |
born_digital_simple |
pypdf.extract_text() (instant). |
born_digital_formulas |
opendataloader-pdf --hybrid docling-fast with --enrich-formula (emits equations as LaTeX), OR docling_extract.py if footnotes also matter. Escalate to lightonocr if equations are images. See extraction.md §"Math-heavy → LaTeX". |
born_digital_tables |
pdfplumber.extract_tables(). |
born_digital_complex |
opendataloader-pdf --hybrid docling-fast. |
uncertain |
opendataloader-pdf first; escalate to lightonocr if output is empty or has high (cid:N) ratio. |
What ships with it
29 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- .gitignore 385 B
- extraction.md 30 KB
- manipulation.md 8.3 KB
- README.md 8.5 KB
- scripts/clean_garbled_fragments.py 12 KB runs code
- scripts/docling_extract.py 23 KB runs code
- scripts/dolphin_run.py 7.3 KB runs code
- scripts/extract_annotations.py 3.4 KB runs code
- scripts/extract_figures.py 6.6 KB runs code
- scripts/katex_validate.js 1.0 KB runs code
- scripts/lightonocr_run.py 8.8 KB runs code
- scripts/opendataloader_convert.py 25 KB runs code
- scripts/probe_pdf.py 21 KB runs code
- scripts/render_region.py 2.5 KB runs code
- scripts/sanitize_math.py 11 KB runs code
- scripts/vendor/KATEX-LICENSE 1.1 KB
- scripts/vendor/katex.min.js 265 KB runs code
- scripts/verify_extraction.py 14 KB runs code
- tests/__init__.py 0 B runs code
- tests/conftest.py 1.2 KB runs code
- tests/fixtures.py 10 KB runs code
- tests/test_clean_garbled_fragments.py 4.8 KB runs code
- tests/test_docling_extract.py 17 KB runs code
- tests/test_dolphin_run.py 6.2 KB runs code
- tests/test_extract_form_field_info.py 2.1 KB runs code
- tests/test_lightonocr_run.py 2.6 KB runs code
- tests/test_opendataloader_convert.py 14 KB runs code
- tests/test_probe_pdf.py 15 KB runs code
- tests/test_sanitize_math.py 6.3 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 149 lines · 143 tokens per session scan A 79afac191ecf
pdf is a skill published in the GitHub repository kennethkhoocy/legal-scholarship-skills (9 stars, last pushed 7d ago), licensed MIT. It adds 143 tokens to every session and 3,322 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
download-fulltext-pdf
A skill for downloading a research paper's complete PDF using an identifier such as a DOI, title, or BibTeX entry.
markdown-to-pdf
Convert Markdown (.md) files to a polished PDF with ALL images preserved and scaled to the page. Use whenever the user asks to "save this markdown as a PDF", "convert README.md to pdf", "export the .md as a pdf", "turn these notes/docs into a PDF", or wants a PDF deliverable of any GitHub-flavored Markdown document…
report-helper
A Chinese-language research workflow that searches the internet and produces a formatted PDF report about a specified topic.
download-gated-pdfs
Download the actual PDF binary from bot-gated sites (taxpolicycenter.org, urban.org, SSRN-hosted mirrors, think-tank/publisher sites) via the Wayback Machine id URL form. Use when: (1) curl/WebFetch of a .pdf URL returns HTML instead of a PDF even with a browser User-Agent, (2) pypdf fails with "invalid pdf header…
pdf-analyze
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
pdf-processing
Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.