Agent skill

PDF Toolkit

by TokenRhythm in TokenRhythm/opensquilla

Deterministic PDF operations through bundled scripts: extract text and tables, merge files or page ranges, split by range, fill form fields and build PDFs from data.

Apache-2.0Auto-check passedDocuments & Office

Install PDF Toolkit

skills CLI
$ npx skills add TokenRhythm/opensquilla --skill pdf-toolkit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TokenRhythm/opensquilla pdf-toolkit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TokenRhythm/opensquilla.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/opensquilla/skills/bundled/pdf-toolkit .claude/skills/pdf-toolkit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pdf-toolkit
GitHub stars
7.1k
Token cost
~1.9k tokens
SKILL.md length
646 words
Files
8 (incl. scripts, references)
Skills in repo
8
Repo updated
First seen
Licence
Apache-2.0

At a glance

Deterministic PDF operations through bundled scripts: extract text and tables, merge files or page ranges, split by range, fill form fields and build PDFs from data.

  • Pulling tables or text out of a report PDF
  • SKILL.md covers Decide the operation, Path A: Extract, Path B: Merge / Split and Path C: Form fill, plus 4 more sections
  • Runs Python scripts from its folder; calls python
  • Combining several PDFs or selected page ranges into one file

What it does

A set of structural PDF operations for jobs where you know exactly what you want done. The agent picks a bundled script by goal: `extract.py` for text and tables, `merge.py` to combine files or page ranges, `split.py` to cut a PDF by page ranges, `form_fill.py` to fill text form fields, and an inline reportlab snippet to build a new PDF from data. For a natural-language rewrite the agent drafts the new content first and then uses these operations to produce the file.

Extraction uses pdfplumber, which keeps column layout better than naive extraction, with `--tables-strategy` to switch table detection between lines, text and explicit modes, and `--json` for structured output. Merge accepts file names or a JSON manifest with 1-based page ranges per file, and split writes one numbered file per range. Scanned PDFs are out of scope because no OCR engine is included, and the skill points to a sibling OCR skill. Work stays in a restricted workspace, and the finished PDF is published as an artifact.

When your agent uses it

  • Pulling tables or text out of a report PDF
  • Combining several PDFs or selected page ranges into one file
  • Splitting a PDF by page ranges
  • Filling a form PDF's text fields from data

Example prompts

  • “Extract the tables from ./reports/annual.pdf as JSON.”
  • “Combine pages 1-3 of cover.pdf with all of appendix.pdf.”
  • “Split input.pdf into pages 5-12 and the rest.”
  • “Fill the text fields in ./forms/tax.pdf from the values in my details.json.”

Requirements

  • Python with pypdf, pdfplumber and reportlab

What it can do on your machine

Read from SKILL.md and the folder at commit 4494195. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 4 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

PDF Toolkit loads about 1.9k tokens when it runs, and up to ~3.4k if it reads all its reference files. Until then it costs about 112 tokens; SKILL.md has 646 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~112
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from TokenRhythm/opensquilla at commit 4494195, republished under its Apache-2.0 licence (© TokenRhythm). 646 words, ~1,914 tokens.

Download SKILL.mdSave it as .claude/skills/pdf-toolkit/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
pdf-toolkit
description
Structured `.pdf` operations: extract text/tables, merge pages from multiple PDFs, split a PDF by page ranges, fill PDF form fields, and generate fresh PDFs from JSON. Trigger when the user wants deterministic programmatic PDF work — examples: pull tables from a report, combine three PDFs, extract pages 5-12, fill a tax form, or build a new PDF from data. This is the single public PDF entry and uses pypdf, pdfplumber, and reportlab.
visibility
public
invocation
direct
description_zh
结构化的 .pdf 操作:提取文本/表格、合并多个PDF的页面、按页码范围拆分PDF、填写PDF表单字段以及从JSON生成新PDF。当用户需要确定性的程序化PDF处理时触发,例如从报告提取表格、合并三个PDF、提取第5-12页、填写税表或用数据构建新PDF。本技能是唯一公开的 PDF 入口,通过…
homepage
https://pypdf.readthedocs.io/
provenance.origin
clawhub-mit0
provenance.license
MIT-0
provenance.upstream_url
https://clawhub.ai/pdf
provenance.maintained_by
OpenSquilla

