Prompt file imported from ketankshukla/agentic-development (
.windsurf/workflows/generate-book.md). Copyright stays with the author.
Book Generation Workflow
This workflow generates a complete book from concept through all output formats. Do not pause or ask for confirmation. Complete all steps in one uninterrupted flow unless a required dependency is genuinely missing.
Command Format
The incoming command format is:
Generate a book by [PEN NAME] from concept [CONCEPT SLUG] in mode: [MODE]
Valid mode values:
- generate_new_book
- regenerate_existing_book
Interpret the command exactly.
Mode Rules
generate_new_book
- Treat the concept as a brand-new book project.
- Determine all required project attributes from the pen name, concept slug, and reference documents.
- Generate the brief, then the plan, then all downstream assets.
- Write prose in a way that is natively friendly to Edge TTS audiobook narration.
regenerate_existing_book
- Treat the concept as an existing book identity that must be regenerated, not reinvented.
- Preserve the same core concept, same genre promise, same protagonist role, same emotional intent, and same overall commercial reading experience.
- Regenerate the brief, then regenerate the plan, then regenerate the manuscript and all downstream assets.
- Improve prose flow for Edge TTS without turning the book into a different story.
CRITICAL: Sequential Execution Only
Execute all steps sequentially. Never run multiple tasks in parallel.
- Complete Step N fully.
- Verify it succeeded.
- Then start Step N+1.
- Re-check dependencies at each step.
Why: Parallel tasks can cache outdated state and cause incomplete generation.
CRITICAL: No Illegal Characters in Filenames
Never use these characters in filenames:
: / \ * ? " < > |
When generating output files:
- Replace colons with dashes.
- Remove or replace any other illegal characters.
- Always sanitize the title before passing it to scripts.
REQUIRED FILES CHECKLIST
Every book must have all of these files.
01-planning/
- 01-book-brief.md
- 02-book-plan.md
Rule: All books must have exactly 12 chapters.
02-manuscript/
- Files 00-21 inclusive
03-image-generation/
- image-prompts/book-covers/01-[prompt-name].md through 05-[prompt-name].md
- image-prompts/audiobook-covers/01-[prompt-name].md through 05-[prompt-name].md
04-book-metadata/
- book-summary.md
- description.md
- categories.md
- keywords.md
- chapter-summaries/chapter-01-summary.md through chapter-12-summary.md
05-books/
- DOCX
- PDF (KDP)
- EPUB
- MP3 audiobook
- M4B audiobook
Workflow Steps
Phase 1: Planning
- Parse the command and determine mode, pen name, concept slug, and resolved project identity.
- Create the book folder structure under pen-names/[author]/books/[book-name]/
- Generate 01-planning/01-book-brief.md
- Generate 01-planning/02-book-plan.md
- Create README.md with project checklist
Phase 2: Manuscript Generation
- Generate all manuscript files in 02-manuscript/:
- 00-opening-credits.md
- 01-copyright.md
- 02-dedication.md
- 03-epigraph.md
- 04-prologue.md
- 05-chapter-01-[title].md through 16-chapter-12-[title].md
- 17-epilogue.md
- 18-acknowledgments.md
- 19-a-favour-please.md
- 20-closing-credits.md
- 21-retail-sample.md
Phase 3: Image Generation
Before generating any cover prompt files, read these canonical template references:
- e:\agentic-development\docs\cover-prompt-templates\ebook-cover-template.md
- e:\agentic-development\docs\cover-prompt-templates\audiobook-cover-template.md
Generate ebook cover prompt files by structurally following the ebook cover template. Generate audiobook cover prompt files by structurally following the audiobook cover template.
For all cover prompt generation:
- Preserve the same section order as the template.
- Preserve the same level of specificity.
- Preserve the same composition discipline.
- Preserve the same typography instruction style.
- Preserve the same rendering and quality constraints.
- Change only the book-specific content.
- Do not simplify.
- Do not shorten.
- Do not drift into a generic prompt-writing style.
- Generate 5 individual prompt files in 03-image-generation/image-prompts/book-covers/
- Generate 5 individual prompt files in 03-image-generation/image-prompts/audiobook-covers/
- User generates images and places them in 03-image-generation/covers/:
- ebook-cover.png
- audiobook-cover.png
Phase 4: Book Metadata
- Generate 04-book-metadata/book-summary.md
- Generate 04-book-metadata/description.md
- Generate 04-book-metadata/categories.md
- Generate 04-book-metadata/keywords.md
- Generate 12 chapter summaries in 04-book-metadata/chapter-summaries/
Phase 5: Final Book Generation
Important: Follow this exact order.
- Generate MP3 audiobook first (use voice from e:\agentic-development\docs\audiobook-generation-voices.txt):
python "e:\agentic-development\common-tasks\audiobook-generation\generate-audiobooks.py" --book-path "[book-path]" --voice "[Voice]"
Voice assignments:
- Kael Varen: en-US-ChristopherNeural
- Sera Nightingale: en-US-AvaNeural
- Cole Harker: en-US-GuyNeural
- Vera Sinclair: en-US-JennyNeural
- Silas Crow: en-US-EricNeural
- Pippa Hartwell: en-GB-SoniaNeural
- Jett Holloway: en-US-DavisNeural
- Nova Sinclair: en-US-AriaNeural
- Eleanor Vane: en-GB-LibbyNeural
- Finn Ryder: en-US-AndrewNeural
- Ketan Shukla: en-US-GuyNeural
- Generate DOCX:
powershell -ExecutionPolicy Bypass -File "e:\agentic-development\common-tasks\docx-generation\generate-docx.ps1" -BookPath "[book-path]" -Author "[Author]" -Title "[Sanitized Title]"
- Generate EPUB:
python "e:\agentic-development\common-tasks\ebook-generation\generate-ebook.py" --book-path "[book-path]" --author "[Author]" --title "[Sanitized Title]"
- Generate PDF with cover:
python "e:\agentic-development\common-tasks\pdf-generation\generate-pdf.py" --book-path "[book-path]" --author "[Author]" --title "[Sanitized Title]"
- Generate PDF for KDP without cover:
python "e:\agentic-development\common-tasks\pdf-generation\generate-pdf-without-image.py" --book-path "[book-path]" --author "[Author]" --title "[Sanitized Title]"
- Upscale audiobook cover to 2400x2400 (ChatGPT outputs 1024x1024):
python "e:\agentic-development\common-tasks\audiobook-generation\upscale-audiobook-cover.py" "[book-path]\03-image-generation\covers\audiobook-cover.png"
- Generate M4B audiobook last:
python "e:\agentic-development\common-tasks\audiobook-generation\create-m4b.py" --book-path "[book-path]" --author "[Author]" --title "[Sanitized Title]"
Phase 6: Completion
- Update docs/BOOK-COMPLETION-TRACKER.md to indicate complete.
- Commit and push to GitHub only after every required asset exists.
git add -A
git commit -m "Complete book generation: [Author] - [Sanitized Title]"
git push
Output Files Location
All generated documents go to 05-books/:
- [Author] - [Title].docx
- [Author] - [Title].pdf
- [Author] - [Title] (KDP).pdf
- [Author] - [Title].epub
- mp3-audiobook/
- m4b-audiobook/[Author] - [Title].m4b
CRITICAL RULES
- Do not stop between phases.
- Do not ask for confirmation to continue.
- Push to GitHub only at the very end.
- All generated files go to 05-books/.
- Covers are in 03-image-generation/covers/.
- Use scripts from common-tasks/.
- The book plan is the sole source for downstream content once it is created.
- In both modes, prose must be suitable for Edge TTS audiobook narration.
- In regenerate_existing_book mode, preserve the existing book identity while improving prose flow.
- In Phase 3, cover prompts must structurally follow the canonical template reference files.
