PDF Skill
Teaches an agent to read, split, merge, and create PDF files with Python libraries, covering the most common PDF operations in document automation.
Skill is local-only PDF guidance (pypdf/pdfplumber/reportlab): no network calls, no credential handling, no destructive operations; least privilege is good. Deducted for missing data-flow disclosure, rollback guidance, and unverified publisher attribution.
Examples are self-consistent and the guidance (inspect extracted text before writing parsers) is sound; static review only confirms the happy path. No handling of encrypted PDFs or partial extraction, no verified tests covering this skill path; capped at 10 by static calibration.
Trigger scenarios (read/create/split/merge PDFs) are clear and description matches content; deducted for undeclared non-fit boundaries, hardcoded dependency on /work/.venv with pre-installed packages, and no Chinese-language or mainland-China accessibility notes.
Repo-level MIT license, versioning and CI exist; the skill file itself has no version, changelog, FAQ, known-limitations, or maintenance ownership, and documentation layering is thin.
Provides directly usable code snippets with marginal value in the inspect-then-parse workflow; no verified outputs and static cap of 7 applies, deducted for limited completeness evidence.
Snippets are auditable primary material with no marketing overclaim; deducted because CI tests do not cover this skill's key paths and no executed third-party evidence exists; static cap of 5.
- Static review only; no code was executed, confidence is low.
- The skill assumes pypdf/pdfplumber/reportlab are pre-installed in /work/.venv and will not run directly outside that workbench environment.
- Examples do not address encrypted PDFs, scanned/OCR input, or corrupted files.
- This is an eval demo skill, not a production PDF tool; no per-skill version or maintenance commitment is provided.
- Content is English-only with no Chinese-language guidance.
What does this skill do, and when should you use it?
This is a lightweight reference skill located in the skill-optimizer repository's workbench examples (examples/workbench/pdf/references/pdf-skill/SKILL.md). It contains no scripts; instead, it instructs the agent to use three pre-installed Python libraries in /work/.venv — pypdf, pdfplumber, and reportlab — for reading, text extraction, page splitting, page filtering, and creating PDFs. Its key workflow principle: always inspect the actually extracted text before writing parsing regexes, never guess field formats from the task prompt. It also serves as the evaluated example for the skill-optimizer workbench, demonstrating positive cases (extraction, splitting, creation) and a negative case (the agent should not read this skill file for non-PDF tasks).
The skill runs as pure instructions: it guides the agent to call pypdf to read and write/split pages, pdfplumber to extract text, and reportlab to create new PDFs. SKILL.md provides four reusable code examples: extracting and joining text per page with PdfReader; parsing unstructured text line-by-line via prefixes ("Account:", "Total Revenue:", etc.) into a structured answer. including currency cleaning and a risk-flag list; filtering pages by page number into a new file; and filtering pages by extracted text content (containing "CUSTOMER COPY" but not "INTERNAL NOTES").
- Data workers who need to pull fields like account numbers, quarters, or revenue from statement-style PDFs into JSON
- Operations or support staff who need to split a multi-page customer packet into customer-copy pages, excluding internal notes
- Everyday office scenarios requiring splitting large PDFs by page or extracting selected pages into a new file
- Developers generating new PDF reports from scratch via code
- Agent developers writing deterministic evals for PDF tasks, who can use this example's suite and grader organization as a template
What are this skill's strengths and limitations?
- Zero script dependencies — a pure instruction skill, portable to nearly any agent client with filesystem and Python access
- Complete, directly reusable example code covering the four high-frequency operations of extraction, parsing, splitting, and filtering
- Enforces the "inspect text before parsing" discipline, greatly reducing regex failures based on guesswork
- Ships with skill-optimizer eval cases to verify tasks complete reliably
- It is an eval demo skill with deliberately narrow coverage — no OCR, encrypted PDFs, or table reconstruction
- Depends on the specific /work/.venv path; copying elsewhere requires manually installing three Python libraries
- No version number or standalone maintenance notes; as an example file it may change as the repo evolves
- SKILL.md offers no error handling or fallback guidance
How do you install this skill?
The skill is an example file inside the skill-optimizer repository (fastxyz/skill-optimizer, MIT license) at examples/workbench/pdf/references/pdf-skill/SKILL.md. The repo supports multiple install methods overall, e.g. Claude Code: /plugin marketplace add fastxyz/skill-optimizer then /plugin install skill-optimizer@skill-optimizer; or the generic skills CLI: npx skills add fastxyz/skill-optimizer -a claude-code -y. To use only this PDF skill file, copy the SKILL.md into your client's skill directory; no dedicated install command for this single file is documented.
How do you use this skill?
Place the SKILL.md in your agent's skill directory and issue a PDF task directly, e.g. "Extract account and total revenue from statement.pdf into answer." or "Split customer-packet.pdf into a customer-copy-only file". The skill expects pypdf, pdfplumber, and reportlab installed in /work/.venv; in other environments, pip install them first. Core workflow: print the extracted text to confirm the actual format before writing field parsing logic.