pdf

pdf is a skill for Claude Code from fastxyz/skill-optimizer. It costs 23 tokens per session (560 once invoked), scanned A, original, MIT.

A skill for working with PDF files, including reading, creating, splitting, merging, and extracting their text. It uses PDF tools and requires inspecting the document's actual text before writing parsing rules.

In plain words
What is it for?
Use it to extract text, read structured documents, create PDFs, split or merge pages, and parse fields after inspecting the source.
Why use it?
It reduces errors caused by assuming how a PDF is structured or how its fields are labelled. It provides a defined approach for turning PDF contents into usable data.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skill-optimizer plugin — 2 skills shipped together

Good fit Use it to extract text, read structured documents, create PDFs, split or merge pages, and parse fields after inspecting the source.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fastxyz/skill-optimizer/pdf-skill
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 fastxyz/skill-optimizer --skill pdf-skill
Clone the repo
git clone --depth 1 https://github.com/fastxyz/skill-optimizer

Made for: Claude Code.

Or install skill-optimizer, the plugin that ships this one along with the rest of its 2 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/fastxyz/skill-optimizer/pdf-skill/github.svg)](https://agentmods.dev/skills/fastxyz/skill-optimizer/pdf-skill)
Your own site
<a href="https://agentmods.dev/skills/fastxyz/skill-optimizer/pdf-skill"><img src="https://agentmods.dev/badge/skills/fastxyz/skill-optimizer/pdf-skill/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/fastxyz/skill-optimizer/pdf-skill"><img src="https://agentmods.dev/badge/skills/fastxyz/skill-optimizer/pdf-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 560 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.
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.00023 $0.00560
Opus 5.5 $0.00009 $0.00224
Sonnet 5.5 $0.00005 $0.00112
Haiku 4.5 $0.00002 $0.00056

Measured 1mo ago against content hash 07f852b05c31, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

examples/workbench/pdf/references/pdf-skill/SKILL.md · 83 lines

What it actually says

PDF Skill Demo

Use Python packages installed in /work/.venv for PDF work. Common choices:

  • pypdf for reading, splitting, and writing pages
  • pdfplumber for extracting text from PDFs
  • reportlab for creating new PDFs

Always inspect the extracted text before writing parsing regexes. Do not guess labels or field formats from the task prompt.

Example text extraction:

from pypdf import PdfReader

reader = PdfReader("input.pdf")
text = "\n".join(page.extract_text() or "" for page in reader.pages)
print(text)

Example structured extraction after inspecting text:

from pypdf import PdfReader
import json

reader = PdfReader("statement.pdf")
text = "\n".join(page.extract_text() or "" for page in reader.pages)
lines = [line.strip() for line in text.splitlines() if line.strip()]

answer = {"riskFlags": []}
for line in lines:
    if line.startswith("Account:"):
        answer["account"] = line.split(":", 1)[1].strip()
    elif line.startswith("Quarter:"):
        answer["quarter"] = line.split(":", 1)[1].strip()
    elif line.startswith("Total Revenue:"):
        raw = line.split(":", 1)[1].strip().replace("$", "").replace(",", "")
        answer["totalRevenue"] = float(raw)
    elif line.startswith("Risk Flag:"):
        answer["riskFlags"].append(line.split(":", 1)[1].strip())
    elif line.startswith("Approval Code:"):
        answer["approvalCode"] = line.split(":", 1)[1].strip()

with open("answer.json", "w") as output:
    json.dump(answer, output, indent=2)

Example page filtering:

from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()
writer.add_page(reader.pages[0])

with open("output.pdf", "wb") as output:
    writer.write(output)

Example page filtering by extracted page text:

from pypdf import PdfReader, PdfWriter

reader = PdfReader("customer-packet.pdf")
writer = PdfWriter()

for page in reader.pages:
    text = page.extract_text() or ""
    if "CUSTOMER COPY" in text and "INTERNAL NOTES" not in text:
        writer.add_page(page)

with open("customer-copy.pdf", "wb") as output:
    writer.write(output)
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. 1mo ago First seen · 83 lines · 23 tokens per session scan A 07f852b05c31

Subscribe to this mod's changes

pdf is a skill published in the GitHub repository fastxyz/skill-optimizer (81 stars, last pushed 4mo ago), licensed MIT. It adds 23 tokens to every session and 560 once invoked, about $0.0001 per session on Opus 5.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-30.

Related

Other skills, from other repositories

report-to-pdf

Narrow conversion skill. Invoke only when the user explicitly asks to convert an existing Data Analytics report, dashboard, or inline chart export into a PDF artifact.

XiaomiMiMo/MiMo-Code · 36 tokens

pdf-official

Use this skill whenever a PDF file is being produced, opened, transformed, filled, or read. That includes: extracting text or tables from an existing PDF; combining, carving, rotating, cropping, or watermarking pages; composing a fresh PDF (report, invoice, certificate); filling AcroForm fields or overlaying text onto…

XiaomiMiMo/MiMo-Code · 135 tokens

pdf

Read, extract, split, merge, rotate, watermark, fill, OCR, or create PDF files with verification of page counts and text extraction.

Hmbown/CodeWhale · 31 tokens

ulw-research

Runs maximum-saturation research with a cooperating team, claim-graph gating, and a cited, QA'd deliverable. Use when the user explicitly asks for research or a deep investigation, including any 'ulw' research wording.

code-yeongyu/lazycodex · 51 tokens

recipe-bulk-download-folder

List and download all files from a Google Drive folder.

googleworkspace/cli · 17 tokens

figures

Makes publication-quality plots from data with matplotlib, learning curves, scaling laws, benchmark and ablation comparisons, Pareto trade-offs, heatmaps and confusion matrices, sized for the page, vector, with uncertainty shown. Use whenever results are plotted, charted or visualized for a paper, report or answer, or…

synthetic-sciences/openscience · 99 tokens