book-to-skill is a Python-based command-line tool that converts technical books and documents into Claude Code skills—structured, agent-ready knowledge bases that can be queried while working in GitHub Copilot CLI, Amp, or Claude Code. The tool addresses a common problem: technical books are read once, then forgotten. Rather than searching PDFs or asking agents that hallucinate, book-to-skill distills books into organized skills that agents load on demand, delivering answers grounded in actual content.
The tool works in three steps. Users point it at a file, folder, or glob pattern—for example, `/book-to-skill ./my-book.pdf`. The extractor then distills the book into a structured skill containing frameworks, decision rules, anti-patterns, and per-chapter files. Finally, the agent loads the skill on demand; when a user asks `/my-book replication`, the agent reads the relevant chapter and answers from real content without hallucination. The extraction process is highly efficient, delivering 24 to 51 times fewer tokens than dumping an entire book into context to answer a single question, as measured on real books.
The tool generates five output files placed in the agent's skills directory. The core `SKILL.md` file contains mental models and a chapter index at roughly 4,000 tokens. Individual chapter files, one per chapter, are loaded on-demand and consume approximately 1,000 tokens each. A `glossary.md` file lists every key term alphabetically with chapter references at around 1,500 tokens. A `patterns.md` file extracts all techniques, algorithms, and design patterns at roughly 2,000 tokens. A `cheatsheet.md` file provides decision tables and quick-reference rules at approximately 1,000 tokens. Because chapter files load on-demand, they do not count against the skill budget until queried.
The tool supports a wide range of document formats: PDF, EPUB, DOCX, TXT, Markdown, reStructuredText, AsciiDoc, HTML, RTF, and MOBI/AZW/AZW3. For PDF extraction, the tool intelligently selects between multiple backends depending on book type. For text-heavy prose with few tables, it uses pdftotext from poppler for instant extraction. For technical books with code, tables, and formulas, it uses docling, which preserves markdown tables and code blocks at the cost of roughly 1.5 seconds per page. EPUB extraction uses ebooklib and beautifulsoup4 for best quality or falls back to the built-in zipfile module. Other formats use specialized libraries where available, with fallbacks to standard library tools.
Beyond books, the tool works with any structured prose that users re-read frequently: internal documentation, architecture decision records, runbooks, onboarding guides, brand and design system guidelines, research clusters combining papers and notes, and specifications or standards. If a document is opened often enough to wish it had been memorized, it is a candidate for conversion.
Real-world extraction benchmarks show the tool's efficiency. A 103-page technical book extracts in 0.1 seconds with pdftotext or 164 seconds with docling, both yielding approximately 27,000 tokens. Measured conversions on actual books show costs ranging from roughly $0.88 for Think Python 2 to $1.42 for Moby-Dick, making a full skill cost approximately $1 per book. The tool automatically detects chapters when explicit headings like "Chapter N" are present, though books using section titles or roman numerals require manual section specification.
The repository is written in Python and licensed under MIT. It follows the open Agent Skills standard, ensuring compatibility across multiple agent platforms. The tool includes performance documentation and detailed architecture notes for users interested in understanding the extraction process and design principles underlying the conversion system.