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
watch-video
. Same content-consumption pattern: ingest → chunk → extract → optionally capture to second-brain.
watch-video
是同类功能。内容处理流程相同:摄入→分块→提取→可选保存至第二大脑。

Step 1 — Parse input

步骤1 — 解析输入

Accept:
  • PDF: file path (Claude reads PDFs natively in chunks via
    Read pages:"X-Y"
    )
  • EPUB / MOBI: file path (needs
    pandoc
    or
    ebook-convert
    to extract — see
    references/sources.md
    )
  • Markdown / .txt: file path (read directly)
  • Pasted text: just use what was pasted
  • URL to public-domain text:
    WebFetch
    (Project Gutenberg, archive.org, etc.)
Detect type from file extension. If ambiguous, ask.
支持的输入类型:
  • PDF:文件路径(Claude可通过
    Read pages:"X-Y"
    原生分块读取PDF)
  • EPUB / MOBI:文件路径(需要
    pandoc
    ebook-convert
    提取内容——详见
    references/sources.md
  • Markdown / .txt:文件路径(直接读取)
  • 粘贴文本:直接使用粘贴的内容
  • 公有领域文本的URL:通过
    WebFetch
    获取(如古腾堡计划、archive.org等)
根据文件扩展名检测类型。若类型不明确,询问用户。

Step 2 — Parse mode

步骤2 — 解析模式

InvocationModeWhat you get
/read-book <input>
notes (default)Chapter-by-chapter: TL;DR + key concepts + quotes + action items + frameworks
/read-book <input> summary
summaryWhole-book TL;DR (1 paragraph) + 3–5 key takeaways + who-it's-for
/read-book <input> quotes
quotesPull-quote highlights only, with chapter context and page refs
/read-book <input> study
studyNotes mode + 10–20 spaced-repetition Q&A cards
If the book is long (>200 pages) and mode is unspecified, default to
notes
but warn it'll take many tool calls.
调用命令模式输出内容
/read-book <input>
notes(默认)按章节提取:TL;DR + 核心概念 + 引用 + 行动项 + 框架
/read-book <input> summary
summary整本书TL;DR(1段文字) + 3–5个关键要点 + 适用人群
/read-book <input> quotes
quotes仅提取高亮引用,附带章节上下文和页码参考
/read-book <input> study
studynotes模式内容 + 10–20张间隔重复问答卡片
若书籍篇幅较长(>200页)且未指定模式,默认使用
notes
模式,但会提示用户该模式需要多次工具调用。

Step 3 — Get the text + chunk

步骤3 — 获取文本并分块

See
references/sources.md
for per-source ingestion. Output of this step: text content + a chunking plan.
Chunking strategy (hybrid, in priority order):
  1. By chapter if a TOC exists (PDF with bookmarks, EPUB/MOBI converted via pandoc preserves chapter headers)
    • Use
      pdfinfo <pdf> | grep "Pages"
      for PDFs
    • Use
      pdftotext -layout <pdf> | grep -i "^chapter\|^part"
      for chapter detection, or read TOC from page 1–5
    • EPUB: after
      pandoc <epub> -o tmp.md
      , chunks are between
      # Chapter X
      headers
  2. By page count for PDFs without TOC: 50 pages per chunk
  3. 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.json
:
json
{
  "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
。本步骤输出:文本内容 + 分块方案。
分块策略(混合模式,优先级从高到低):
  1. 按章节分块(若存在目录):如带书签的PDF、经pandoc转换的EPUB/MOBI会保留章节标题
    • 对PDF使用
      pdfinfo <pdf> | grep "Pages"
      获取页数
    • 对PDF使用
      pdftotext -layout <pdf> | grep -i "^chapter\|^part"
      检测章节,或读取前1-5页的目录
    • EPUB:经
      pandoc <epub> -o tmp.md
      转换后,以
      # Chapter X
      标题为分隔进行分块
  2. 按页数分块(无目录的PDF):每50页为一个块
  3. 按字符数分块(文本/Markdown):每30,000字符为一个块(约7,500单词)
将分块方案保存至
~/Documents/books/<author>-<title-slug>-<YYYY-MM-DD>/chunks.json
json
{
  "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:
  1. Read chunk N (
    Read
    tool with
    pages:
    for PDF, full file for text/MD)
  2. Extract per the chosen mode (see
    references/output-modes.md
    for templates)
  3. 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.
循环执行:
  1. 读取第N个块(对PDF使用带
    pages:
    参数的
    Read
    工具,对文本/MD直接读取完整内容)
  2. 根据所选模式提取内容(模板详见
    references/output-modes.md
  3. 将该块的笔记追加至
    ~/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
~/Documents/books/<workdir>/notes.md
matching the mode's full-book template (see
references/output-modes.md
).
Top 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.md
,匹配对应模式的整本书模板(详见
references/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

  1. ...
  1. ...

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 to
${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/raw/highlights-<slug>.md
matching your vault's
highlights-
type prefix."
Default is ask, never auto-write. If yes:
  1. Copy the final
    notes.md
    (with the second-brain-compatible frontmatter at top) to
    ${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/raw/highlights-<slug>.md
  2. Tell the user the path
  3. Suggest: "Run
    /sb compile
    later to merge this into wiki pages — the cross-reference suggestions in the footer are starting points."
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-
类型前缀。"
默认行为是询问用户,绝不自动写入。若用户同意:
  1. 将最终的
    notes.md
    (顶部包含兼容第二大脑的前置内容)复制到
    ${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/raw/highlights-<slug>.md
  2. 告知用户文件路径
  3. 建议:"之后可运行
    /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
    notes
    /
    study
    modes: brief list of top 3 takeaways
  • For
    quotes
    mode: top 3 quotes
  • If captured to second-brain: that path too
在聊天界面展示:
  • 一行标题:
    <title> · <author> · <总页数或字数> · <模式> · <已处理块数>
  • 工作目录路径
  • TL;DR部分
  • 对于
    notes
    /
    study
    模式:前3个关键要点的简要列表
  • 对于
    quotes
    模式:前3条引用
  • 若已保存至第二大脑:同时展示该路径

Modes (quick invocations)

模式(快速调用)

InvocationModeBehavior
/read-book <input>
notesFull pipeline, default mode
/read-book <input> summary
summaryJust TL;DR + key takeaways (1 read pass for short books, sampled chapters for long)
/read-book <input> quotes
quotesChapter-by-chapter, but only output quotes
/read-book <input> study
studyNotes + Q&A spaced-rep cards
/read-book <input> --capture
(any)Skip the ask step, auto-write to second-brain raw/
/read-book <input> --render pdf
(any)Also render the final
notes.md
to PDF via pandoc (uses
~/.local/share/makerskills/render.css
). See
references/output-modes.md
.
/read-book <input> --render html
(any)Same as above but HTML
调用命令模式行为
/read-book <input>
notes完整流程,默认模式
/read-book <input> summary
summary仅生成TL;DR + 关键要点(短书籍单次读取,长书籍抽样章节)
/read-book <input> quotes
quotes按章节处理,但仅输出引用
/read-book <input> study
study笔记 + 间隔重复问答卡片
/read-book <input> --capture
任意模式跳过询问步骤,自动写入第二大脑的raw/目录
/read-book <input> --render pdf
任意模式同时通过pandoc将最终的
notes.md
渲染为PDF(使用
~/.local/share/makerskills/render.css
)。详见
references/output-modes.md
/read-book <input> --render html
任意模式同上,但渲染为HTML格式

Composes with

可组合功能

  • second-brain
    — primary integration: writes
    highlights-<slug>.md
    to
    raw/
    . Then
    /sb compile
    merges into wiki pages.
  • deep-research
    — when a research question turns up a book,
    /read-book
    is the next step. Notes feed back into the research brief.
  • business-brainstorm
    — when scoring an idea (e.g., business books on similar models), read-book provides the structured evidence.
  • decide
    — when a decision hinges on what an authority has written (e.g., "should I take VC money?" → read Naval / Jason Cohen),
    read-book
    extracts the relevant chapter.
  • slide-deck
    — book takeaways → talk material (book talk pattern).
  • watch-video
    — sibling skill, same content-consumption pattern. Audiobook? Use
    watch-video transcript
    mode.
  • nonfictionskills
    /
    fictionskills
    — when researching to write a book, this skill reads the comp titles.
  • second-brain
    — 主要集成:将
    highlights-<slug>.md
    写入
    raw/
    目录。之后
    /sb compile
    可将内容合并到维基页面。
  • deep-research
    — 当研究问题涉及某本书时,
    /read-book
    是下一步操作。提取的笔记可反馈到研究简报中。
  • business-brainstorm
    — 当评估某个想法时(如参考同类商业模式的商业书籍),
    read-book
    可提供结构化的证据。
  • decide
    — 当决策依赖权威著作时(如"我是否应该接受风投资金?"→阅读Naval/Jason Cohen的著作),
    read-book
    可提取相关章节内容。
  • slide-deck
    — 书籍要点可转化为演讲素材(书籍分享模式)。
  • watch-video
    — 同类功能,内容处理模式相同。有声书?可使用
    watch-video transcript
    模式。
  • nonfictionskills
    /
    fictionskills
    — 当研究如何撰写书籍时,该功能可用于分析同类书籍。

Error handling

错误处理

FailureResponse
EPUB/MOBI without pandoc / ebook-convertTell the user:
brew install pandoc
or
brew install calibre
(calibre includes
ebook-convert
)
PDF is scanned (no text layer)Suggest OCR first:
brew install ocrmypdf && ocrmypdf <pdf> <pdf-ocr.pdf>
PDF has no detectable TOCFall 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 emptySkip the chunk, log, continue. Don't fail the whole run.
故障场景响应方式
无pandoc/ebook-convert处理EPUB/MOBI告知用户:
brew install pandoc
brew install calibre
(calibre包含
ebook-convert
PDF为扫描件(无文本层)建议先进行OCR处理:
brew install ocrmypdf && ocrmypdf <pdf> <pdf-ocr.pdf>
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节拍"),需在笔记中单独标注其名称。