pdf-toolkit

Deterministic, structural PDF operations. Use this skill for programmatic work where you know exactly what you want done. For a natural-language rewrite, first draft the replacement content with ordinary reasoning, then use the explicit extract/generate/merge operations here to create the final PDF.

Use the inline Python examples with execute_code in a restricted channel. Keep files in the active workspace and call publish_artifact with the finished PDF. Shell commands below require an available exec_command; they are optional shortcuts, not a reason to request host execution. If the sandbox or a required library is unavailable, report the limitation rather than retrying outside the sandbox.

Decide the operation

GoalScript
Get text or tables out of a PDFextract.py
Combine pages from multiple PDFsmerge.py
Split a PDF by page rangessplit.py
Fill /Tx form fields in a PDFform_fill.py
Build a new PDF from datainline reportlab snippet, see Path C below

Path A: Extract

bash
python {baseDir}/scripts/extract.py /path/to/doc.pdf --json

Output:

json
{
  "pages": 12,
  "metadata": {"title": "...", "author": "..."},
  "text": [
    {"page": 1, "content": "..."},
    {"page": 2, "content": "..."}
  ],
  "tables": [
    {"page": 3, "rows": [["..."], ["..."]]}
  ]
}

Text uses pdfplumber (already in default dependencies) which preserves column layout better than naive PDF text extraction. Tables use pdfplumber.extract_tables() with default settings; for tricky layouts pass --tables-strategy lines|text|explicit to switch detection mode.

For OCR (scanned PDFs), this skill does not include Tesseract — use the sibling skill that wraps an OCR engine (out of scope here).


Path B: Merge / Split

Merge full files:

bash
python {baseDir}/scripts/merge.py a.pdf b.pdf c.pdf --out combined.pdf

Or merge specific page ranges with the manifest form:

bash
python {baseDir}/scripts/merge.py manifest.json --out combined.pdf

manifest.json:

json
[
  {"file": "a.pdf", "pages": "1-3"},
  {"file": "b.pdf", "pages": "5,7,9-11"},
  {"file": "c.pdf"}
]

Page ranges are 1-based, comma-separated, hyphen for ranges. Omit pages to include the whole file. Splits use the same syntax in reverse:

bash
python {baseDir}/scripts/split.py input.pdf --pages "1-3,7,10-12" --out output_dir/

Each range writes one output file: output_dir/input_001.pdf, output_dir/input_002.pdf, …


Path C: Form fill

bash
python {baseDir}/scripts/form_fill.py form.pdf data.json --out filled.pdf

data.json maps field name → string value:

json
{
  "applicant_name": "Wei E.",
  "submission_date": "2026-05-06",
  "agreed": "Yes"
}

The script discovers fields via pypdf.PdfReader.get_fields() and updates them with update_page_form_field_values(). Fields not present in the JSON are left untouched. Run with --list-fields to enumerate the form's fields without filling.

Caveats:

  • /Btn checkbox fields take the export value (often Yes, On, or 1) rather than true — inspect with --list-fields to discover.
  • AcroForm fills only. XFA forms (used by some legal templates) require Adobe-specific tooling and are out of scope.
  • Some signed PDFs invalidate the signature when fields change. Strip signatures explicitly with --clear-signatures if that is intended.

Show full SKILL.md (291 more words)Show less

Path D: Generate from scratch

Use reportlab directly when you need a new PDF:

python
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import LETTER
from pathlib import Path

c = canvas.Canvas(str(Path("out.pdf")), pagesize=LETTER)
c.setFont("Helvetica-Bold", 18)
c.drawString(72, 720, "Q3 Review")
c.setFont("Helvetica", 11)
c.drawString(72, 696, "Revenue grew 18% year over year.")
c.showPage()
c.save()

For Chinese text, register a CJK font instead of Helvetica. ReportLab's CID font works without downloading fonts or reading a user font directory:

python
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.cidfonts import UnicodeCIDFont
from reportlab.pdfgen import canvas

pdfmetrics.registerFont(UnicodeCIDFont("STSong-Light"))
c = canvas.Canvas("report.pdf")
c.setFont("STSong-Light", 14)
c.drawString(72, 760, "季度报告:收入增长")
c.save()

