$npx -y skills add epicsagas/Velith --skill book-publishPhase 5: Publishing. Convert to EPUB/PDF/MOBI/TXT/Markdown, cover design, metadata, title candidates, KDP checklist, marketing plan.
| 1 | # Phase 5: Publishing |
| 2 | |
| 3 | **Formats** (requires `pandoc`, optional `calibre` for MOBI): |
| 4 | - **EPUB**: `pandoc drafts/ch*.md -o publish/book.epub --toc --toc-depth=2 --metadata-file=publish/metadata.yaml --css=publish/style.css` |
| 5 | - **PDF**: `pandoc` with 6x9in geometry, mirror margins, CJK font support |
| 6 | - **MOBI**: `ebook-convert book.epub book.mobi` (optional, Kindle supports EPUB) |
| 7 | - **TXT**: `pandoc --to plain --wrap=none` |
| 8 | - **MD**: `pandoc --to markdown --standalone` |
| 9 | |
| 10 | **Metadata**: `publish/metadata.yaml` (title, subtitle, author, lang, keywords, description). |
| 11 | |
| 12 | **Titles**: 22+ candidates across 5 categories (descriptive, emotional, question, metaphor, provocative). |
| 13 | |
| 14 | **Agents**: `cover-designer` → concepts + image prompts. `illustrator` → interior illustration plan (see `/book-illustrate`). `marketing-expert` → personas, channels, 12-week calendar, launch checklist. |
| 15 | |
| 16 | Output: `publish/` directory with all formats + metadata + title-candidates.md + cover/concepts.md + illustrations/plan.md + marketing-plan.md. |
| 17 | |
| 18 | Gate: EPUB + PDF generated, metadata complete, 22+ titles, cover concepts, marketing plan. |
| 19 | |
| 20 | ## Pre-processing |
| 21 | |
| 22 | **Poetry line breaks**: If genre is `poetry` or `poetry-essay`, before running pandoc, prepend two trailing spaces (` `) to each non-empty line within poem sections (content under `##` headings, before `###` subheadings). This forces pandoc to preserve line breaks instead of merging into paragraphs. |
| 23 | |
| 24 | **Cover image guard**: Before running pandoc, check if the cover image file referenced in `metadata.yaml` (typically `cover.png`) actually exists. If missing, temporarily remove the `cover-image` field from metadata, run pandoc, then restore the field. This prevents pandoc from failing when cover hasn't been generated yet. |
| 25 | |
| 26 | |
| 27 | ## Post-Completion |
| 28 | |
| 29 | Update the project dashboard status: |
| 30 | |
| 31 | ```bash |
| 32 | node {PLUGIN_ROOT}/velith.mjs scan [project-dir] --plugin-root={PLUGIN_ROOT} |
| 33 | ``` |