CommunityCoding & Developmentgithub.com

book-guide

Process dense books (especially humanities and social sciences with heavy references and metaphors) into a three-part guided reading EPUB and TTS-ready plain text: Background + Original Text + Explanation. Ideal for commuting listeners, readers needing annotated classics, or anyone wanting to split a book into TTS-friendly segments.

What is book-guide?

The **book-guide** skill is designed for AI agents to transform difficult books—particularly those rich in citations, metaphors, and cultural references from the humanities and social sciences—into a structured, listenable format. It generates a three-part annotated version: `【Background】` (context, sources, terminology), `【Original Text】` (untouched verbatim excerpts), and `【Explanation】` (authorial intent, rhetorical devices, hidden meanings). This skill is ideal for developers or users who need to create guided readings for classics in philosophy, history, finance, or literary criticism, especially for TTS playback during commutes or study sessions. It supports three modes—`full` (every section annotated), `spot` (only critical passages), and `essay` (only chapter-level introductions)—and includes a complete workflow: sample approval, EPUB extraction with automatic segmentation (400–1200 words per unit), batch annotation, quality checks, and final output as both EPUB and plain text. The skill is available for platforms like Claude Code and Cursor, and strictly forbids rewriting original text or using forbidden clichés, ensuring the author's style and integrity are preserved.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/sw-Hua/book-guide/tree/main

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

book-guide: From Dense Books to Three-Part Guided Editions

What Problem Does It Solve

When reading a book packed with references, the real process is: read the original → get stuck → look up context → reread → finally understand. This skill does the entire chain in one go, producing listenable three-part text:

【Background】 What this section is about, who's involved, which book and volume it's from, the era, the original meaning of terms
【Original Text】 The verbatim body text
【Explanation】 What the author is doing here, what can't be captured in Chinese, where the irony lies

The original text remains untouched; only context is added before and after. This is the fundamental difference from 'rewrite/summarize' tools.

When to Use

  • The user says a book is 'hard to follow,' 'too many references,' or 'wants to listen on the subway'
  • Need to create annotated guided readings for classic texts (philosophy, history, finance, literary criticism)
  • Need to convert an EPUB into segmented TTS-friendly reading scripts
  • Need to preserve the author's style and cannot accept AI rewriting of the original text

Not suitable for: Novels (narrative continuity is broken by background interruptions), technical manuals, picture books, or pure chart books.

Three Modes (Ask the User First)

ModeDescriptionUse Case
full (default)Add background and explanation to every sectionDense reference books for thorough reading
spotOnly add at dense reference/terminology spotsOnly want key supplements, read the rest straight
essayOnly add chapter-level introductions, no section explanationsAlready has foundation, just wants to clarify the structure

If the user doesn't specify, default to full.

Workflow

Step 0: Confirm the Template (Do Not Skip)

Do not start modifying the whole book immediately. First, create 1 sample unit to let the user check the tone, then proceed in batches after confirmation.

The sample should be the hardest passage in the book (most references, most hidden irony), not the easiest one.

Step 1: Extract and Segment

python3 scripts/extract.py --epub "book.epub" --out work/

Outputs:

  • work/units.json — Segmented units (title, body blocks, word count)
  • work/plan.md — Human-readable work draft, with original text per unit for reference when writing annotations

Segmentation rules (already implemented in script):

  • Use h1/h3/h4 and section titles as boundaries
  • Keep each unit between 400–1200 words; if a section is too long, split by paragraph around 1100 words
  • Merge fragments below 380 words into adjacent units
  • Treat 'bold short lines' (pseudo subheadings) in translations as sections

Step 2: Write Annotations

Following the format in templates/annotation.md, write bg and ex sections for each unit. Save as work/anno/*.json:

{"u012": {"bg": "This section discusses… (2–3 factual sentences)", "ex": "The author first sets up the target… (2–4 mechanism sentences)"}}

Write in batches (20–40 units per batch) and save immediately to avoid loss on interruption.

Step 3: Quality Check

python3 scripts/check.py --anno work/anno/

Checks: forbidden words, overly long sentences, dashes, coverage rate, empty fields.

Step 4: Generate Final Output

python3 scripts/build.py --units work/units.json --anno work/anno/ --out "book_title_guided_version.epub" --txt "book_title_reading_script.txt"

Produces two files:

  • _guided_version.epub — Retains original book images and paragraphs, adds new background/explanation blocks, readable on any e-reader
  • _reading_script.txt — Plain text with 【Background】【Original Text】【Explanation】 markers, ready for TTS

Copywriting Rules

When writing bg and ex, these seven rules are inviolable:

  1. Background gives only facts. Who, which book and volume, what era, original meaning of terms. No evaluation, no preview, no spoilers.
  2. Explanation says what the author is doing, not what they want to tell us. If there's irony, point out exactly which sentence it falls on.
  3. Do not restate the original text. The reader has just read it; do not retell the plot.
  4. Explain a concept only once. If it reappears later, do not expand.
  5. One idea per sentence, average 22 characters, normally no more than 45. Fact-dense sentences with proper nouns can go to 52 characters. This is for listening.
  6. Forbidden words: 'meaningful,' 'thought-provoking,' 'inspiring,' 'one can't help but,' 'to some extent,' 'one must say,' 'precisely,' 'profound,' 'insight,' 'underlying logic,' 'closed loop,' 'worthy of reflection,' 'makes one ponder.' Delete on sight.
  7. No em-dashes, no 'first/second/finally,' no metaphors to explain concepts.

On the original text side, only do two things: fix OCR errors (proper name translations, paragraph breaks) — leave everything else untouched. Document what was changed separately and inform the user upon delivery.

Common Pitfalls

PitfallConsequenceApproach
Modifying the whole book immediatelyWrong tone, complete reworkDo a sample first
Background written as book reviewSounds like clickbait contentGive only verifiable facts
Explanation written as reading reflectionReader's thinking is replacedDescribe actions and mechanisms, do not conclude
Unit too longListener forgets backgroundKeep between 400–1200 words
Each explanation mentions 'today's us'Repetitive, breaks immersionConnect a concept to reality only once
Changing the original textDestroys author's styleLeave every word intact
Table of contents not rebuiltChapters scrambled in readerbuild.py auto-rebuilds toc.ncx

File Structure

scripts/extract.py   EPUB → units.json + plan.md
scripts/build.py     units + anno → guided EPUB + reading script txt
scripts/check.py     Copy quality check
templates/annotation.md  Annotation format with examples and counterexamples

Delivery Script

Report three things to the user:

  1. How many units and words were processed
  2. Which original texts were changed (OCR correction list, must be itemized)
  3. Paths to the two deliverables, plus how to use the reading script (which app, speed suggestions)

Do not report a progress log of 'what I did'; only report verifiable differences.

Related Skills