Manage book chapters as individual numbered files with a TOC for ordering, reviews folder for version control, and subagent delegation for parallel writing.
book-directory/
├── toc.md ← Chapter order + assembly command (single source of truth)
├── 00-intro.md ← Individual chapter files (numbered)
├── 01-chapter.md
├── 02-chapter.md
├── reviews/ ← Version snapshots
│ ├── round-1-v1-01.md ← Before review round 1
│ ├── round-1-v2-01.md ← After review round 1
│ └── round-2-v1-02.md ← Before review round 2
├── full-book.md ← Assembled from toc.md order
├── full-book.html ← Generated HTML
└── book.pdf ← Generated PDF
Create toc.md as the single source of truth for chapter ordering:
# Book Title — Table of Contents
Order
File
Title
Status
0
00-intro.md
Intro
✅ keep
1
01-chapter.md
Chapter 1
🆕 new
2
02-chapter.md
Chapter 2
✍️ rewrite
3
03-chapter.md
Chapter 3
🆕 new
Assembly Command
bash
cat 00-intro.md 01-chapter.md 02-chapter.md 03-chapter.md > full-book.md
Status markers:
# Naming: round-N-vN-XX-chapter-name.md
mv 01-old-chapter.md reviews/round-4-v1-01-old-chapter.md
mv 02-old-chapter.md reviews/round-4-v1-02-old-chapter.md
Define the new chapter order and assembly command.
Write individual chapter files following the TOC order.
cat 00-intro.md 01-chapter.md 02-chapter.md > full-book.md
Use the book's PDF generation script (WeasyPrint or pandoc+LaTeX).
When inserting a chapter into an existing numbered sequence:
1. Write the new chapter at its target number (e.g., 03-new.md).
2. Rename files from the insertion point onward using mv, working backward to avoid collisions: mv 07-ch.md 08-ch.md, mv 06-ch.md 07-ch.md, etc.
3. Update chapter headings inside each renamed file (# Chapter N: Title).
4. Scan ALL chapter files for stale cross-references. This is the step most likely to be missed. Chapters frequently reference other chapters by number (e.g., "what I said in Chapter 3"). After renumbering, every such reference must be checked and updated. Use:
grep -rn "Chapter [0-9]" 0.md | grep -v "^0.:# Chapter"
5. Update the TOC and assembly command.
6. Verify with wc -w 0.md and grep -n "^# Chapter" 0.md.
When content is dispersed across multiple chapters and needs to be pulled into a single unifying chapter:
1. Read all existing chapters to identify where the target content lives. Note specific paragraphs, quotes, or data points.
2. Write the synthesis chapter that weaves the dispersed material into a coherent narrative. The new chapter should reference other chapters (cross-references) rather than duplicate their content.
3. Add cross-references in the existing chapters pointing back to the synthesis chapter (e.g., "see Chapter N for the full stack").
4. Lightly trim duplicate material in existing chapters where the synthesis chapter now covers it — but don't over-trim. Each chapter must still stand alone.
5. Renumber as needed (see Inserting workflow above).
When a book is assembled from separate blog posts, repeated sentences and structural patterns survive compilation. Blog posts need self-contained context; books don't.
Run after cat assembly into full-book.md:
from collections import Counter
import re
sentences = []
for line in open('full-book.md'):
for sent in re.split(r'(?<=[.!?])\s+', line.strip()):
if len(sent) > 40:
sentences.append(sent)
dups = {s: c for s, c in Counter(sentences).items() if c > 1}
| Category | What it looks like | Action |
|---|---|---|
| Exact sentence duplicates | Same sentence in 2+ chapters | Keep the version with more context; rephrase the other |
| Meta-references | "This book..." appearing in mid-chapters | Change to chapter-specific ("I wrote this chapter...") |
| Formulaic closers | "The X effect is the point" / "compounding has barely started" | Keep one instance (usually the first); vary the rest |
1. Exact duplicates first (mechanical, low risk)
2. Meta-references (light touch)
3. Formulaic closers (editorial judgment)
4. Full read-through after edits to catch rhythm breaks and transitions that now feel abrupt
Some repeated sentences serve different arguments in different chapters (e.g., "Before Hermes, I ran this on discipline alone" in WINS intro vs. Self chapter). Don't blindly delete — check whether the sentence earns its place in each context.
After patching individual chapter files, reassemble and verify:
cat 00-intro.md 01-chapter.md ... > full-book-v3.md
Then verify duplicates are gone:
from collections import Counter
import re
with open('full-book-v3.md') as f:
content = f.read()
sentences = []
for line in content.split('\n'):
for sent in re.split(r'(?<=[.!?])\s+', line.strip()):
if len(sent) > 40:
sentences.append(sent)
dups = {s: c for s, c in Counter(sentences).items() if c > 1}
if dups:
for s, c in dups.items():
print(f'[{c}x] {s[:120]}')
else:
print('No exact duplicates remain.')
Also verify chapter structure: grep -n "^# " full-book-v3.md — check for duplicate chapter numbers (e.g., two "Chapter 6" headings from different source files).
When writing multiple chapters, delegate to subagents in parallel:
goal: Write Chapter N: "Title" for [book name].
Source material: [list files to read]
Requirements: [voice, style, word count]
Structure: [section outline]
Output: Save to /path/to/0N-chapter.md
1. Verify all files exist: ls -la 0*.md
2. Check word counts: wc -w 0*.md
3. Assemble: cat 00-.md 01-.md ... > full-book.md
4. Generate PDF
round-N-vN-XX-chapter-name.md
reviews/
├── round-1-v1-00-intro.md
├── round-1-v2-00-intro.md
├── round-2-v1-03-moving-to-vps.md
└── round-4-v1-07-stock-screening.md
When a chapter has [!hh] callout comments left by Joseph during review:
Load the no-ai-slop skill before editing. Process ALL callouts in one pass, not one at a time.
See references/editorial-callout-patterns.md for observed callout types and examples.
After resolving callouts, run the no-ai-slop rules on the full chapter: em-dashes, AI words, tight paragraphs, strong verbs.
When callouts mention content repeated in another chapter:
Don't answer callout questions inside the document. Resolve them by editing the text or flagging to the user in your response.
1. Check for existing reviews folder. Before creating reviews/, check if it already exists. User may have created it in a previous session.
2. Don't mix chapter files with reviews. Keep the working directory clean — only current chapter files at the top level.
3. Update toc.md when reordering. The TOC is the single source of truth. If you reorder chapters, update the TOC first.
4. Verify subagent output. Subagents self-report completion. Check that files exist and have reasonable word counts before assembling.
5. Preserve YAML frontmatter. Each chapter file should have YAML frontmatter with title. The assembly command concatenates them as-is.
6. Don't regenerate PDF after every edit. Wait until all chapters in a batch are reviewed before regenerating.
7. Blog-to-book deduplication. After compiling from blog posts, scan for repeated sentences, meta-references, and formulaic closers. See workflow above.
8. Chapter numbering. When source files have their own heading numbers, they may collide after assembly (e.g., two files both labeled "Chapter 6"). Verify chapter headings are unique after reassembly.
9. Stale cross-references after renumbering. Chapters frequently reference other chapters by number in examples, hypothetical callouts, or inline prose (e.g., "what I said in Chapter 3"). After inserting or renumbering, scan every file for these references. They don't show up as heading collisions — they just silently point at the wrong chapter. Use grep -rn "Chapter [0-9]" 0.md | grep -v "^0:# Chapter" to find them.
10. Verify technical claims in editorial callouts. When a [!hh] callout says "validate this" or questions a technical claim, check the actual source (skill files, config, logs) before removing the callout. Don't assume the draft is correct just because it reads well. The transcript-routing cost claim (36 cents vs. 8-12 cents) needed verification against the youtube-content skill, for example.
11. Cross-chapter content duplication. When a callout flags content repeated in another chapter, read both chapters before recommending cuts. Some repetition serves different arguments (standalone article vs. connected book). Recommend, don't cut — the user decides what earns its place in each context.