read-book
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/read-book — Extract structured notes from books and long PDFs
/read-book — 从书籍和长PDF中提取结构化笔记
Sibling to . Same content-consumption pattern: ingest → chunk → extract → optionally capture to second-brain.
watch-video与是同类功能。内容处理流程相同:摄入→分块→提取→可选保存至第二大脑。
watch-videoStep 1 — Parse input
步骤1 — 解析输入
Accept:
- PDF: file path (Claude reads PDFs natively in chunks via )
Read pages:"X-Y" - EPUB / MOBI: file path (needs or
pandocto extract — seeebook-convert)references/sources.md - Markdown / .txt: file path (read directly)
- Pasted text: just use what was pasted
- URL to public-domain text: (Project Gutenberg, archive.org, etc.)
WebFetch
Detect type from file extension. If ambiguous, ask.
支持的输入类型:
- PDF:文件路径(Claude可通过原生分块读取PDF)
Read pages:"X-Y" - EPUB / MOBI:文件路径(需要或
pandoc提取内容——详见ebook-convert)references/sources.md - Markdown / .txt:文件路径(直接读取)
- 粘贴文本:直接使用粘贴的内容
- 公有领域文本的URL:通过获取(如古腾堡计划、archive.org等)
WebFetch
根据文件扩展名检测类型。若类型不明确,询问用户。
Step 2 — Parse mode
步骤2 — 解析模式
| Invocation | Mode | What you get |
|---|---|---|
| notes (default) | Chapter-by-chapter: TL;DR + key concepts + quotes + action items + frameworks |
| summary | Whole-book TL;DR (1 paragraph) + 3–5 key takeaways + who-it's-for |
| quotes | Pull-quote highlights only, with chapter context and page refs |
| study | Notes mode + 10–20 spaced-repetition Q&A cards |
If the book is long (>200 pages) and mode is unspecified, default to but warn it'll take many tool calls.
notes| 调用命令 | 模式 | 输出内容 |
|---|---|---|
| notes(默认) | 按章节提取:TL;DR + 核心概念 + 引用 + 行动项 + 框架 |
| summary | 整本书TL;DR(1段文字) + 3–5个关键要点 + 适用人群 |
| quotes | 仅提取高亮引用,附带章节上下文和页码参考 |
| study | notes模式内容 + 10–20张间隔重复问答卡片 |
若书籍篇幅较长(>200页)且未指定模式,默认使用模式,但会提示用户该模式需要多次工具调用。
notesStep 3 — Get the text + chunk
步骤3 — 获取文本并分块
See for per-source ingestion. Output of this step: text content + a chunking plan.
references/sources.mdChunking strategy (hybrid, in priority order):
-
By chapter if a TOC exists (PDF with bookmarks, EPUB/MOBI converted via pandoc preserves chapter headers)
- Use for PDFs
pdfinfo <pdf> | grep "Pages" - Use for chapter detection, or read TOC from page 1–5
pdftotext -layout <pdf> | grep -i "^chapter\|^part" - EPUB: after , chunks are between
pandoc <epub> -o tmp.mdheaders# Chapter X
- Use
-
By page count for PDFs without TOC: 50 pages per chunk
-
By character count for text/markdown: 30,000 chars per chunk (~7,500 words)
Save the chunking plan as :
~/Documents/books/<author>-<title-slug>-<YYYY-MM-DD>/chunks.jsonjson
{
"source": "<path>",
"title": "<book title>",
"author": "<author>",
"type": "pdf",
"total_pages": 287,
"chunking": "by-chapter",
"chunks": [
{"i": 0, "label": "Introduction", "pages": "1-12"},
{"i": 1, "label": "Chapter 1: The Problem", "pages": "13-32"},
...
]
}各来源的摄入方式详见。本步骤输出:文本内容 + 分块方案。
references/sources.md分块策略(混合模式,优先级从高到低):
-
按章节分块(若存在目录):如带书签的PDF、经pandoc转换的EPUB/MOBI会保留章节标题
- 对PDF使用获取页数
pdfinfo <pdf> | grep "Pages" - 对PDF使用检测章节,或读取前1-5页的目录
pdftotext -layout <pdf> | grep -i "^chapter\|^part" - EPUB:经转换后,以
pandoc <epub> -o tmp.md标题为分隔进行分块# Chapter X
- 对PDF使用
-
按页数分块(无目录的PDF):每50页为一个块
-
按字符数分块(文本/Markdown):每30,000字符为一个块(约7,500单词)
将分块方案保存至:
~/Documents/books/<author>-<title-slug>-<YYYY-MM-DD>/chunks.jsonjson
{
"source": "<path>",
"title": "<book title>",
"author": "<author>",
"type": "pdf",
"total_pages": 287,
"chunking": "by-chapter",
"chunks": [
{"i": 0, "label": "Introduction", "pages": "1-12"},
{"i": 1, "label": "Chapter 1: The Problem", "pages": "13-32"},
...
]
}Step 4 — Read each chunk
步骤4 — 读取每个块
Loop:
- Read chunk N (tool with
Readfor PDF, full file for text/MD)pages: - Extract per the chosen mode (see for templates)
references/output-modes.md - Append the chunk's notes to
~/Documents/books/<workdir>/notes-<NNN>-<label-slug>.md
For PDFs, don't read the whole book in one call — Claude's PDF tool maxes around 10 pages. Process chunks individually.
If a chunk fails to extract anything useful (e.g., it's mostly diagrams or front-matter), log the skip and continue.
循环执行:
- 读取第N个块(对PDF使用带参数的
pages:工具,对文本/MD直接读取完整内容)Read - 根据所选模式提取内容(模板详见)
references/output-modes.md - 将该块的笔记追加至
~/Documents/books/<workdir>/notes-<NNN>-<label-slug>.md
对于PDF,不要一次性读取整本书——Claude的PDF工具单次最多处理约10页。需逐个处理块。
若某个块无法提取有效内容(如大部分是图表或前言),记录跳过信息并继续执行。
Step 5 — Aggregate into final notes file
步骤5 — 合并为最终笔记文件
Combine all chunk notes into a single matching the mode's full-book template (see ).
~/Documents/books/<workdir>/notes.mdreferences/output-modes.mdTop of the file always has the metadata block + the second-brain-compatible frontmatter:
markdown
source: <file path or URL>
captured: YYYY-MM-DD
type: book
book_title: <title>
author: <author>
mode: notes
chunks: <count>
chunking: <strategy>将所有块的笔记合并为单个文件,匹配对应模式的整本书模板(详见)。
~/Documents/books/<workdir>/notes.mdreferences/output-modes.md文件顶部始终包含元数据块和兼容第二大脑的前置内容:
markdown
source: <file path or URL>
captured: YYYY-MM-DD
type: book
book_title: <title>
author: <author>
mode: notes
chunks: <count>
chunking: <strategy><title> by <author>
<title> by <author>
TL;DR
TL;DR
<2–3 sentences>
<2–3 sentences>
Key takeaways
Key takeaways
- ...
- ...
Chapter notes
Chapter notes
...
...
Cross-references (suggested for wiki)
Cross-references (suggested for wiki)
- Could connect to [[Longevity Biomarkers]] (per Chapter 3 discussion of biomarkers)
- Could connect to [[Productivity & Systems]] (per Chapter 7 framework)
The cross-reference suggestions are advisory — they're suggestions for `/sb compile` to act on, not auto-applied. Keep responsibilities separated.- Could connect to [[Longevity Biomarkers]] (per Chapter 3 discussion of biomarkers)
- Could connect to [[Productivity & Systems]] (per Chapter 7 framework)
交叉引用建议仅作参考——它们是`/sb compile`命令的执行起点,不会自动应用。需明确职责划分。Step 6 — Offer to capture to second-brain
步骤6 — 提供保存至第二大脑的选项
Ask:
"Want to capture this to second-brain? I'll write it tomatching your vault's${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/raw/highlights-<slug>.mdtype prefix."highlights-
Default is ask, never auto-write. If yes:
- Copy the final (with the second-brain-compatible frontmatter at top) to
notes.md${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/raw/highlights-<slug>.md - Tell the user the path
- Suggest: "Run later to merge this into wiki pages — the cross-reference suggestions in the footer are starting points."
/sb compile
If the user skips capture, the workdir still has everything — they can grab the file later.
询问用户:
"是否要将内容保存至第二大脑?我会将其写入,匹配你的知识库的${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/raw/highlights-<slug>.md类型前缀。"highlights-
默认行为是询问用户,绝不自动写入。若用户同意:
- 将最终的(顶部包含兼容第二大脑的前置内容)复制到
notes.md${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/raw/highlights-<slug>.md - 告知用户文件路径
- 建议:"之后可运行将内容合并到维基页面——底部的交叉引用建议是很好的起点。"
/sb compile
若用户跳过保存,工作目录仍会保留所有文件——用户可稍后自行获取。
Step 7 — Report
步骤7 — 生成报告
In chat:
- One-line headline:
<title> · <author> · <total_pages or word count> · <mode> · <chunks processed> - Workdir path
- The TL;DR section
- For /
notesmodes: brief list of top 3 takeawaysstudy - For mode: top 3 quotes
quotes - If captured to second-brain: that path too
在聊天界面展示:
- 一行标题:
<title> · <author> · <总页数或字数> · <模式> · <已处理块数> - 工作目录路径
- TL;DR部分
- 对于/
notes模式:前3个关键要点的简要列表study - 对于模式:前3条引用
quotes - 若已保存至第二大脑:同时展示该路径
Modes (quick invocations)
模式(快速调用)
| Invocation | Mode | Behavior |
|---|---|---|
| notes | Full pipeline, default mode |
| summary | Just TL;DR + key takeaways (1 read pass for short books, sampled chapters for long) |
| quotes | Chapter-by-chapter, but only output quotes |
| study | Notes + Q&A spaced-rep cards |
| (any) | Skip the ask step, auto-write to second-brain raw/ |
| (any) | Also render the final |
| (any) | Same as above but HTML |
| 调用命令 | 模式 | 行为 |
|---|---|---|
| notes | 完整流程,默认模式 |
| summary | 仅生成TL;DR + 关键要点(短书籍单次读取,长书籍抽样章节) |
| quotes | 按章节处理,但仅输出引用 |
| study | 笔记 + 间隔重复问答卡片 |
| 任意模式 | 跳过询问步骤,自动写入第二大脑的raw/目录 |
| 任意模式 | 同时通过pandoc将最终的 |
| 任意模式 | 同上,但渲染为HTML格式 |
Composes with
可组合功能
- — primary integration: writes
second-braintohighlights-<slug>.md. Thenraw/merges into wiki pages./sb compile - — when a research question turns up a book,
deep-researchis the next step. Notes feed back into the research brief./read-book - — when scoring an idea (e.g., business books on similar models), read-book provides the structured evidence.
business-brainstorm - — when a decision hinges on what an authority has written (e.g., "should I take VC money?" → read Naval / Jason Cohen),
decideextracts the relevant chapter.read-book - — book takeaways → talk material (book talk pattern).
slide-deck - — sibling skill, same content-consumption pattern. Audiobook? Use
watch-videomode.watch-video transcript - /
nonfictionskills— when researching to write a book, this skill reads the comp titles.fictionskills
- — 主要集成:将
second-brain写入highlights-<slug>.md目录。之后raw/可将内容合并到维基页面。/sb compile - — 当研究问题涉及某本书时,
deep-research是下一步操作。提取的笔记可反馈到研究简报中。/read-book - — 当评估某个想法时(如参考同类商业模式的商业书籍),
business-brainstorm可提供结构化的证据。read-book - — 当决策依赖权威著作时(如"我是否应该接受风投资金?"→阅读Naval/Jason Cohen的著作),
decide可提取相关章节内容。read-book - — 书籍要点可转化为演讲素材(书籍分享模式)。
slide-deck - — 同类功能,内容处理模式相同。有声书?可使用
watch-video模式。watch-video transcript - /
nonfictionskills— 当研究如何撰写书籍时,该功能可用于分析同类书籍。fictionskills
Error handling
错误处理
| Failure | Response |
|---|---|
| EPUB/MOBI without pandoc / ebook-convert | Tell the user: |
| PDF is scanned (no text layer) | Suggest OCR first: |
| PDF has no detectable TOC | Fall back to 50-page chunks. Note in the metadata. |
| Book is unusually long (>500 pages) | Warn cost / time, ask if the user wants summary mode instead of full notes |
| Chunk extraction empty | Skip the chunk, log, continue. Don't fail the whole run. |
| 故障场景 | 响应方式 |
|---|---|
| 无pandoc/ebook-convert处理EPUB/MOBI | 告知用户: |
| PDF为扫描件(无文本层) | 建议先进行OCR处理: |
| PDF无法检测到目录 | fallback到50页分块模式。在元数据中注明。 |
| 书籍异常冗长(>500页) | 提示成本/时间消耗,询问用户是否要改用summary模式而非完整notes模式 |
| 块提取内容为空 | 跳过该块,记录日志并继续执行。不终止整个流程。 |
Notes on quality
质量注意事项
- Don't summarize beyond recognition. A 30-page chapter should produce 8–15 lines of notes, not 3. Compression is good; flattening is bad.
- Preserve specifics. Names, numbers, dates, quotes — keep them. The whole point is later-the user can grep "what did Andy Wilkinson say about X" and find it.
- Quotes are sacred. When you flag a quote, copy it verbatim. Note the page if possible.
- Action items are explicit. If the book makes you think "I should do X," flag it explicitly. These are the highest-leverage outputs.
- Frameworks deserve their own bullets. When the author names a framework (e.g., "the 9-dimension filter," "Save the Cat beats"), call it out by name in the notes.
- 不要过度概括。30页的章节应生成8-15行笔记,而非3行。压缩内容是合理的,但过度简化不可取。
- 保留细节。姓名、数字、日期、引用——全部保留。核心目的是让用户之后可以通过搜索找到具体内容,比如"Andy Wilkinson关于X的观点是什么"。
- 引用需准确。标记引用时,需逐字复制原文。尽可能注明页码。
- 行动项要明确。若书籍内容让你产生"我应该做X"的想法,需明确标记为行动项。这是最高价值的输出内容。
- 框架单独标记。当作者提出某个框架时(如"9维度筛选法"、"Save the Cat节拍"),需在笔记中单独标注其名称。