pdf

pdf is a skill for Claude Code from kennethkhoocy/legal-scholarship-skills. It costs 143 tokens per session (3,322 once invoked), scanned A, original, MIT.

A PDF file assistant for reading, extracting, creating, combining, splitting, rotating, watermarking, encrypting, decrypting, and scanning PDF documents.

In plain words
What is it for?
Use it to extract text, tables, or formulas; run OCR on scanned PDFs; and manipulate PDF files.
Why use it?
It routes each PDF task according to the document type, including scanned pages, formulas, tables, footnotes, and password-protected files.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the legal-scholarship plugin — 7 skills shipped together

Good fit Use it to extract text, tables, or formulas; run OCR on scanned PDFs; and manipulate PDF files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kennethkhoocy/legal-scholarship-skills/pdf
Install

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.

Any agent
npx skills add kennethkhoocy/legal-scholarship-skills --skill pdf
Clone the repo
git clone --depth 1 https://github.com/kennethkhoocy/legal-scholarship-skills

Made for: Claude Code.

Or install legal-scholarship, the plugin that ships this one along with the rest of its 7 skills.

Wrote 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.

agentmods badge for pdf

README.md
[![agentmods](https://agentmods.dev/badge/skills/kennethkhoocy/legal-scholarship-skills/pdf/github.svg)](https://agentmods.dev/skills/kennethkhoocy/legal-scholarship-skills/pdf)
Your own site
<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.

agentmods 80×15 button for pdf

Your own site · 80×15
<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>
Per session 143 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,322 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
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.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 12d ago against content hash 79afac191ecf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 24 executable files (scripts/clean_garbled_fragments.py, scripts/docling_extract.py, scripts/dolphin_run.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/legal-scholarship/skills/pdf/SKILL.md · 149 lines

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 of encrypted, scanned, born_digital_footnotes, born_digital_simple, born_digital_formulas, born_digital_tables, born_digital_complex, uncertain, error
  • formula_density: fraction of sampled pages carrying a math signal (math fonts such as CMMI/CMSY/CMEX, or math glyphs). Above 0.2 the PDF is classified born_digital_formulas and must be routed to a LaTeX-capable backend.
  • footnote_density: fraction of sampled pages that look footnote-bearing. At/above 0.5 the PDF is classified born_digital_footnotes and routed to Docling-direct, which reconstructs footnotes (and emits formula LaTeX) — opendataloader-pdf discards footnote structure.
  • recommended_backend: one of halt_password_required, lightonocr, docling, pypdf, pdfplumber, opendataloader_hybrid, opendataloader_then_lightonocr, fallback (docling drives scripts/docling_extract.py, the footnote-and-formula-aware path; lightonocr drives scripts/lightonocr_run.py)
  • reasoning: one-sentence rationale
  • warnings: list of strings; non-empty when a density-measurement helper (pdfplumber image/table probes) failed. When present, the classifier will not return born_digital_simple even 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.

Read the full file on GitHub · 149 lines

Changes

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.

  1. 12d ago First seen · 149 lines · 143 tokens per session scan A 79afac191ecf

Subscribe to this mod's changes

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.

Related

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.

huangwb8/skills · 105 tokens

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…

kennethkhoocy/applied-micro-skills · 188 tokens

report-helper

A Chinese-language research workflow that searches the internet and produces a formatted PDF report about a specified topic.

Jiaranbb/report-helper · 92 tokens

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…

kennethkhoocy/applied-micro-skills · 137 tokens

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.

aiskillstore/marketplace · 52 tokens

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.

aiskillstore/marketplace · 36 tokens