pdf

pdf is a skill for Claude Code, Codex 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 CodeCodex

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

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.

agentmods
npx agentmods add skills/fastxyz/skill-optimizer/pdf-skill
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00023 $0.00560
Opus 5 $0.00012 $0.00280
Sonnet 5 $0.00005 $0.00112
Haiku 4.5 $0.00002 $0.00056

Measured 4d ago against content hash 07f852b05c31, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 (77 stars, last pushed 3mo ago), licensed MIT. It adds 23 tokens to every session and 560 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

pdf

PDF manipulation toolkit. Extract text/tables, create PDFs, merge/split, fill forms, for programmatic document processing and analysis.

benchflow-ai/skillsbench · 29 tokens

scan-to-practice

A complete methodology for turning scanned or image-based learning materials into high-quality desktop, web, or mobile practice products. Covers visual transcription, data assembly, answer-key-driven controls and grading, product design, animation, validation, and long-term maintenance. Use when a user wants to…

parz0val0/scan-to-practice · 89 tokens

mineru

An AI-Native skill for parsing PDF / Office / image files into clean Markdown with MinerU — a fast, zero-config document parser for AI agents. Works with NO token via the lightweight Agent API and auto-upgrades to the Standard API (token) for large files, batches, and DOCX/HTML/LaTeX export. Use when: (1) Converting…

Nebutra/MinerU-Skill · 137 tokens

mineru

An AI-Native skill for parsing PDF / Office / image files into Markdown with MinerU — a fast, zero-config document parser for AI agents. Works with NO token via the Agent API and auto-upgrades to the Standard API (token) for large files, batches, and DOCX/HTML/LaTeX export. Use when converting PDF/Word/PPT/Excel/image…

Nebutra/MinerU-Skill · 96 tokens

file-organizer-by-subject

Organize files into subject folders using keyword-based classification of titles and abstracts, with fallback to full text extraction.

cxcscmu/SkillLearnBench · 29 tokens

pdf-calendar-extractor

Extract text and identifying colored regions (e.g., rectangles) from a PDF using pdfplumber.

cxcscmu/SkillLearnBench · 25 tokens