Skip to content

book-to-skill logo

book-to-skill

Turn any technical book, document folder, or collection of sources into a unified agent skill โ€” ready to study, reference, and use while you work in GitHub Copilot CLI, Amp, or Claude Code.

Latest release Agent Skills standard Formats supported MIT License Sponsor

virgiliojr94%2Fbook-to-skill | Trendshift virgiliojr94%2Fbook-to-skill | Trendshift (daily, Python)

Why ยท What it generates ยท Beyond books ยท How it works ยท Usage ยท Install ยท FAQ ยท Performance ยท Architecture ยท Changelog

24ร—โ€“51ร— fewer tokens than dumping the book into context to answer one question, measured on real books (how it's measured).

How it works, in 3 steps:

  1. Point it at a file, folder, or glob โ€” /book-to-skill ./my-book.pdf
  2. It distills the book into a skill โ€” frameworks, decision rules, anti-patterns, and per-chapter files. Structure, not a summary.
  3. Your agent loads it on demand โ€” ask /my-book replication and it reads the right chapter and answers from the real content, no hallucination.

๐Ÿค” Why

Booklin โ€” the book-to-skill mascot, a purple wizard holding a book

You buy a great technical book. You read it once. Three months later you can't remember chapter 7 existed.

The usual workarounds don't help: - ๐Ÿ“„ "Let me just search the PDF" โ†’ you get a list of pages, not answers - ๐Ÿง  "I'll ask the agent about this book" โ†’ it either hallucinates or says it doesn't have the content - ๐Ÿ“ "I'll take notes as I read" โ†’ you end up with a 200-line doc you never open again

book-to-skill solves this by turning the book into a structured skill your agent loads on demand.

Once installed, you just type /your-book-slug replication and the agent reads the right chapter and answers from the actual content. No hallucination. No digging through PDFs. The book becomes part of your workflow.

Works with any host that supports the open Agent Skills standard โ€” GitHub Copilot CLI, Amp, and Claude Code all read the same SKILL.md format.


๐Ÿ“ฆ What it generates

Running /book-to-skill your-book.pdf (or a folder, glob, or list of files) creates a full skill in your agent's skills directory (~/.copilot/skills/<slug>/ for Copilot CLI, ~/.agents/skills/<slug>/ for Amp or cross-agent, ~/.claude/skills/<slug>/ for Claude Code):

File Purpose Size
SKILL.md Core mental models + chapter index ~4,000 tokens
chapters/ch01-*.md โ€ฆ One file per chapter, loaded on-demand ~1,000 tokens each
glossary.md Every key term, alphabetically sorted with chapter refs ~1,500 tokens
patterns.md All techniques, algorithms, and design patterns ~2,000 tokens
cheatsheet.md Decision tables and quick-reference rules ~1,000 tokens

Chapter files are loaded on-demand โ€” they don't count against the skill budget until you ask about that topic.


๐Ÿข Beyond books

The name says "book", but the input is any structured prose. The same extraction works on knowledge you own and re-read constantly:

  • Internal documentation โ€” architecture decision records, runbooks, onboarding guides. Fold a whole docs/ folder into one skill and ask it while you code.
  • Brand & design systems โ€” voice guidelines, tone-of-voice docs, component principles. Turn a brand book into a skill your team queries instead of skimming a 60-page PDF.
  • Research clusters โ€” a stack of papers plus your own notes, merged into a single unified skill and updated as new material lands (see Update / fold-in).
  • Specs & standards โ€” RFCs, API contracts, compliance docs you reference but never memorize.

If you re-open a document often enough to wish you'd memorized it, it's a candidate.


๐Ÿงพ The Discovery Loop Tax

A PDF-reading agent doesn't just read โ€” it navigates: it re-fetches the ToC, backtracks, and re-processes all of it on every turn. book-to-skill pays that structuring cost once, at conversion, so queries stay proportional to the answer โ€” 24ร—โ€“51ร— fewer tokens than dumping the book into context, measured on real books.

๐Ÿ“Š Full methodology, numbers, and per-book tables โ†’ docs/PERFORMANCE.md


โš™๏ธ How it works

Two halves: a deterministic Python extractor (document โ†’ clean text + metadata) and a spec-driven generator (your agent follows SKILL.md to turn that into a structured skill). On-demand chapter files keep the loaded skill small.

๐Ÿ”ง Full walkthrough (Steps 0โ€“10, extraction modes, token budgets) โ†’ docs/HOW_IT_WORKS.md


๐Ÿš€ Usage

/book-to-skill <path|folder|glob> [skill-name] โ€” plus analyze-only, generate-from-analysis, and update/fold-in modes.

โ–ถ๏ธ All modes and examples โ†’ docs/USAGE.md


๐Ÿ“ฅ Install

# Agent skill (registers /book-to-skill) โ€” clone into your skills folder:
git clone https://github.com/virgiliojr94/book-to-skill.git ~/.claude/skills/book-to-skill
# (Copilot CLI: ~/.copilot/skills/ ยท Amp/cross-agent: ~/.agents/skills/)

๐Ÿ“ฅ All hosts, optional extractors, and the standalone CLI โ†’ docs/INSTALL.md


โ“ FAQ

Common questions โ€” "why not just dump the PDF?", cost, privacy, non-book inputs, multi-file books.

โ“ Answers โ†’ docs/FAQ.md


๐Ÿ”ง Requirements The extractor tries tools in order per format and uses the first available. If nothing is installed, it tells you which command to run. Plain text, Markdown, reStructuredText and AsciiDoc need no extra deps. > **Check your setup in one command:** `python3 scripts/extract.py --check` prints which extractors are installed for every format and the exact command to install anything missing โ€” no file needed. **PDF โ€” choose by book type:** | Book type | Tool | Install | Speed | |-----------|------|---------|-------| | Text-heavy (prose, few tables) | `pdftotext` (poppler) | `sudo apt install poppler-utils` | โšก instant | | Text-heavy fallback | `pypdf` | `pip3 install pypdf` | โšก instant | | Text-heavy fallback | `pdfminer.six` | `pip3 install pdfminer.six` | โšก instant | | **Technical (code, tables, formulas)** | **`docling`** | `pip3 install docling` | ~1.5s/page | > Before extraction begins, the skill asks you whether the book is **technical** or **text-heavy** and picks the right tool automatically. Docling preserves markdown tables and code blocks; pdftotext is faster for prose-only books. **EPUB:** | Tool | Install | Quality | |------|---------|---------| | `ebooklib` + `beautifulsoup4` | `pip3 install ebooklib beautifulsoup4` | โญโญโญ Best | | stdlib `zipfile` | built-in โ€” no install needed | โญโญ Always available | **Other formats:** | Format | Tool | Install | |--------|------|---------| | DOCX | `python-docx` (fallback: stdlib ZIP/XML) | `pip3 install python-docx` | | HTML | `beautifulsoup4` (fallback: stdlib `html.parser`) | `pip3 install beautifulsoup4` | | RTF | `striprtf` (fallback: regex) | `pip3 install striprtf` | | MOBI / AZW / AZW3 | Calibre `ebook-convert` (external app, not pip) | https://calibre-ebook.com/download | | TXT / Markdown / reStructuredText / AsciiDoc | built-in | โ€” | ---
๐Ÿ“ Repository structure
book-to-skill/
โ”œโ”€โ”€ SKILL.md              # Skill definition + step-by-step instructions (the generator spec)
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ extract.py        # Thin entrypoint wrapper
โ”‚   โ””โ”€โ”€ extractor/        # Modular extraction package
โ”‚       โ”œโ”€โ”€ config.py     # Extensions, paths, dependency constants
โ”‚       โ”œโ”€โ”€ dependencies.py  # optional-dep probing + --check
โ”‚       โ”œโ”€โ”€ exceptions.py # ExtractionError (per-source failures, batch-safe)
โ”‚       โ”œโ”€โ”€ utils.py      # CLI parsing, multi-source resolution, chapter detection, runner
โ”‚       โ””โ”€โ”€ parsers/      # Format-specific parsers (pdf, epub, docx, html, rtf, calibre, text)
โ”œโ”€โ”€ tools/
โ”‚   โ”œโ”€โ”€ discovery_tax.py  # measures token cost vs context-dump / discovery loop
โ”‚   โ””โ”€โ”€ validate_skill.py # checks a generated SKILL.md against host rules (--lens claude|copilot|amp)
โ”œโ”€โ”€ tests/                # pytest suite (extraction, detection, discovery tax)
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ PERFORMANCE.md    # measured benchmarks, discovery tax, cost
โ”‚   โ””โ”€โ”€ ARCHITECTURE.md   # pipeline + component map
โ”œโ”€โ”€ CHANGELOG.md          # release history (semver)
โ”œโ”€โ”€ CONTRIBUTING.md       # dev setup, PR conventions, release process
โ”œโ”€โ”€ SECURITY.md           # vulnerability reporting
โ””โ”€โ”€ README.md             # This file
---

book-to-skill ships no book content โ€” not a single page. It's a converter you point at files you already own.

  • Processing is local. Extraction and analysis run on your machine. Your files are never uploaded by this tool. (If your agent's model runs in the cloud, the text you feed it follows that provider's normal data terms โ€” same as any prompt.)
  • You use your own copy. Bring a book you bought, docs your company owns, or papers you have the right to read.
  • The output is your notes. A generated skill is a structured, synthesized derivative โ€” framework names, definitions, takeaways โ€” not a reproduction of the text. The skill explicitly never copies raw passages (see Quality Rule #7). Treat it like handwritten study notes: yours, for personal use.
  • Don't redistribute. Publishing or sharing a generated skill of a copyrighted work can infringe the rights holder. Keep skills of third-party books private. Internal docs, your own writing, and openly-licensed material are fine to share within the bounds of their license.

When in doubt, follow the license or terms of the source document. This project is a tool; how you use it is on you.


๐Ÿ’– Sponsors

Booklin celebrating

book-to-skill is free and MIT-licensed, maintained on personal time. If it saves you tokens or study hours, consider sponsoring its upkeep: PR reviews, multilingual fixes, releases, and docs.

Become a sponsor โ†’ github.com/sponsors/virgiliojr94

Every sponsor is listed in BACKERS.md. Thank you for keeping open, privacy-first tooling alive. โœจ

License

MIT โ€” applies to the converter (code + skill definition) in this repository, not to any book or document you process with it.

Star History

Star History Chart