virgiliojr94 / book-to-skill
virgiliojr94 / book-to-skill
book-to-skill allows you to 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. 🏆 Ranked #10 Python Repository of the Day and #25 Repository of the Day on Trendshift (May 23, 2026).
book-to-skill 可以将任何技术书籍、文档文件夹或资源集合转化为统一的智能体技能(Agent Skill),让你在 GitHub Copilot CLI、Amp 或 Claude Code 中工作时,能够随时学习、引用和使用。🏆 该项目曾入选 Trendshift 每日 Python 仓库榜单第 10 名及总榜第 25 名(2026 年 5 月 23 日)。
How it works (3 steps)
工作原理(3 个步骤)
-
Point it at a file, folder, or glob:
/book-to-skill ./my-book.pdf指向文件、文件夹或通配符路径:/book-to-skill ./my-book.pdf -
It distills the book into a skill: It extracts frameworks, decision rules, anti-patterns, and per-chapter files. It creates structure, not just a summary. 将书籍提炼为技能: 它会提取框架、决策规则、反模式以及各章节文件。它构建的是结构化内容,而不仅仅是摘要。
-
Your agent loads it on demand: Ask
/my-book replicationand it reads the right chapter and answers from the real content, with no hallucination. 智能体按需加载: 输入/my-book replication,它会读取正确的章节并根据真实内容回答,杜绝幻觉。
🤔 Why
🤔 为什么需要它?
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: 你买了一本很棒的技术书,读了一遍。三个月后,你甚至不记得第 7 章的存在。常见的替代方案也无济于事:
- 📄 “Let me just search the PDF” → You get a list of pages, not answers. “我搜一下 PDF” → 你得到的是一堆页面列表,而不是答案。
- 🧠 “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. “我边读边记笔记” → 最后你得到一个 200 行的文档,却再也没打开过。
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.
book-to-skill 通过将书籍转化为智能体可按需加载的结构化技能解决了这个问题。安装后,只需输入 /your-book-slug replication,智能体就会读取正确的章节并基于实际内容回答。没有幻觉,无需翻找 PDF。书籍从此成为你工作流的一部分。
📦 What it generates
📦 生成内容
Running /book-to-skill your-book.pdf creates a full skill in your agent’s skills directory.
运行 /book-to-skill your-book.pdf 会在你的智能体技能目录中创建一个完整的技能包。
| 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 | Key terms, alphabetically sorted | ~1,500 tokens |
| patterns.md | Techniques, algorithms, and design patterns | ~2,000 tokens |
| cheatsheet.md | Decision tables and quick-reference rules | ~1,000 tokens |
| 文件 | 用途 | 大小 |
|---|---|---|
| SKILL.md | 核心心智模型 + 章节索引 | ~4,000 tokens |
| chapters/ch01-*.md | 每章一个文件,按需加载 | 每个 ~1,000 tokens |
| glossary.md | 关键术语,按字母顺序排列 | ~1,500 tokens |
| patterns.md | 技术、算法和设计模式 | ~2,000 tokens |
| cheatsheet.md | 决策表和快速参考规则 | ~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: 名字虽然叫 “book”,但输入可以是任何结构化的文字。同样的提取方式也适用于你拥有并经常重读的知识:
- Internal documentation: Architecture decision records, runbooks, onboarding guides. 内部文档: 架构决策记录、运行手册、入职指南。
- Brand & design systems: Voice guidelines, tone-of-voice docs, component principles. 品牌与设计系统: 语音指南、语调文档、组件原则。
- Research clusters: A stack of papers plus your own notes, merged into a single unified skill. 研究集群: 一堆论文加上你自己的笔记,合并成一个统一的技能。
- Specs & standards: RFCs, API contracts, compliance docs. 规范与标准: RFC、API 合约、合规文档。
🚀 Usage
🚀 使用方法
/book-to-skill <path-to-document-folder-or-glob>... [skill-name-slug]
Examples: 示例:
# Process several files together into a unified skill
# 将多个文件合并为一个统一技能
/book-to-skill ~/papers/paper1.pdf ~/notes/export.txt unified-research
# Process all supported files in a folder together
# 处理文件夹中所有支持的文件
/book-to-skill ~/workspace/project-docs/ project-knowledge
# Update/fold new material into an existing skill folder
# 将新材料更新/合并到现有的技能文件夹中
/book-to-skill ~/articles/new-paper.pdf ~/.claude/skills/project-knowledge
After the skill is created, use it like any other agent skill: 技能创建后,像使用其他智能体技能一样使用它:
/designing-data-intensive-apps# load core mental models (加载核心心智模型)/designing-data-intensive-apps replication# find and explain a topic (查找并解释主题)/designing-data-intensive-apps ch05# dive into chapter 5 (深入第 5 章)