CID fonts rely on PDF reader CJK support. When an embedded font is required, use a licensed font already available inside the workspace or permitted system font roots. Validate the text with pypdf before publishing.

For tables, headers/footers, and multi-column layouts, switch to reportlab.platypus (SimpleDocTemplate, Paragraph, Table, PageBreak). See references/reportlab.md.


Natural-language changes

This public entry deliberately keeps the PDF mutation step deterministic. For requests such as "make the title shorter", inspect the source page, draft the replacement text with the model, and generate a new document with the reviewed content. Do not claim that arbitrary in-place page rewriting is available.


Common pitfalls

SymptomCauseFix
Extracted text is emptyScanned PDF, no text layerOCR is out of scope; use a separate OCR skill
Garbled characters in extractPDF uses a custom font encodingTry pdfplumber.open(path, laparams={...}) with char_margin adjustments
Merged PDF is hugeUnderlying PDFs include large embedded fontsSubset fonts via pypdf compress_content_streams()
Form fill silently no-opsField name in JSON does not match PDF field nameRun with --list-fields first to see exact names
Pages out of order after splitRange overlap collapsed unexpectedlyUse disjoint ranges, e.g. 1-3,4-6 not 1-5,3-6

Boundaries

  • This skill works with text-based and form-based PDFs. Scanned image PDFs need OCR before any text path produces results.
  • Encrypted PDFs are read-only here. Decryption requires the user-supplied password and is out of scope for this skill.
  • For PDF-to-image rendering, use a separate skill that wraps Poppler or PyMuPDF.
  • Digital signature operations (signing, verifying, revoking) are out of scope.

© TokenRhythm, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references) in src/opensquilla/skills/bundled/pdf-toolkit of TokenRhythm/opensquilla.

  • SKILL.md
  • THIRD_PARTY_NOTICES.md
  • references/pypdf.md
  • references/reportlab.md
  • scripts/extract.py
  • scripts/form_fill.py
  • scripts/merge.py
  • scripts/split.py

Open the folder on GitHubat commit 4494195

Compare with similar skills

PDF Toolkit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

PDF Toolkit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PDF Toolkit this skillTokenRhythm/opensquilla7.1k—~1.9kAutomated safety check: PassApache-2.0
PDF Processinganthropics/skills180k48 repos~2kAutomated safety check: PassProprietary
PDF Processing with PythonHKUDS/DeepTutor41k—~2.7kAutomated safety check: PassApache-2.0
PDF ToolkitXiaomiMiMo/MiMo-Code14k—~1.7kAutomated safety check: PassApache-2.0
PDF Generation, Forms and Extractionpipeshub-ai/pipeshub-ai3.8k—~2.9kAutomated safety check: PassApache-2.0
PDF Processing Guideagentscope-ai/QwenPaw35k—~1.8kAutomated safety check: PassProprietary

Similar skills

  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 48 repos~2k tokens
    Documents & OfficeAuto-check passed
  • Reads, extracts from, creates, merges, splits, watermarks, encrypts and fills PDF files with pdfplumber, pypdf and reportlab inside a Python sandbox.

    41k GitHub stars~2.7k tokensUpdated 3 days ago
    Documents & OfficeAuto-check passed
  • PDF Toolkit

    XiaomiMiMo/MiMo-Code

    Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.

    14k GitHub stars~1.7k tokensUpdated 4 days ago
    Documents & OfficeAuto-check passed
  • Picks the right library for generating a new PDF, filling an existing PDF form, or extracting text and tables, defaulting to Node where possible.

    3.8k GitHub stars~2.9k tokensUpdated today
    Documents & OfficeAuto-check passed
  • PDF Processing Guide

    agentscope-ai/QwenPaw

    Handles PDF tasks with Python libraries and command-line tools: extract text and tables, merge, split, rotate, create, fill forms and more.

    35k GitHub stars~1.8k tokensUpdated 7 days ago
    Documents & OfficeAuto-check passed
  • PDF Processing Toolkit

    telagod/code-abyss

    Picks the right Python library or CLI tool for a PDF task, text and table extraction, merging, splitting, OCR, watermarking or form filling, and points to a matching recipe.

    244 GitHub stars~532 tokensUpdated 2 mo ago
    Documents & OfficeAuto-check: notes

More from TokenRhythm/opensquilla

