virgiliojr94 /
book-to-skill
Converts technical books and doc folders into agent skills loaded one chapter at a time
- 35.8k stars
- 2.5k stars since 3 Oct
- Python
- Updated 4 days ago
- Some experience
- Agent skills & plugins
You buy a technical book, read it once, and months later can't recall what was in chapter 7. Searching a PDF gives you page lists, and asking an agent about the book either produces made-up answers or an admission it lacks the content. book-to-skill converts the book into a skill your agent can read on demand.
It works in two halves. A Python extractor turns the document (PDF, EPUB, DOCX, Markdown, HTML, RTF, MOBI and others) into clean text and metadata. Then your agent follows the project's SKILL.md spec to write the skill: a core file of mental models with a chapter index, one file per chapter, plus a glossary, a patterns file and a cheatsheet. Only the chapter you ask about gets loaded.
The obvious alternative is dumping the whole book into the prompt. The README claims 24x to 51x fewer tokens per question than that, measured on real books, and links to its methodology. The same approach works on internal docs, brand guidelines, papers and specs. The output follows the open Agent Skills format, so Copilot CLI, Amp, Claude Code, Hermes Agent, OpenCode and OpenClaw can read it.
What it does
Many input formats
Handles PDF, EPUB, DOCX, Markdown, HTML, RTF, MOBI and plain text, from a single file, a folder or a glob. It tries available extractors in order and tells you what to install if none is found.
Structured skill output
Generates SKILL.md with core models and a chapter index, one file per chapter, a glossary, a patterns file and a cheatsheet. Chapter files load only when you ask about that topic.
Works across agent hosts
Writes the skill to the cross-agent skills folder, and under Claude Code also tries a verified symlink. Hermes Agent gets its own category-based location.
Update and fold-in modes
Besides converting, it has analyze-only, generate-from-analysis and update modes so new material can be merged into an existing skill. It can also publish the skill to GitHub, private by default.
Scanned PDF check
If a PDF has no text layer, the extractor stops early and explains that you need OCR first, rather than producing an empty skill.
What you could build
- Convert a technical book you own into a skill and ask your agent about a single topic while you code.
- Fold a docs folder of runbooks and architecture decision records into one skill your team can query.
- Turn a brand or design guidelines PDF into a skill instead of skimming 60 pages.
- Merge a stack of research papers and your own notes into one skill and update it as new papers arrive.
- Check which document extractors are installed on your machine with the built-in check command.
Get started
Install the skill with the skills CLI or by cloning it into your agent's skills folder, then run /book-to-skill with the path to a file or folder. Afterwards, ask the new skill about a topic by its slug. Optional extractors such as docling or pdftotext may be needed depending on the format.
npx skills add virgiliojr94/book-to-skillgit clone https://github.com/virgiliojr94/book-to-skill.git ~/.claude/skills/book-to-skillpython3 scripts/extract.py --checkCommands are copied from the project's README. Read it on GitHub for the full setup.