Ebook Pipeline
Seven agents that write and package a book — plus the research memo arguing it won't sell.

Why I built it
I wanted to see how far a multi-agent pipeline could get toward a finished, Gumroad-ready ebook from nothing but a topic — not as a business plan, but as a test of whether an agent chain could hold together across a genuinely long task: outline, seven chapters, edit pass, and packaging, without me touching anything in between.
Seven agents, one state file
Topic intake, an architect that builds the outline, a writer and summarizer looping chapter by chapter, an editor, a QA gate, and a packager that produces the EPUB, cover, and metadata. Every step writes to a state file before the next one runs, so a crash midway resumes instead of restarting. A real run looks like this:
[pipeline] Agent 0: topic intake [pipeline] Agent 1: architect (outline) [pipeline] Agents 2+3: writing chapters writing chapter 1/7 ... 7/7 [pipeline] Agent 4: light edit pass [pipeline] Agent 5: QA gate QA passed (24864 words) [pipeline] Agent 6: packaging (front matter, metadata, EPUB/PDF, cover) [pipeline] DONE -> books\the-salt-glass-letters
The QA gate doesn't grade on a curve
It hard-fails on word count, truncation, and AI-leak — no partial credit. The same run above also reported its own gaps honestly: PDF conversion skipped because no engine was installed, Calibre validation skipped because Calibre wasn't found. I'd rather the pipeline tell me what it didn't do than quietly hand me something broken.
The research argues against itself
Before writing a line of code, I wrote up the actual economics: Gumroad versus Lemon Squeezy versus Payhip on VAT handling, API automatability, and AI-content policy, plus what the pipeline costs to run per book. The honest conclusion sits right there in the same document:
“With no marketing and no audience, expected sales are close to zero — plan for 0–3 sales per book.”
I kept building it anyway, because the point was never the business case. It was whether the agent chain would hold.
What I'd tell someone building this
Make the QA gate code, not a prompt. A model asked to grade its own output will talk itself into a pass; a script checking word count and scanning for truncation won't. The one honest failure report in that terminal output above is worth more than a confident-sounding pipeline that never tells you it skipped something.