pdf2epub-calibration

pdf2epub-calibration is a skill for Claude Code, Codex from moonlight-lupin/agent-skills. It costs 95 tokens per session (2,951 once invoked), scanned A, original, MIT.

A set of calibration rules for a PDF-to-EPUB conversion pipeline. EPUB is a reflowable ebook format, and the rules help classify page numbers, footnotes, chapter headings, and cover images correctly.

In plain words
What is it for?
Use them when tuning or debugging PDF-to-EPUB conversion, especially its text classification and link handling.
Why use it?
They address conversion errors such as broken footnote links, incorrect chapter targets, and covers extracted as separate image fragments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use them when tuning or debugging PDF-to-EPUB conversion, especially its text classification and link handling.

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

Made for: Claude Code, Codex.

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 pdf2epub-calibration

README.md
[![agentmods](https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/pdf2epub-calibration/github.svg)](https://agentmods.dev/skills/moonlight-lupin/agent-skills/pdf2epub-calibration)
Your own site
<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/pdf2epub-calibration"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/pdf2epub-calibration/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 pdf2epub-calibration

Your own site · 80×15
<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/pdf2epub-calibration"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/pdf2epub-calibration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,951 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.00095 $0.02951
Opus 5.5 $0.00038 $0.01180
Sonnet 5.5 $0.00019 $0.00590
Haiku 4.5 $0.00010 $0.00295

Measured 11d ago against content hash 2e10c6e202d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pdf2epub-calibration 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 11d 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.

productivity/pdf2epub-calibration/SKILL.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PDF→EPUB Classifier Calibration

When to Use

  • A converted EPUB has citations in body text, page numbers as phantom endnotes, or broken/duplicate footnote links
  • Chapter headings resolve to wrong PDF pages
  • The cover image comes out as a texture fragment or a naked photo without typography

Span-merge reality (check the dump, not the flag)

  • page.get_text("dict") gives lines whose spans merge text at different font sizes. A body line can contain a 5pt footnote-ref span inside 12pt text — text extraction sees ONE line at the max span size.
  • Superscript flags are unreliable: several authoring tools (QuarkXPress-style CJK exports included) emit footnote refs as STANDALONE 6pt lines with the sup flag UNSET, and emit the note's own number as a leading 5pt span merged into the note's first line. Gate ref detection on size + position, never on the sup flag alone.
  • Before changing any threshold, dump per-page lines with text/size/flags/y-ratio. Most classification misses are span-merge artifacts, not wrong thresholds.

Classification order and thresholds (validated values)

  1. FOLIO first: bare 1-4 digit (or roman i-vi) number, font < 0.85*body, y > 0.90. Rules run in order; if the footnote rule runs before the folio rule, page numbers become phantom notes.
  2. FNREF: whole line is a bare digit, font < 0.75*body, any y.
  3. FOOTNOTE: font < 0.92*body, y > 0.60, not a list marker. Long note blocks climb to 2/3 page height — a fixed 'footnotes below 80%' y-cut loses note starts. Use the largest threshold that still excludes body text.
  4. BODY: everything else.
  5. Body font size is LEARNED (2-char-mode of line sizes), never hard-coded. Books legitimately differ.

Footnote block grouping

  • A note starts at a line whose first token is a bare digit followed by body text; bare-digit strays are dropped. Continuations attach unconditionally to the previous block.
  • Per-chapter note numbering restarts are normal in books — scope anchor ids by chapter or duplicate ids fail the link check.
  • Glued CJK note numbers need a monotonic matcher (see Endnotes-section books below), not a whitespace-required regex.

Read the full file on GitHub · 97 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. 11d ago First seen · 97 lines · 95 tokens per session scan A 2e10c6e202d5

Subscribe to this mod's changes

pdf2epub-calibration is a skill published in the GitHub repository moonlight-lupin/agent-skills (101 stars, last pushed today), licensed MIT. It adds 95 tokens to every session and 2,951 once invoked, about $0.0004 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-10-06.

Related

Other skills, from other repositories

nano-pdf

Edit text in existing PDFs via natural-language prompts.

aivrar/portable-hermes-agent · 14 tokens

kagen

Convert Kami HTML templates to production-grade PDF via Chromium/Playwright. Complements Kami (design) with PDF rendering. Use when user asks to generate PDF files, render HTML to PDF, or export documents.

EliasOulkadi/shokunin · 0 tokens

kami

Generate PDFs, resumes, CVs, letters, slide decks, portfolios, one-pagers, white papers, and professional documents. Use when user asks to create a PDF, make a resume, write a letter, design slides, format a document, typeset a report, build a portfolio, make a presentation, or create a one-pager. Warm parchment…

EliasOulkadi/shokunin · 0 tokens

pdf-processing

Inspect, extract, OCR, create, merge, split, reorder, rotate, annotate, fill, redact, compress, secure, and verify PDF documents while preserving source files and visual fidelity. Use when working with one or more .pdf files; converting documents to or from PDF; extracting text, tables, images, metadata, forms, or…

seb1n/awesome-ai-agent-skills · 105 tokens

document-converter-suite

Convert local PDF, Office, Markdown, HTML, text, CSV, TSV, and JSON files; batch-convert folders, extract tables, fill templates, and edit PDF pages.

Rylaispirit/rylai-codex-hermes-skills · 41 tokens

pdf

Create, inspect, extract, merge, split, rotate, and render PDF files with local open-source tools, including structural and visual verification.

Rylaispirit/rylai-codex-hermes-skills · 30 tokens