All 8 skills in this repo
  • Deep Research Workflow

    TokenRhythm/opensquilla

    Runs multi-round research in three stages with a persisted state file, evidence tracking and a long-form report with per-claim citations.

    7.1k GitHub stars~1.3k tokensUpdated 3 days ago
    Auto-check passed
  • Word DOCX Toolkit

    TokenRhythm/opensquilla

    Inspects, edits in place or creates Word .docx files with bundled Python scripts, keeping existing styles intact when content changes.

    7.1k GitHub stars~1.7k tokensUpdated 3 days ago
    Auto-check passed
  • HTML Coder

    TokenRhythm/opensquilla

    Guides semantic, accessible HTML work: pages, forms, media and HTML5 APIs, plus how to deliver a runnable webpage project with a preview.

    7.1k GitHub stars~1.4k tokensUpdated 3 days ago
    Auto-check passed
  • PowerPoint Reader and Builder

    TokenRhythm/opensquilla

    Reads, edits in place, or creates PowerPoint .pptx decks, picking one of three paths based on what tools and files are available.

    7.1k GitHub stars~3.8k tokensUpdated 3 days ago
    Auto-check: notes
  • Excel Workbook Editor

    TokenRhythm/opensquilla

    Inspects, edits in place or creates Microsoft Excel .xlsx workbooks with openpyxl, treating each cell as a typed number, string, datetime or formula value.

    7.1k GitHub stars~1.6k tokensUpdated 3 days ago
    Auto-check passed
  • Sub-Agent Delegation

    TokenRhythm/opensquilla

    Hands a self-contained coding task to Codex, Claude Code, OpenCode or Pi as a non-interactive background process, using OpenSquilla's exec_command and process tools.

    7.1k GitHub stars~3k tokensUpdated 3 days ago
    Auto-check passed

Works with

Questions about PDF Toolkit

What does PDF Toolkit do?

Deterministic PDF operations through bundled scripts: extract text and tables, merge files or page ranges, split by range, fill form fields and build PDFs from data. A set of structural PDF operations for jobs where you know exactly what you want done.py` to fill text form fields, and an inline reportlab snippet to build a new PDF from data.

When should I use PDF Toolkit?

PDF Toolkit fits situations like: pulling tables or text out of a report PDF; combining several PDFs or selected page ranges into one file; splitting a PDF by page ranges; filling a form PDF's text fields from data.

How do I install PDF Toolkit in Claude Code?

Run `npx skills add TokenRhythm/opensquilla --skill pdf-toolkit -a claude-code`. Or copy the skill folder (src/opensquilla/skills/bundled/pdf-toolkit in TokenRhythm/opensquilla) into .claude/skills/pdf-toolkit in your project. Claude Code loads it when a task matches its description.

How do I install PDF Toolkit in Codex?

Run `npx skills add TokenRhythm/opensquilla --skill pdf-toolkit -a codex`. Or copy the skill folder (src/opensquilla/skills/bundled/pdf-toolkit in TokenRhythm/opensquilla) into .agents/skills/pdf-toolkit in your project. Codex loads it when a task matches its description.

Can I use PDF Toolkit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TokenRhythm/opensquilla --skill pdf-toolkit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pdf-toolkit, .gemini/skills/pdf-toolkit, .github/skills/pdf-toolkit and .opencode/skills/pdf-toolkit in your project.

What does PDF Toolkit need to run?

Going by SKILL.md and its folder, PDF Toolkit needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python with pypdf, pdfplumber and reportlab.

Does PDF Toolkit access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is PDF Toolkit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does PDF Toolkit use?

PDF Toolkit is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PDF Toolkit use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.5k tokens, read only when the agent opens those files.

What are the alternatives to PDF Toolkit?

Skills that share tags, products or a category with PDF Toolkit: PDF Processing (anthropics/skills, 180k stars), PDF Processing with Python (HKUDS/DeepTutor, 41k stars), PDF Toolkit (XiaomiMiMo/MiMo-Code, 14k stars) and PDF Generation, Forms and Extraction (pipeshub-ai/pipeshub-ai, 3.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PDF Toolkit?

TokenRhythm (a GitHub organization) maintains it in TokenRhythm/opensquilla, which has 7,087 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 4, 2026.

Source: TokenRhythm/opensquilla on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.