/l3a0:book-textfrom l3a0
Converts a book PDF into page-numbered plain text and reading parts, handling both text-layer PDFs (via pdftotext) and scanned PDFs (via Apple Vision OCR with preprocessing). Useful when Kindle Cloud Reader fails or for checking citations against printed page numbers.
Ships in l3a0. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A reading or citation pipeline needs a book's text with its printed page numbers attached, so that a quote can be checked against the page it cites. The kindle-highlights skill gets text from the Kindle Cloud Reader, but on 2026-11-03 the Cloud Reader would not open two books, Code Complete and Rapid Development, both Microsoft Press editions. The owner supplied PDFs of their own copies instead, and this skill holds the two routes worked out on those PDFs.
Every route ends in the same files in one run directory:
book_pages.txt, the whole book as page blocks.parts/NAME.txt, one file per reading part, each a printed page range of the same blocks.A page block is one PDF page of text under a header line:
===== pdf 101 | p. 64 =====
The first number is the 1-based PDF page and the second is the printed page. The difference between them is the book's offset, 37 in this example, and it is one number for the whole book. A page before printed page 1 gets front N instead of p. M, where N is again the PDF page number. A scanned page's margin column follows its body on one line that starts [margin] .
Keep the run directory outside every repository. It holds a copyrighted book's full text. Every script refuses an output folder inside a git repository, since one git add -A there would stage the book. The 2026-11-03 runs used ~/Documents/Claude/kindle/<book-slug>/, beside the book's Kindle highlights. No book page, crop or OCR output may enter a tracked file, a test fixture or a pull request.
pdfinfo, pdffonts, pdftotext and pdfimages. Install it with brew install poppler.prep.py only. Either install it for python3, or use uv, whose uv run -q --with 'pillow>=10' python <script> fetches it for one run.ocr_pages.py compiles Apple Vision's text recognizer with swiftc on first use.The scripts sit in scripts/ next to this file. The commands below write $SKILL for that folder and $RUN for the run directory.
A PDF either carries a text layer, which is the book's characters stored as text, or only pictures of its pages. pdffonts tells them apart, because a text layer needs fonts:
pdfinfo BOOK.pdf # page count, and the program that made the file
pdffonts BOOK.pdf # a list of fonts means a text layer; a header with no rows means images only
Code Complete listed its fonts and was made by FrameMaker, so it took route A. Rapid Development listed no fonts and was made by Chrome's print to PDF, so it took route B.
python3 $SKILL/text_layer.py BOOK.pdf $RUN --part 1-intro:1-50 --part 2-design:51-120
The script works in four steps.
pdftotext -enc UTF-8 into $RUN/book.txt. pdftotext writes a form feed after every page, so splitting at form feeds gives one piece of text per PDF page.--offset N overrides the vote.--drop regular expression. A download site's watermark is the usual target, so the script prints every line on two or more pages that carries a web address. Rerun with --drop naming it. The script prints each distinct line it dropped and the PDF pages it came from, so a pattern that also catches the book's own lines shows at once.book_pages.txt and one part per --part NAME:FIRST-LAST, where FIRST and LAST are printed pages. Part files from an earlier run are removed first, and a part whose range runs past the book says how many pages it fell short.These figures come from one run on 2026-11-03, on the owner's 952-page PDF, which stays outside the repository.
[margin] line.book.txt before trusting the report.Route B runs OCR twice. The first pass reads whole pages, and the second reads cleaned crops of each page. The first pass alone lost text on Rapid Development in two ways.
The first pass is still needed, because it locates the body column that the second pass splits at.
pdfimages -list BOOK.pdf | head # one image per page is what the rest assumes
mkdir -p $RUN/pages && pdfimages -p -png BOOK.pdf $RUN/pages/p
-p puts the page number in each name, so p-001-000.png is the first image on PDF page 1. stitch.py reads that number, and it stops on a page with two images or a page with no image. A missing last page shows only against the page count, so pass --pages from pdfinfo to stitch.py. Without -p, pdfimages numbers images from p-000.png, which matches pages only when every page holds exactly one image. The 2026-11-03 run used that plain form, and Rapid Development gave 672 images for 672 pages, each about 1104 by 1387 pixels at 210 pixels per inch.
python3 $SKILL/ocr_pages.py $RUN/pages $RUN/text --jobs 8
ocr_pages.py runs Vision on each image, several at a time, and writes <stem>.ocr.tsv, one recognized line per row as y, x and the text, where y and x are the line's top and left edges as fractions of the page. It compiles the Vision program that kindle-highlights ships, skills/kindle-highlights/scripts/ocr.swift, into $RUN/bin/ocr on first use. The script points at that file rather than copying it, so the two skills share one recognizer, and it relies on that program's output staying y, x, text. A rerun skips an image whose .tsv is newer than the image, so a stopped run resumes and a remade crop is read again. A .tsv appears only once its OCR has finished. An image whose OCR fails gets no .tsv, and the script exits 1. A .tsv whose image has gone from the folder is removed.
uv run -q --with 'pillow>=10' python $SKILL/prep.py $RUN/pages $RUN/text $RUN/clean
prep.py changes each page in three ways.
--threshold sets the level. Text printed in a gray lighter than the threshold vanishes with the shading, so lower the threshold if that happens.--gap). The body column's left edge is the 10th percentile, by lower rank, of the x of the first pass's lines longer than 45 characters (--percentile, --min-chars), since only body text runs that long. A page with no such line keeps one whole-page body crop, and the script lists those pages. --split FRACTION cuts every page at one fixed fraction instead.--border, --scale). The border keeps text off the crop's edge, where the cut runs, and the scaling enlarges small type such as the margin notes.The hand run cut at the median x minus 3%, and a review of it on 2026-11-03 found two faults, measured on 590 pages with an ordinary layout. A page's body edge was found from its pixels and compared with each rule's cut.
The 10th percentile minus 2% lost letters on none of the 590 pages and clipped notes on 1. A second OCR pass under the new rule agreed, with margin slivers in the body falling from 174 pages to 2.
python3 $SKILL/ocr_pages.py $RUN/clean $RUN/text2 --glob '*.png' --jobs 8
python3 $SKILL/stitch.py $RUN/pages $RUN/text2 $RUN --first-pass $RUN/text --pages 672 --part 1-intro:1-50
Each page block holds the body lines in reading order, then one [margin] line carrying the margin column. A hyphen at a line end joins to the next line when that line starts in lowercase, which mends a word split across lines. The offset comes from the first pass's header and footer numbers, the same vote route A takes, or from --offset N, which wins when both are given. The script stops when a page has no body .tsv, since that means its OCR failed. It lists the pages with no text, and separately the pages with margin text but an empty body.
These figures come from runs on 2026-11-03, on the owner's 672-page PDF, which stays outside the repository.
prep.py, which used the hand run's median rule, made crops byte-identical to the hand run's. The second pass's .tsv files matched, and all 650 printed pages of book_pages.txt matched. The default cut has since changed, as B3 says.[margin] line, filed the left column of 4 two-column index pages under [margin], and still cut into tables or figures that start near the left edge on 11 of 19 such pages. Read those pages against their images.prep.py cuts one vertical line per page. A book with its margin on the right, or on alternating sides, needs --split per side or a change to crops().--part ranges and ctx.py reach printed pages only. Front matter stays in book_pages.txt.prep.py and stitch.py run anywhere.python3 $SKILL/ctx.py $RUN/book_pages.txt '64:the quoted words' '212:another quote'
python3 $SKILL/ctx.py $RUN/book_pages.txt --check '64:the quoted words' '212:another quote'
Without --check, ctx.py prints 260 characters either side of each quote on its cited page, in the book's own case, or NOT FOUND. A quote that starts on the cited page and runs onto the next counts as on the cited page. With --check, it prints one verdict per citation.
Matching ignores case, runs of whitespace, curly against straight quotes, and hyphens, so a word split across lines and a compound broken at its hyphen both match. The script exits 1 on any MISS or NOT FOUND, so a pipeline can stop on a bad citation. A quote from a scanned book can miss on an OCR error rather than a wrong page, so read the context before calling the citation wrong.
tests/test_book_text.py checks every script on inputs it makes itself: a PDF written byte by byte, page images drawn with Pillow that carry a gray box and a margin note, hand-written OCR rows, and a stand-in OCR program for ocr_pages.py. On macOS it also runs Vision end to end on a drawn page and checks that the shaded text survives and the margin note lands on the [margin] line. CI runs it on Linux, where only that Vision check skips.
uv run -q --with 'pillow>=10' python tests/test_book_text.py
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/ask-boardConvene a board of directors on a strategic decision for a one-person venture. Separate advisor agents, each with its own objective, write blind memos and cross-examine. A secretary agent drafts the synthesis without knowing the CEO's view, and the main thread chairs and keeps the minutes. Use when the user asks to "ask the board", "what would my board say", "convene the board", "give me board feedback on" a plan, or asks a strategic question as the CEO or sole operator of their own venture, such as "should I do X first", "what should I focus on first", or "is my plan right or wrong"./ask-teamConvene a repository's engineering team on a plan, a design, a pull request or a blog post. Separate role agents, one per role, each review the same subject blind to the others, holding only what their role protects and may veto. Verifiers then try to refute each finding by executing code, and only what survives is acted on. Use when asked to "ask the team", "convene the team", "have the team review" an issue, a design doc, a pull request or a blog post, to audit an issue's plan before a build starts, or for the per-role lenses a repository's team charter names for its review step. A pull request review or a post review such as review-post can call it in lens mode, where it returns verified findings to the caller and posts and fixes nothing. To run a whole review round on a pull request, or on companion pull requests that land one rule in several repositories, with its brief, its lenses, its verifiers, its fixes and its review comment, read review-round.md. Not for owner decisions about money, live trading, contracts or law, which go to the board through /l3a0:ask-board./book-to-rulesTurn a book into rules for an engineering team and design principles for repositories, with every cited page checked against the book's text. Gets the full text, splits it into reading parts, briefs one reader agent per part, merges the notes into rules, writes them into a project repository, this plugin's role checks and board seats, and l3a0/repo-template as one pull request each, runs a review round whose verifiers refute by executing, and prices the loop. Use when asked to "adopt a book", "turn this book into rules", "read this book into the repos", or to add a book's principles to a design doc, a team charter or the plugin's agents./clear-wall-of-textTurn a dense passage in a design doc, architecture doc, charter or README into text a reader follows on one read, with every fact kept. Gives each question a subheading, breaks steps into a numbered list, puts conditions into a titled table, draws a mechanism as a Mermaid diagram or a sketch, and states each cited rule in plain words. Use when asked to make a wall of text easier to understand, to break up a dense paragraph, or to add diagrams or sketch notes to a passage of one of those documents. Not for a blog post, whose review and sketch notes belong to `review-post` and `sketch-notes` in the repository that holds the post./fast-mutationRun a mutation review fast, by scripting every mutant into one call scoped to the tests that reach it, instead of one tool round trip per edit. Drives pytest, or a suite of plain test scripts that exit non-zero on a failure. Use for a mutation lens on a pull request, for confirming that a new test catches the bug it claims to, or whenever a mutation run is taking far longer than its tests do./find-free-cashWork out how much cash in a brokerage account is free to spend without margin, after what short puts, spreads and open orders hold back, and how many shares of something it buys. Use when asked how much cash is in Schwab, Fidelity or another linked account, how many shares of SGOV or anything else the cash buys, what buying power is without margin, or to check a cash figure against a thinkorswim screenshot.npx claudepluginhub l3a0/claude-plugins --plugin l3a0Other plugins' skills for the same job