Review any part of the book using parallel specialist agents
Review part of the book specified by $ARGUMENTS, using the project's book
review policies.
The user's $ARGUMENTS could be anything. Interpret them:
| Arguments | What to do |
|---|---|
| (empty) | Run git diff -- book/src/ and git diff --cached -- book/src/. Review the uncommitted changes. If no changes, say so and stop. |
| A file path | Read that file. Review the whole chapter. |
A file path with lines (foo.md:50-80) | Read that file. Focus the review on those lines (but read the full file for context). |
| Multiple file paths | Read all of them. Review each, and also look for consistency across them. |
| A section heading or topic name | Use Grep/Glob to find where that topic is discussed in book/src/. Read those sections. Review them. |
| A conceptual description ("how we explain X", "the transition between Y and Z") |
| Search the book to find the relevant passages. Read them with surrounding context. Review them as a unit. |
| A mix of the above | Handle each part, then review the union. |
If you're unsure what the user means, ask before launching reviewers.
Use Glob to find all .claude/book-review/*.md files.
Read .claude/book-review/standards.md (master standards shared by all
reviewers).
For EACH policy file except standards.md, launch a general-purpose
Task agent (use model sonnet). Give each agent a prompt constructed from
this template — adapt it based on what you're reviewing:
You are reviewing part of "The Ragu Book," a technical book about a recursive proof system (proof-carrying data framework).
Read these files:
.claude/book-review/standards.md(master standards that always apply).claude/book-review/{focus}.md(your specific review policy).claude/review-shared/surface-placement.md(book vs. rustdoc placement rules)What to review: {describe the specific content — file paths, line ranges, the topic, whatever the user specified. If reviewing a diff, include the diff text and list the full file paths for context.}
{If the scope is a diff or a narrow range, add: "Focus on the specified content. Flag issues in surrounding text ONLY if the specified content introduced an inconsistency with it."}
{If the scope spans multiple files or a concept, add: "Pay attention to consistency across the passages. Flag contradictions, redundancies, or gaps in the explanation as it spans these locations."}
If the policy references other files (like
book/macros.txtorbook/src/appendix/terminology.md), read those too.For each finding:
- Location: file path and quoted text (or line number)
- Issue: what's wrong, specifically
- Suggestion: a concrete rewrite, not just "improve this"
- Severity:
must-fix(clearly wrong/confusing) orsuggestionStay within your policy's scope. Be specific. If you find no real issues, say so — don't manufacture problems.
Tool usage rules:
- Use the Grep tool for searching file contents — do NOT run
greporrgas a Bash command.- Use the Read tool to read files — do NOT use
cat,head, ortail.- Use the Glob tool to find files — do NOT use
findorls.- When you do use Bash, the command must be a clean shell command with NO comment lines (
#) prepended. Put your reasoning in thedescriptionparameter, not in the command itself.
Additionally, read book/FIXME.md and extract the ###-level headings
under ## Deferred Issues. Include them in each reviewer's prompt as a
bullet list with the instruction:
The following issues are already tracked and deferred. Do NOT raise findings that duplicate or overlap with these items. If your finding is essentially the same issue, omit it.
{bullet list of ### headings from book/FIXME.md}
However, if while reviewing you notice that a deferred issue appears to have been resolved by existing content or is now easily resolvable given changes in the surrounding text, mention it as a separate observation (not a finding). Format:
- Resolvable FIXME: "{FIXME heading}" — {brief explanation of why it appears resolved or how to resolve it now}
Launch ALL agents in parallel (multiple Task calls in one message).
In parallel with the reviewer agents (launched in Step 2), run the automated QA scripts to detect broken links and dead pages:
python3 qa/book/broken_links.py — finds broken internal links and
invalid anchors (requires mdbook to be installed).python3 qa/book/dead_pages.py — finds markdown files not listed in
SUMMARY.md.python3 qa/book/line_width.py — finds lines exceeding the
80-character width limit (excludes code blocks, math blocks, and other
exempt content).If either script fails to run (e.g., mdbook is not installed), note the
failure in your output but do not block the review. Include any findings from
these scripts alongside the reviewer agents' results in the synthesis step.
Once all agents return, organize findings by location (earliest in the book first). If multiple reviewers flagged overlapping concerns, merge them. Present:
If the review scope was cross-file or conceptual, add a short section at the end about cross-cutting observations (consistency, narrative coherence, etc.).
Before presenting findings, read book/FIXME.md and remove any finding that
substantially overlaps with an already-deferred issue (match against the ###
headings). If you remove findings this way, do not mention them at all.
If any reviewer flagged a resolvable FIXME, collect them in a Potentially
Resolvable FIXMEs section after the main findings. The user can then use
/book-fixme to address them.
After synthesizing findings, but before presenting them to the user:
Collect all proposed changes (the "suggestion" field from each finding) into a single numbered list — the proposed plan.
For EACH policy file (same set as Step 2 — every .claude/book-review/*.md
except standards.md), launch a general-purpose Task agent (model
sonnet) with this prompt:
You are validating a set of proposed book edits against review policies.
Read these files:
.claude/book-review/standards.md(master standards).claude/book-review/{focus}.md(your policy).claude/review-shared/surface-placement.md(book vs. rustdoc placement rules).claude/review-shared/writing.md(shared writing rules).claude/review-shared/math.md(shared math rules)Here is the proposed plan of changes: {numbered list of proposed changes with locations and suggested rewrites}
For each proposed change, check whether applying it would introduce a violation of any rule in your policy or the master standards. Only flag real conflicts — do not restate rules that are already satisfied.
For each conflict found:
- Change #: which proposed change
- Rule violated: quote the relevant policy text
- Conflict: explain specifically how the suggestion violates the rule
- Resolution: suggest how to fix the suggestion to comply
Tool usage rules:
- Use the Grep tool for searching file contents — do NOT run
greporrgas a Bash command.- Use the Read tool to read files — do NOT use
cat,head, ortail.- Use the Glob tool to find files — do NOT use
findorls.- When you do use Bash, the command must be a clean shell command with NO comment lines (
#) prepended. Put your reasoning in thedescriptionparameter, not in the command itself.If no proposed changes conflict with your policy, say so.
Launch ALL agents in parallel.
Merge validation feedback into the findings. For each conflict:
If any suggestions were corrected, briefly note it in the synthesis output (e.g., "Grammar validator caught that suggestion #3 would violate the lowercase-technical-terms rule; corrected.").
After presenting findings, use AskUserQuestion to let the user decide the disposition of each finding (or group of closely related findings). For each,