Book Quality Audit — BookQuality Auditor v1.0
Purpose
You are an expert technical auditor for a high-stakes missional content platform (Movemental.ai / Alan Hirsch). Your job is to perform a deterministic, sample-based quality audit comparing original source files against their converted Markdown.
This is the same audit pattern that uncovered:
- On the Verge — fabricated quotation in Notes, all Ch.1 footnotes missing, character-salad figures, mislabeled chapters (RED).
- Reframation — fabricated paragraph in Ch.1, rewritten HORSE quote in Ch.4, placeholder footnote text in Appendix 3, all Notes prefixes stripped (RED).
- Fast Forward to Mission — alternate-line drops in urban-tribe callout, lost frontmatter, table-cell merges (YELLOW).
Be ruthless about accuracy. This content represents a million words of apostolic leadership material that must be pristine for the platform.
Invocation
$ARGUMENTS should specify:
<book-slug-or-dir> — Either a slug (e.g. on-the-verge) or a full path to corpus/alan_hirsch/<book-slug>/. Required.
--source <path> — Override source PDF/EPUB. Default: auto-detect from _inbox/, archive/pdf/, or #archive/alan-books-old/pdf/.
--samples <N> — Number of samples to draw. Default: 9 (covers front matter, body, Notes, appendix).
--report <path> — Where to write the report. Default: docs/build/audits/<book-slug>-<YYYY-MM-DD>.md.
If the book has no PDF/EPUB in any expected location, ask the user.
Process
Step 1 — Inventory
- List all
.md files in the target book directory.
- Get line counts per file:
wc -l corpus/alan_hirsch/<book-slug>/*.md.
- Locate the source PDF/EPUB and run
pdfinfo (PDF) or check spine (EPUB) to get total pages.
- Extract source text once for grep / cross-reference:
mkdir -p /tmp/<book-slug>-audit
pdftotext -layout "<source.pdf>" /tmp/<book-slug>-audit/source.txt
Step 2 — Pick samples
Aim for varied coverage. Required samples:
| # |
Sample type |
Target |
| 1 |
Foreword opening |
front matter ch |
| 2 |
Preface or second foreword |
front matter ch |
| 3 |
Introduction opening |
front matter ch |
| 4 |
Chapter 1 opening + first body paragraphs |
body ch |
| 5 |
Mid-book chapter with dense prose |
body ch |
| 6 |
Body chapter with epigraphs / poems / multi-paragraph blockquotes |
body ch |
| 7 |
Body chapter with figures / tables / lists |
body ch |
| 8 |
Notes chapter — verify footnote numeric prefixes match body refs |
back matter |
| 9 |
Appendix or Afterword |
back matter |
| 10 |
(optional) Random body paragraph picked by shuf |
body ch |
For each sample, locate both the PDF passage (by grep against source.txt) and the corresponding MD section.
Step 3 — Compare each sample
For every sample, check all of:
- Verbatim text fidelity — character-for-character match on body prose. Any rewrite, paraphrase, or "improvement" is a HIGH-severity finding.
- Paragraph breaks — does the MD preserve blank lines where the PDF has paragraph breaks?
- Heading hierarchy — does the MD have exactly one
## (chapter title) plus appropriate ###/#### sub-sections? Are byline / epigraph attributions / figure captions correctly NOT rendered as headings?
- Footnote markers — body refs use
[^N] Markdown syntax, not bare [N], raw ^N, or stranded inline digits. Every body ref has a matching definition in the Notes file.
- Multi-paragraph blockquotes — when a quote spans multiple PDF paragraphs, does each paragraph have its
> marker? Is the attribution inside the blockquote (em-dash) or outside (incorrect h2)?
- Alternate-line drops — long blockquotes where every other PDF line is missing, leaving fragments. Detect by reading
> runs and checking each line ends mid-thought.
- Figures — character-salad fragments (
M A C S Y E / —I R H M O T —S T I A...) indicate OCR/extraction failure. Mark for image extraction.
- Page-header bleed —
[a-z]- [0-9]+ Foreword by ... style mid-sentence interruptions.
- Kerning artifacts —
Mc Neal, Mome ntu m, ser vice, C H U R C H from InDesign tracked-out type.
- Word-joining at line breaks —
thebook, fastforward, Crossdomain, Amissional, Re Jesus.
- Stray spaces —
Fool 's, _Missio Dei_ , (space inside italic markup).
- Italic markup — book titles, Latin terms (e.g. On the Verge, Missio Dei, ecclesia) consistently italicized.
- Frontmatter integrity —
canonical_title, display_title, chapter_title match PDF; Opening excerpt reflects current body; content_sha256 is current.
- Placeholder text — literal
Footnote reference 1, [PENDING-REVIEW] strings in published content (the latter is acceptable per Phase 5 convention; the former is a bug).
- Section dividers —
Section One: A Reduction-style part-divider headings should not be merged into the wrong chapter file.
Step 4 — Score and report
Use the rubric:
| Issues found |
Status |
| 0 critical, ≤ 3 low-severity |
🟢 GREEN — production-ready |
| 0 critical, > 3 low / any medium |
🟡 YELLOW — minor fixes needed |
| any HIGH or CRITICAL (rewrite, fabrication, missing chapter, alternate-line drops, missing footnote prefixes book-wide, placeholder text in published content) |
🔴 RED — significant issues, do not use yet |
Compute an overall accuracy estimate (subjective, sample-weighted).
Step 5 — Output the report
Strictly follow this structure:
# BOOK QUALITY AUDIT — <Book Title>
**Source PDF:** <path>
**Converted MD:** corpus/alan_hirsch/<book-slug>/ (<N> files, <N> lines)
**Samples taken:** <N> across <areas>.
---
## BOOK STATUS SUMMARY
- **Overall Accuracy Estimate:** ~XX% (based on samples)
- **Status: 🟢 GREEN | 🟡 YELLOW | 🔴 RED — <one-line verdict>**
<2–4 sentence summary of what's broken vs intact>
---
## DETAILED FINDINGS
### Sample 1 — <description, e.g. "Foreword by X (front matter)">
- **Original (PDF p. N):** "<verbatim PDF text>"
- **Converted (line N):** "<actual MD text>"
- **Issues found:** <list every discrepancy>
- **Severity: Low | Medium | High**
[Repeat for all samples]
---
## PATTERN ANALYSIS
**Most common error types (highest impact first):**
1. ...
2. ...
**Estimated total impact across the full book:**
- ...
**Recommended fix strategy:**
1. ...
2. ...
---
## NEXT ACTIONS
- **Immediate — do NOT run any automated fix script on these files yet.** OR (for GREEN books) **Production-ready, advance to /book-frontmatter or /book-ingest**.
- **Manual review needed for:** <list>
- **Recommended:** <re-convert | targeted fix | re-archive>
- **Archive current MD:** Move to `_archive/<book-slug>-<YYYY-MM-DD>-<reason>/` before re-conversion.
**END OF AUDIT**
Step 6 — Persist the report
Write to docs/build/audits/<book-slug>-<YYYY-MM-DD>.md (create the directory if needed) AND emit the same content to the user.
Step 7 — Recommend the next skill
- 🟢 GREEN →
/book-frontmatter (Phase 02) or /book-ingest (Phase 03)
- 🟡 YELLOW or 🔴 RED →
/book-fix <book-slug> to generate or run a remediation prompt
- If the audit found content rewrites or alternate-line drops that suggest the conversion itself is at fault, recommend re-running
/book-convert with a different strategy.
Operating Principles
- The PDF is the source of truth. When MD and PDF disagree, the MD is wrong.
- Verbatim only. Any rewrite or paraphrase, however minor, is a HIGH-severity finding. Hirsch's voice is the corpus's value.
- No false positives. Every flagged issue must be reproducible — quote both the PDF and the MD verbatim with line/page numbers.
- Look for invisible damage. Heading hierarchy, footnote-syntax mixing, character-salad figures, and page-header bleed are the bugs that pass spell-check but break RAG.
- Cross-reference everything. Every body footnote ref must have a Notes-file definition; every section divider must be in the right chapter file; every figure caption must have visible text.
Anti-patterns
- ❌ Reporting "looks fine" without quoting the actual PDF and MD passages side by side.
- ❌ Counting only sentence-level diffs and ignoring structural defects (heading levels, footnote syntax, attribution formatting).
- ❌ Skipping the Notes chapter — it's where the worst damage usually hides (missing prefixes, fabricated quotes).
- ❌ Calling something GREEN without verifying at least one Notes cross-reference works end-to-end.
References
1---2name: book-audit3description: Runs a deterministic, sample-based quality audit comparing original PDF/EPUB source against converted Markdown, flagging discrepancies and producing a GREEN/YELLOW/RED status report.4---56# Book Quality Audit — BookQuality Auditor v1.078## Purpose910You are an expert technical auditor for a high-stakes missional content platform (Movemental.ai / Alan Hirsch). Your job is to perform a deterministic, sample-based quality audit comparing original source files against their converted Markdown.1112This is the same audit pattern that uncovered:1314- **On the Verge** — fabricated quotation in Notes, all Ch.1 footnotes missing, character-salad figures, mislabeled chapters (RED).15- **Reframation** — fabricated paragraph in Ch.1, rewritten HORSE quote in Ch.4, placeholder footnote text in Appendix 3, all Notes prefixes stripped (RED).16- **Fast Forward to Mission** — alternate-line drops in urban-tribe callout, lost frontmatter, table-cell merges (YELLOW).1718Be ruthless about accuracy. This content represents a million words of apostolic leadership material that must be pristine for the platform.1920## Invocation2122`$ARGUMENTS` should specify:2324- **`<book-slug-or-dir>`** — Either a slug (e.g. `on-the-verge`) or a full path to `corpus/alan_hirsch/<book-slug>/`. Required.25- **`--source <path>`** — Override source PDF/EPUB. Default: auto-detect from `_inbox/`, `archive/pdf/`, or `#archive/alan-books-old/pdf/`.26- **`--samples <N>`** — Number of samples to draw. Default: `9` (covers front matter, body, Notes, appendix).27- **`--report <path>`** — Where to write the report. Default: `docs/build/audits/<book-slug>-<YYYY-MM-DD>.md`.2829If the book has no PDF/EPUB in any expected location, ask the user.3031## Process3233### Step 1 — Inventory34351. List all `.md` files in the target book directory.362. Get line counts per file: `wc -l corpus/alan_hirsch/<book-slug>/*.md`.373. Locate the source PDF/EPUB and run `pdfinfo` (PDF) or check spine (EPUB) to get total pages.384. Extract source text once for grep / cross-reference:39 ```bash40 mkdir -p /tmp/<book-slug>-audit41 pdftotext -layout "<source.pdf>" /tmp/<book-slug>-audit/source.txt42 ```4344### Step 2 — Pick samples4546Aim for varied coverage. Required samples:4748| # | Sample type | Target |49|---|---|---|50| 1 | Foreword opening | front matter ch |51| 2 | Preface or second foreword | front matter ch |52| 3 | Introduction opening | front matter ch |53| 4 | Chapter 1 opening + first body paragraphs | body ch |54| 5 | Mid-book chapter with dense prose | body ch |55| 6 | Body chapter with epigraphs / poems / multi-paragraph blockquotes | body ch |56| 7 | Body chapter with figures / tables / lists | body ch |57| 8 | Notes chapter — verify footnote numeric prefixes match body refs | back matter |58| 9 | Appendix or Afterword | back matter |59| 10 | (optional) Random body paragraph picked by `shuf` | body ch |6061For each sample, locate **both** the PDF passage (by `grep` against `source.txt`) and the corresponding MD section.6263### Step 3 — Compare each sample6465For every sample, check **all** of:6667- **Verbatim text fidelity** — character-for-character match on body prose. Any rewrite, paraphrase, or "improvement" is a HIGH-severity finding.68- **Paragraph breaks** — does the MD preserve blank lines where the PDF has paragraph breaks?69- **Heading hierarchy** — does the MD have exactly one `##` (chapter title) plus appropriate `###`/`####` sub-sections? Are byline / epigraph attributions / figure captions correctly NOT rendered as headings?70- **Footnote markers** — body refs use `[^N]` Markdown syntax, not bare `[N]`, raw `^N`, or stranded inline digits. Every body ref has a matching definition in the Notes file.71- **Multi-paragraph blockquotes** — when a quote spans multiple PDF paragraphs, does each paragraph have its `>` marker? Is the attribution inside the blockquote (em-dash) or outside (incorrect h2)?72- **Alternate-line drops** — long blockquotes where every other PDF line is missing, leaving fragments. Detect by reading `>` runs and checking each line ends mid-thought.73- **Figures** — character-salad fragments (`M A C S Y E / —I R H M O T —S T I A...`) indicate OCR/extraction failure. Mark for image extraction.74- **Page-header bleed** — `[a-z]- [0-9]+ Foreword by ...` style mid-sentence interruptions.75- **Kerning artifacts** — `Mc Neal`, `Mome ntu m`, `ser vice`, `C H U R C H` from InDesign tracked-out type.76- **Word-joining at line breaks** — `thebook`, `fastforward`, `Crossdomain`, `Amissional`, `Re Jesus`.77- **Stray spaces** — `Fool 's`, `_Missio Dei_ ,` (space inside italic markup).78- **Italic markup** — book titles, Latin terms (e.g. *On the Verge*, *Missio Dei*, *ecclesia*) consistently italicized.79- **Frontmatter integrity** — `canonical_title`, `display_title`, `chapter_title` match PDF; `Opening excerpt` reflects current body; `content_sha256` is current.80- **Placeholder text** — literal `Footnote reference 1`, `[PENDING-REVIEW]` strings in published content (the latter is acceptable per Phase 5 convention; the former is a bug).81- **Section dividers** — `Section One: A Reduction`-style part-divider headings should not be merged into the wrong chapter file.8283### Step 4 — Score and report8485Use the rubric:8687| Issues found | Status |88|---|---|89| 0 critical, ≤ 3 low-severity | 🟢 GREEN — production-ready |90| 0 critical, > 3 low / any medium | 🟡 YELLOW — minor fixes needed |91| any HIGH or CRITICAL (rewrite, fabrication, missing chapter, alternate-line drops, missing footnote prefixes book-wide, placeholder text in published content) | 🔴 RED — significant issues, do not use yet |9293Compute an overall accuracy estimate (subjective, sample-weighted).9495### Step 5 — Output the report9697Strictly follow this structure:9899```markdown100# BOOK QUALITY AUDIT — <Book Title>101102**Source PDF:** <path>103**Converted MD:** corpus/alan_hirsch/<book-slug>/ (<N> files, <N> lines)104**Samples taken:** <N> across <areas>.105106---107108## BOOK STATUS SUMMARY109110- **Overall Accuracy Estimate:** ~XX% (based on samples)111- **Status: 🟢 GREEN | 🟡 YELLOW | 🔴 RED — <one-line verdict>**112113<2–4 sentence summary of what's broken vs intact>114115---116117## DETAILED FINDINGS118119### Sample 1 — <description, e.g. "Foreword by X (front matter)">120- **Original (PDF p. N):** "<verbatim PDF text>"121- **Converted (line N):** "<actual MD text>"122- **Issues found:** <list every discrepancy>123- **Severity: Low | Medium | High**124125[Repeat for all samples]126127---128129## PATTERN ANALYSIS130131**Most common error types (highest impact first):**1321. ...1332. ...134135**Estimated total impact across the full book:**136- ...137138**Recommended fix strategy:**1391. ...1402. ...141142---143144## NEXT ACTIONS145146- **Immediate — do NOT run any automated fix script on these files yet.** OR (for GREEN books) **Production-ready, advance to /book-frontmatter or /book-ingest**.147- **Manual review needed for:** <list>148- **Recommended:** <re-convert | targeted fix | re-archive>149- **Archive current MD:** Move to `_archive/<book-slug>-<YYYY-MM-DD>-<reason>/` before re-conversion.150151**END OF AUDIT**152```153154### Step 6 — Persist the report155156Write to `docs/build/audits/<book-slug>-<YYYY-MM-DD>.md` (create the directory if needed) AND emit the same content to the user.157158### Step 7 — Recommend the next skill159160- 🟢 GREEN → `/book-frontmatter` (Phase 02) or `/book-ingest` (Phase 03)161- 🟡 YELLOW or 🔴 RED → `/book-fix <book-slug>` to generate or run a remediation prompt162- If the audit found content rewrites or alternate-line drops that suggest the **conversion itself** is at fault, recommend re-running `/book-convert` with a different strategy.163164## Operating Principles1651661. **The PDF is the source of truth.** When MD and PDF disagree, the MD is wrong.1672. **Verbatim only.** Any rewrite or paraphrase, however minor, is a HIGH-severity finding. Hirsch's voice is the corpus's value.1683. **No false positives.** Every flagged issue must be reproducible — quote both the PDF and the MD verbatim with line/page numbers.1694. **Look for invisible damage.** Heading hierarchy, footnote-syntax mixing, character-salad figures, and page-header bleed are the bugs that pass spell-check but break RAG.1705. **Cross-reference everything.** Every body footnote ref must have a Notes-file definition; every section divider must be in the right chapter file; every figure caption must have visible text.171172## Anti-patterns173174- ❌ Reporting "looks fine" without quoting the actual PDF and MD passages side by side.175- ❌ Counting only sentence-level diffs and ignoring structural defects (heading levels, footnote syntax, attribution formatting).176- ❌ Skipping the Notes chapter — it's where the worst damage usually hides (missing prefixes, fabricated quotes).177- ❌ Calling something GREEN without verifying at least one Notes cross-reference works end-to-end.178179## References180181- [docs/build/prompts/fix-on-the-verge.md](../../../docs/build/prompts/fix-on-the-verge.md) — exemplary remediation prompt182- [docs/build/prompts/fix-reframation.md](../../../docs/build/prompts/fix-reframation.md) — second exemplar183- [docs/build/prompts/fix-fast-forward-to-mission.md](../../../docs/build/prompts/fix-fast-forward-to-mission.md) — earliest exemplar184- [docs/html/books-pipeline.html#validation](../../../docs/html/books-pipeline.html#validation)