Prompt file imported from ketankshukla/agentic-development (
.windsurf/workflows/generate-book-old.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.
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 (don't cache earlier checks)
- Especially in Phase 5: Complete MP3 → THEN check covers → THEN EPUB/PDF/M4B
Why: Parallel tasks cache outdated state. If covers aren't found during MP3 generation, but user adds them later, parallel execution misses them.
CRITICAL: No Illegal Characters in Filenames
NEVER use these characters in filenames: : / \ * ? " < > |
When generating output files (EPUB, PDF, DOCX, MP3,M4B):
- Replace colons with dashes:
Red Horizon: First Strike→Red Horizon - First Strike - Always sanitize the
--titleargument before passing to scripts
Prerequisites
- Book concept or pen name concept selected
REQUIRED FILES CHECKLIST
Every book MUST have ALL of these files. Do NOT skip any:
01-planning/ (2 files)
01-book-brief.md— High-level concept02-book-plan.md— Detailed story architecture, characters, plot
RULE: All books MUST have exactly 12 chapters. No exceptions.
02-manuscript/ (22 files)
- Files 00-21 (opening credits through retail sample)
03-image-generation/
image-prompts/book-covers/01-[prompt-name].mdthrough05-[prompt-name].mdimage-prompts/audiobook-covers/01-[prompt-name].mdthrough05-[prompt-name].md
04-book-metadata/ (4+ files)
book-summary.mddescription.md,categories.md,keywords.mdchapter-summaries/chapter-01-summary.mdthroughchapter-12-summary.md
05-books/ (generated)
- DOCX, PDF, PDF (KDP), EPUB, audiobooks
Workflow Steps
Phase 1: Planning
- Create 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.mdwith project checklist
Phase 2: Manuscript Generation
- Generate all manuscript files in
02-manuscript/:00-opening-credits.md(audiobook only, plain text)01-copyright.md02-dedication.md03-epigraph.md04-prologue.md05-chapter-01-[title].mdthrough16-chapter-12-[title].md17-epilogue.md18-acknowledgments.md19-a-favour-please.md20-closing-credits.md(audiobook only, plain text)21-retail-sample.md(audiobook only, plain text)
Phase 3: Image Generation
- Generate 5 individual prompt files in
03-image-generation/image-prompts/book-covers/:- Format:
01-[prompt-name].mdthrough05-[prompt-name].md - Each starts with: "A stunning 9:16 portrait book cover..."
- Each file contains ONLY the prompt text (no headers) for easy copy-paste
- Format:
- Generate 5 individual prompt files in
03-image-generation/image-prompts/audiobook-covers/:- Same filenames as book-covers
- Each starts with: "A stunning 2400x2400 px audiobook cover..."
- USER ACTION: Generate images and place in
03-image-generation/covers/:ebook-cover.pngaudiobook-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: Book Generation (FINAL STEP - covers must be ready)
// turbo 14. Generate MP3 audiobook (FIRST - longest running):
python "e:\agentic-development\common-tasks\audiobook-generation\generate-audiobooks.py" --book-path "[book-path]" --author "[Author]" --title "[Title]"
// turbo 15. Generate Word document:
powershell -ExecutionPolicy Bypass -File "e:\agentic-development\common-tasks\docx-generation\generate-docx.ps1" -BookPath "[book-path]" -Author "[Author]" -Title "[Title]"
// turbo 16. Upscale audiobook cover (REQUIRED before M4B):
python "e:\agentic-development\common-tasks\audiobook-generation\upscale-audiobook-cover.py" "[book-path]\03-image-generation\covers\audiobook-cover.png"
// turbo 17. Generate EPUB:
python "e:\agentic-development\common-tasks\ebook-generation\generate-ebook.py" --book-path "[book-path]" --author "[Author]" --title "[Title]"
// turbo 18. Generate PDF with cover:
python "e:\agentic-development\common-tasks\pdf-generation\generate-pdf.py" --book-path "[book-path]" --author "[Author]" --title "[Title]"
// turbo 19. Generate PDF for KDP (no cover):
python "e:\agentic-development\common-tasks\pdf-generation\generate-pdf-without-image.py" --book-path "[book-path]" --author "[Author]" --title "[Title]"
// turbo 20. Generate M4B audiobook (LAST - requires MP3s + upscaled cover):
python "e:\agentic-development\common-tasks\audiobook-generation\create-m4b.py" --book-path "[book-path]" --author "[Author]" --title "[Title]"
Phase 6: Completion
- Update
docs/BOOK-COMPLETION-TRACKER.mdto "✅ Complete"
// turbo 22. Commit and push to GitHub:
git add -A
git commit -m "Complete book generation: [Author] - [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].epubmp3-audiobook/(MP3 files)m4b-audiobook/[Author] - [Title].m4b
CRITICAL RULES
Books are to be generated in the following order:
1st MP3 audiobook generate-audiobooks.py 2nd DOCX generate-docx.ps1 3rd Upscale cover upscale-audiobook-cover.py 4th EPUB generate-ebook.py 5th PDF (with cover) generate-pdf.py 6th PDF (KDP) generate-pdf-without-image.py 7th M4B audiobook create-m4b.py
- DO NOT STOP between phases - complete the entire workflow
- DO NOT ASK for confirmation to continue
- PUSH TO GITHUB ONLY at the very end after ALL assets are generated
- All generated files go to
05-books/folder - Covers are in
03-image-generation/covers/ - Use scripts from
common-tasks/folder
