textbook-to-md

textbook-to-md is a skill for Claude Code, Codex from drpwchen/textbook-to-note. It costs 90 tokens per session (3,525 once invoked), scanned A, original, MIT.

A tool that turns PDF or EPUB textbooks into searchable Markdown files, which are plain-text files with simple formatting. The files are prepared for an AI agent to search and use as reference material.

In plain words
What is it for?
Converting whole textbooks or chapters, creating a searchable reference collection, and preparing book content for later questions.
Why use it?
It avoids repeatedly extracting text from large books whenever the agent needs to look something up.

Skill for Claude CodeCodex

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

Good fit Converting whole textbooks or chapters, creating a searchable reference collection, and preparing book content for later questions.

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

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 textbook-to-md

README.md
[![agentmods](https://agentmods.dev/badge/skills/drpwchen/textbook-to-note/textbook-to-md/github.svg)](https://agentmods.dev/skills/drpwchen/textbook-to-note/textbook-to-md)
Your own site
<a href="https://agentmods.dev/skills/drpwchen/textbook-to-note/textbook-to-md"><img src="https://agentmods.dev/badge/skills/drpwchen/textbook-to-note/textbook-to-md/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 textbook-to-md

Your own site · 80×15
<a href="https://agentmods.dev/skills/drpwchen/textbook-to-note/textbook-to-md"><img src="https://agentmods.dev/badge/skills/drpwchen/textbook-to-note/textbook-to-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,525 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 74
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 133
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 233
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
How audits are shown
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.00090 $0.03525
Opus 5 $0.00045 $0.01762
Sonnet 5 $0.00018 $0.00705
Haiku 4.5 $0.00009 $0.00352

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

Security

Grade A, and why

textbook-to-md 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 10d 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.

skills/textbook-to-md/SKILL.md · 316 lines

How it starts

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

Textbook-to-Markdown Converter

This skill calls scripts in your clone of the textbook-to-note repo. At install time, replace {REPO} below with the absolute path of the clone.

Purpose

Convert PDF or EPUB textbooks into searchable markdown that the agent can grep/read directly, eliminating the need for PDF-library extraction at every query.

Output lives outside the note vault, at the path configured by OUTPUT_DIR in shared/config.py (default ./output/), and is for the agent's consumption, not for the user's reading.

Figures are on-demand, not pre-extracted. This skill produces markdown text only. Figures are extracted one at a time when a note needs them, via the figure-remap skill's entrypoint (QC-gated). Do not batch-extract a whole book's figures into a figures/ folder — that approach does not scale and is unnecessary since the on-demand path already handles it. A legacy figures/ folder may exist for books converted before this design; new conversions are markdown-only.

When to use

  • User explicitly asks to convert a textbook or chapter
  • You need to search textbook content and want to avoid per-query PDF re-parsing overhead
  • Building up a knowledge base from a personal library of reference books
  • Before starting work on a new topic, convert the relevant chapters first

Quick reference

# Single file
python {REPO}/converter/convert.py "path/to/chapter.pdf"

# Single file with custom output and label
python {REPO}/converter/convert.py "path/to/chapter.pdf" "output.md" --book-label "Author Title 2e — Ch32"

# Batch-dir: convert ALL PDFs in a directory tree (auto chapter split + PDF bookmarks)
python {REPO}/converter/convert.py --batch-dir "path/to/your/textbook/folder"

# Force re-convert (ignore existing md)
python {REPO}/converter/convert.py --batch-dir "path/to/your/textbook/folder" --force

# Force OCR for ALL PDFs in batch-dir (bypass the text-extraction path entirely).
# Use when the text layer "looks" healthy but quality is actually bad (OCR-overlay
# scans, some digitized reprints) — auto-detection won't trigger because the text
# layer passes the shallow check.
python {REPO}/converter/convert.py --batch-dir DIR --force --force-surya

# EPUB → markdown (the 2nd arg is a FOLDER, not a .md file)
python {REPO}/converter/convert.py "path/to/book.epub" "<OUTPUT_DIR>/Author_Title_2e_2022"

Read the full file on GitHub · 316 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. 10d ago First seen · 316 lines · 90 tokens per session scan A caf42478c735

Subscribe to this mod's changes

textbook-to-md is a skill published in the GitHub repository drpwchen/textbook-to-note (101 stars, last pushed 15d ago), licensed MIT. It adds 90 tokens to every session and 3,525 once invoked, about $0.0005 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

lecture-to-notes

A workflow that turns lecture or conference recordings into organised notes using local transcription and slide extraction. It accepts video and audio files, including MOV, MP4, M4A, MP3, and WAV.

drpwchen/lecture-to-notes · 87 tokens

pdf-courseware-to-obsidian

A workflow that turns local PDF or PowerPoint course materials into structured Chinese study notes in an Obsidian vault. Obsidian is a note-taking app that stores linked Markdown files and related images.

PhSeCl/pdf-courseware-to-obsidian · 115 tokens

book-analyzer

Analyze a book (EPUB/PDF) and generate detailed chapter-by-chapter notes with extracted key concepts. Use when given a book file path to process.

tuan3w/obsidian-vault-agent · 36 tokens

lazy-english-reader

A tool for processing complete book files such as PDFs, EPUBs, MOBI files, DOCX files, and text files. It can produce Chinese translations, detailed reading notes, Obsidian reading vaults, or notes about themes across chapters.

designservice/lazy-english-reader.skill · 190 tokens

pptx-import

A method for adding an uploaded PowerPoint presentation to an existing classroom as extra pages while keeping the slides' original layout. PowerPoint is Microsoft's presentation file format.

THU-MAIC/OpenMAIC · 125 tokens

paddleocr-doc-parsing

A document-parsing tool configuration for extracting structured Markdown or JSON from complex PDFs and document images, including tables, formulas, charts, and multi-column pages.

PaddlePaddle/PaddleOCR · 140 tokens