Digital Product Creation Automation: How I created a 55-maze activity book for kids in minutes using Antigravity CLI and Gemini
![imagen[1]-Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
I just published a children’s activity book on Amazon. It features 55 mazes, 97 individual illustrations, a complete solutions section, and a wraparound paperback cover. Es 72 pages long, print ready and KDP approved.
I didn’t draw a single maze. I don’t have Illustrator, InDesign, or Canva open. The entire book is generated by a Node.js script, and the script is written by a group of AI agents running in the Node.js script CLI antigravedad de Google (agy) con Géminiswhile I was playing director: establecer la intención, revisar la salida, make the calls the agents can’t make, y dale a publicar.
Regenerating the entire book from scratch takes about 3 seconds of machine time. To change the difficulty of each maze within it, two integers must be edited. The last part still feels like a cheat code and I’ll show it to you below.
This is the honest breakdown: the workflow, the algorithm, the print math no one warns you about, and the parts the agents got wrong.
![imagen[2]-Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
la tripulación: who did what?
Digital products like puzzle books historically required hours of manual design work. The insight that changes everything: A labyrinth book is not a design problem. It’s a code problem to wear a design costume. Once you see it like that, you can throw agents at it.
I put together a small crew in Antigravity instead of letting one model do everything:
![imagen[3]-Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![imagen[4]-Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
- The parent coordinator met the scope and restrictions: ages 5-7, US Letter, KDP compliant, cute but printable.
- El Subagent for children’s book authors has adopted the technology: the Maze algorithm, 97 inline SVG illustrations, the CSS print layout and the Puppeteer PDF scripts.
- El Subagent for blog author Read the finished codebase and draft the technical statement from which you read a descendant.
Separation is important. The author-agent never switched to the context of prose, and the author-agent never hallucinated code that he had not read. I learned the same lesson when sending my Angular book update with a team of agents: specialists with limited tasks beat a generalist with a big prompt.
The stack the team chose is deliberately boring: vanilla Node.js for logic, inline SVG for each image, CSS Paged Media for layout, and Puppeteer for printing HTML to PDF. No design tools, no bundlers, no image files.
Historia del héroe 1: perfect labyrinths from about 30 lines of DFS
A maze for a 5 year old has one non-negotiable requirement: it must be a maze perfect labyrinth. Exactly one solution, no loops, no unreachable pockets. A child who finds two ways to cheese or none at all closes the book.
The agent reached for it Depth-first search with recursive backtracking. Treat the grid as cells with four walls each, go to random, unvisited neighbors knocking down walls as you go, and back out of dead ends. The result is a spanning tree, and a tree guarantees exactly one path between any two points. Perfection through design, not through testing.
What I really admire is that the solution doesn’t cost anything. The DFS stack at the exact moment the walk first reaches the exit cell Is the solution. Clone it and move on. No A*, no second round:
while (stack.length > 0) {
const current = stack[stack.length - 1];
// The stack IS the solution the moment we first touch the exit
si (current.c === cols - 1 && current.r === rows - 1 && !solutionPath) {
solutionPath = stack.map(cell => ({ c: cell.c, r: cell.r }));
}
const neighbors = getUnvisitedNeighbors(current, grid, cols, rows);
si (neighbors.length > 0) {
const next = neighbors[Math.floor(Math.random() * neighbors.length)];
removeWalls(current, next);
next.visited = true;
stack.push(next);
} else {
stack.pop();
}
}
Each maze is given a theme (help the mouse find the cheese, the bee find the flower) consisting of 97 hand-parameterized SVG symbols saved as template strings in the same file. Because the symbols are vectors, the print resolution is unlimited and the 72-page PDF stays close to 1MB.
Here is Labyrinth 1 as it appears in the book and its automatically generated solution in the 4-per-page solution grid:
![imagen[5]-Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![imagen[6]-Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
Hero’s Story 2: The difficulty level is two integers
This is my favorite feature of the entire system and the reason I will never create a book like this by hand.
The entire difficulty of the book lies in this line:
const maze = generateMaze(12, 12); Everything else is derivative. Cell size, wall coordinates, symbol placement, arrow spacing, solution overlay: everything is calculated from columns and rows. Change the two integers and the entire 72-page book will be regenerated at the new difficulty level in seconds. Same characters, same layout, same KDP compliance.
![imagen[7]-Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
This is not a hypothesis. The project’s Git history is, quite literally, a difficulty tuning session:
- Baseline generated around 10×10.
- Initiated 14×14that looked great on screen and looked far too dense for this age group on a printed US letter page.
- Fixed 12×12 as a sweet spot for 5-7 year olds.
Each of these iterations was a one-line change plus NPM run build. In a manual design tool, retuning the difficulty of 55 hand-drawn mazes is a week of soul-destroying rework. Here it is a code review comment.
The obvious next step and roadmap for this small publishing operation: The same repo can output «Cute Mazes for Kids: Ages 4-5» at 8×8 y un «Challenge Edition» at 16×16 by changing these integers and the cover. A product line from a for loop.
la lección: When a product is generated, difficulty, trim size, page count, and even the entire SKU become parameters. That’s the real advantage of programmatic products, not the speed of the first build.
Historia del héroe 3: The money is in the boring printing mathematics
Creating cute mazes is 20% of the fun. What really determines whether Amazon accepts your files and whether you make money per copy is the lackluster printing technology. Aquí, too, an agent with clear guidelines shines, because none of it is creative. It’s all rules.
The interior. KDP wants an exact trim size and secure margins. The agent solved it natively in CSS Paged Media, without any conversion tools:
@page { tamaño: 8.5in 11in; margin: 0; }
.page {
width: 8.5en;
height: 11en;
padding: 0.6en; /* exceeds KDP's 0.5in no-bleed minimum */
page-break-after: always;
print-color-adjust: exact; /* keep the colors in print */
}
Puppeteer then loads book.html and prints it as a PDF with printBackground: true in the exact 8.5 incógnita 11 inch format. Headless Chrome is the layout engine. So what you see in the browser is byte by byte what KDP is receiving.
The page counting game. KDP has a rule that changes the economics of short color books: A minimum of 72 pages is required for standard color printing. Below that, you pay premium color prices that eat into the margins of a vibrant children’s book. So the team expanded the book from 50 a 55 mazes and packed 4 solutions per page into a CSS grid: title page + 55 maze pages + solution title + 14 solution pages = exactly the 72 page threshold.
With 72 pages in standard color, this book is printable $3.89 a copy. Listed under $9.99 with KDP’s 60% royalty, so ($9.99 incógnita 0.6) – $3.89 = $2.10 per copy sold. If you go over the 72-page limit, that margin will be wiped out by the Premium Color price. A CSS grid decision decided unit economics.
The cover. A KDP paperback cover consists of a single flat double page: back cover + spine + front cover, with bleed. Spine width is a function of your page count (72 pages x 0.002252 inches per page = 0.1621 inches), so the entire canvas is a wonderfully strange 17.4121 inches x 11.25 inches. The agent calculated the dimensions, placed the three panels in a flexbox, reserved the barcode box with KDP stamps on the back, and Puppeteer printed the second PDF:
![imagen[8]-Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
The cover colors were chosen for the thumbnail war, not the shelf: sunny yellow (#ffeb3b) with deep purple titles stands out in Amazon search results at 60 pixels wide, and the contrast ratio (approximately 12:1) remains readable at any size.
What the agents did wrong
Agent Workflows is a beautiful demo. Shipping through one is messier, and if you pretend otherwise, you’ll get burned. The errors I encountered:
- KDP silently hates fancy CSS. The first cover used box shadows and semi-transparent layers. The puppeteer portrayed them; KDP’s previewer choked up. The solution was a human decision to reduce the design to solid colors. An agent will not make this restriction voluntarily because it is not written anywhere appropriately.
- The listing differs from the product. For a time, the Amazon listing advertised «50 fun and challenging maze puzzles» instead of a book of 55 mazes, as the book grew after the copy of the listing was created. No agent heard “the listing must match the interior,” so no one reported it. I discovered it during a manual check and corrected the listing.
- Physical feedback has no API. The 14×14 version looked good on screen, but wrong on paper at actual size. Judging what a 5 year old can actually detect is a step of expression and looking, and that loop remains human.
- Taste calls stayed with me. Cover palette, illustration scale, whether the rabbit can be read as a rabbit in thumbnail size. The agents suggested I dispose of it.
None of this speaks against the workflow. The same rule applies as with every agent project I’ve shipped: The agent draft, you own the ships.
The framework if you want to create one
- Redesign the product as code. When the output is repetitive but varied (mazes, diaries, planners, workbooks), a generator is superior to a design tool. Parameters are better than rework.
- Divide the crew according to concerns. An agent owns the generation logic, one owns the description, a coordinator owns the constraints. Small tasks, clear instructions.
- Encode platform rules as constraints, not vibrations. Bleed size, margins, minimum pages, spine formulas: Enter the actual numbers in the prompt and CSS. Agents are error-free here because it involves arithmetic.
- Keep the irreplaceable human ribbons. Print a page at its original size. Check the listing by product. Publish yourself.
The finished book is live: Cute Mazes for Kids: 55 Fun and Challenging Maze Puzzles (Ages 5-7) on Amazon.
And if you want to see the longer story about managing a whole group of AI agents in a much larger book, you can find it here: I shipped an Angular v22 book update with a group of AI agents – here’s the system.
I create and publish these projects publicly – books, agents and the systems behind them. Keep following us incógnita o YouTube if you want the next breakdown as soon as it happens.
![]()
Automatización de la creación de productos digitales: How I Built a 55-Maze Kids’ Activity Book in Minutes Using… was originally published in Google Developer Experts on Medium, donde las personas continúan la conversación resaltando y respondiendo a esta historia.
