The build script failed for the ninth time that afternoon, and the problem had nothing to do with my code. It was a 280 PPI image trying to pass as print-ready.
That single bug says a lot about what building The AI Cookbook actually involved: a small, repeatable production pipeline, built first, with twenty-six recipes written to run through it.
Why code instead of a word processor
The book is seventy-eight pages, twenty-six recipes, six chapters, each one following the same structure: an intro, a tools list, numbered prompts, an image placeholder. Doing that by hand in Word across seventy-eight pages means seventy-eight chances for a formatting inconsistency to slip past unnoticed until print.
I built the manuscript in Node.js instead, using the docx library to generate the Word file from structured content. Every recipe lives as a JavaScript object: title, tools, intro, prompts, image reference. A build script assembles them into the final document. Fix a formatting rule once, and it holds everywhere, not just in the one paragraph someone happened to catch.
One real bug from that process: standalone empty paragraphs inserted as page breaks were rendering as square glyphs on Word mobile. The fix was moving the break onto the pageBreakBefore property of the next heading instead. Small change, and it only surfaced because someone actually opened the file on a phone.
The image pipeline
Every illustration started in Gemini, then went through a manual check for watermarks and resolution before it got anywhere near the manuscript. Four images came back under 300 PPI, the print minimum, and needed a second pass before they qualified.
Getting each image to the same portrait ratio without cropping the part that mattered took a small Python script using PIL, padding each image with a warm wood-tone background matching the book's kitchen aesthetic, rather than stretching or cropping to force the fit.
Video, almost as an afterthought
The promotional side needed a short Instagram Reel and a YouTube Shorts version, both built with ffmpeg. Ken Burns style zoom on each still image, crossfade transitions between them, rendered straight from the command line.
Why it mattered
Twenty-six recipes staying genuinely consistent across seventy-eight pages needed automation. Hand-editing that many repeated structures invites the kind of mistake nobody catches until print.
If you want the actual prompt templates, all twenty-six of them organized by the kind of problem they solve, the book's up on Gumroad: https://merakislove.gumroad.com/l/cookbook
Top comments (0)