Install
openclaw skills install @guipi888/book-to-skillsThis skill should be used when the user provides an electronic book (PDF, EPUB, TXT, MD) and wants to automatically extract knowledge, analyze structure, and generate multiple WorkBuddy skills. Trigger phrases: 拆解这本书, 从这本书提取技能, 把这本书变成技能, 生成技能包, book to skills. Supports three modes: Knowledge Base, Action Guide, Hybrid.
openclaw skills install @guipi888/book-to-skills输入一本电子书,自动完成格式识别 → 文本提取 → 结构分析 → 知识点拆解 → 生成多个可直接使用的 WorkBuddy 技能包。支持 PDF、EPUB、TXT、Markdown 四种输入格式,三种输出模式(知识库式 / 行动指南式 / 混合式),生成的技能包直接安装到本地 ~/.workbuddy/skills/,立即可用。
User provides a book file
↓
Step 1: Format Detection & Text Extraction
↓
Step 2: Book Analysis (structure + core concepts + methodologies)
↓
Step 3: User Chooses Output Mode (knowledge / action / hybrid)
↓
Step 4: Generate Skills (multiple skill packages)
↓
Step 5: Install & Deliver (zip + installed locally)
Use file extension and magic bytes to determine format:
| Extension | Format | Extraction Method |
|---|---|---|
.pdf | pdfplumber library | |
.epub | EPUB | ebooklib library |
.txt | Plain Text | Direct read |
.md | Markdown | Direct read |
PDF extraction (use managed Python):
# Install pdfplumber if needed
python3 -m pip install pdfplumber -q
# Extract text to file
python3 scripts/extract_pdf.py "<input.pdf>" "<output.txt>"
EPUB extraction:
# Install ebooklib if needed
python3 -m pip install ebooklib beautifulsoup4 -q
# Extract text to file
python3 scripts/extract_epub.py "<input.epub>" "<output.txt>"
TXT/MD: Read directly with the Read tool.
Extracted text is saved to a temporary file: /tmp/book_to_skills_extracted.txt
Load the extracted text and perform structured analysis. The analysis must be thorough — read the full text, not just the first few pages.
Produce a structured analysis covering:
输出一份 书籍分析报告.md,结构如下:
# 《书名》分析报告
## 📖 书籍元信息
- 书名:
- 作者:
- 主题领域:
- 核心主张(一句话):
## 📑 章节结构
1. 第1章:xxx(核心主题)
- 小节1:xxx
- 小节2:xxx
2. ...
## 🧠 核心概念清单
| # | 概念 | 一句话概括 | 可技能化 |
|---|------|-----------|---------|
| 1 | xxx | xxx | ✅/❌ |
## 🔧 可落地方法论
| # | 方法论名称 | 步骤数 | 适用场景 | 可行动化 |
|---|-----------|-------|---------|---------|
| 1 | xxx | N步 | xxx | ✅/❌ |
## 💡 知识产品化信号
- 课程素材:
- 星球帖:
- 公众号:
- 选题关联:
## 🎯 技能拆分建议
建议生成 N 个 skill:
1. `{book-slug}-knowledge` — 知识库 skill(覆盖全书知识点)
2. `{book-slug}-{method-1}` — 行动 skill({方法论名称})
3. ...
---
After presenting the analysis report, ask the user to choose one of three modes:
请选择技能生成模式:
A) 📚 知识库式 — 生成1个综合知识库 skill,包含全书的 references 文档
B) ⚡ 行动指南式 — 为每个可落地方法论生成独立 action skill
C) 🔀 混合式(推荐) — 1个知识库 skill + N个行动 skill
你选哪个?
Do NOT proceed to Step 4 until the user responds with A, B, or C.
All generated skills use the prefix derived from the book name:
atomic-habits-)yuanzi-xiguan-)Ask the user to confirm the prefix if ambiguous.
When mode is A or C, generate one knowledge base skill:
{book-slug}-knowledge/
├── SKILL.md # 知识库 skill 元信息 + 使用指引
└── references/
├── overview.md # 全书概览 + 核心主张
├── concepts.md # 核心概念详解
├── quotes.md # 可引用金句
└── structure.md # 章节结构 + 各章要点
SKILL.md template for knowledge skill:
---
name: {book-slug}-knowledge
description: >
Knowledge base for the book "{Book Title}". This skill should be used when the user wants to
reference, query, or review concepts, quotes, and methodologies from this book. Trigger phrases
include: "{book title}", "{author}", "{key concepts from the book}".
agent_created: true
---
# {Book Title} — 知识库
## Overview
This is a knowledge base skill for 《{Book Title}》by {Author}.
## How to Use
When the user mentions this book, its author, or its core concepts:
1. Load the relevant reference file(s) from `references/`
2. Provide accurate, book-grounded answers
3. When the user asks for quotes, load `references/quotes.md`
4. When the user asks about specific concepts, load `references/concepts.md`
## Reference Files
- `references/overview.md` — Book overview and core thesis
- `references/concepts.md` — All core concepts with detailed explanations
- `references/quotes.md` — Memorable quotes organized by topic
- `references/structure.md` — Chapter-by-chapter breakdown
When mode is B or C, generate one action skill per methodology:
{book-slug}-{method-slug}/
├── SKILL.md # 行动 skill 元信息 + 步骤指引
└── scripts/
└── checklist.py # (optional) 可执行的 checklist 脚本
SKILL.md template for action skill:
---
name: {book-slug}-{method-slug}
description: >
Action guide for "{Method Name}" from the book "{Book Title}". This skill should be used when
the user wants to apply this methodology in practice. Trigger phrases include: "{method name}",
"{related keywords}", "{book title} method".
agent_created: true
---
# {Method Name} — 行动指南
> 来源:《{Book Title}》by {Author}
## Overview
{1-2 sentence description of the method}
## Prerequisites
- {prerequisite 1}
- {prerequisite 2}
## Step-by-Step Guide
### Step 1: {Step Name}
{Detailed instructions}
### Step 2: {Step Name}
{Detailed instructions}
...
## Checklist
- [ ] Step 1 completed
- [ ] Step 2 completed
...
## Common Pitfalls
1. **{Pitfall}**: {Description + how to avoid}
2. ...
## Related Concepts
- From the same book: {concept 1}, {concept 2}
- See also: `{book-slug}-knowledge` skill for full book reference
Each generated skill must:
name and descriptionagent_created: true flagmkdir -p ~/workbuddy-output/{YYYY-MM-DD}-book-to-skills/{book-slug}/
For each generated skill, create the directory under ~/.workbuddy/skills/:
mkdir -p ~/.workbuddy/skills/{skill-name}/
Write all files (SKILL.md + references/scripts/assets) to the skill directory.
Create 技能索引.md listing all generated skills with descriptions:
# 《{Book Title}》技能包索引
生成日期:{YYYY-MM-DD}
技能总数:{N}
## 技能列表
| # | 技能名称 | 类型 | 描述 | 触发词 |
|---|---------|------|------|--------|
| 1 | {name} | 知识库 | {desc} | {triggers} |
| 2 | {name} | 行动指南 | {desc} | {triggers} |
...
## 使用示例
- 想查这本书的某个概念 → 直接说概念名,会自动触发知识库 skill
- 想执行某个方法论 → 说方法名,会自动触发行动 skill
- 想引用书中的金句 → 说"帮我找 {书名} 里关于 {主题} 的金句"
If the user wants distributable zip files:
python3 path/to/skill-creator/scripts/package_skill.py \
~/.workbuddy/skills/{skill-name} \
~/workbuddy-output/{YYYY-MM-DD}-book-to-skills/{book-slug}/
Present to the user:
Python script for extracting text from PDF files using pdfplumber. Execute this script when the input is a PDF file.
Python script for extracting text from EPUB files using ebooklib. Execute this script when the input is an EPUB file.
This skill naturally integrates with:
🔔 如果这个技能对你有帮助,欢迎关注我的公众号「桂皮AI实战」,获取更多 AI 效率工具和实战教程。
加入知识星球「AI超级个体变现」,与 500+ AI 实战玩家一起交流变现心得。
作者:桂皮 | GitHub: guipi888
| 版本 | 日期 | 更新内容摘要 | 操作人 |
|---|---|---|---|
| v1.0 | 2026-06-22 | 创建技能,支持 PDF/EPUB/TXT/MD 四种格式,三种输出模式 | Kyle |