howells/fiction/build
Claude Code and agent skill by howells/fiction
- community
Checking that the SKILL.md file is still in the repository.
Build an EPUB from your fiction project. Compiles chapters, metadata, and optionally a cover image.
Install
npx vskill@latest install howells/fiction/buildSKILL.md
Build an EPUB file from the current fiction project.
Build Context
- Chapter count: !
ls chapters/*.md 2>/dev/null | wc -l | tr -d ' ' - Has cover: !
ls covers/cover.* 2>/dev/null | head -1 || echo "no cover found"
What This Does
- Reads project metadata from README.md
- Compiles all chapters from
chapters/in order - Applies styling from
epub.css(if present) - Includes cover image from
covers/(if specified) - Sets a stable EPUB identifier (preserves highlights across builds)
- Outputs to
builds/directory
Usage
If arguments provided: $ARGUMENTS
Build Modes
Archive Mode (default)
Outputs: builds/YYYY-MM-DD/project-name-YYYY-MM-DD.epub
- Each build is date-stamped
- Preserves history of versions
- Good for milestones and backups
Sync Mode (--sync)
Outputs: builds/project-name.epub
- Same filename every time
- Uses stable EPUB identifier
- Preserves highlights and reading position in Apple Books
- Ideal for reading on devices while writing
What to Do
1. Find Project Root
Look for README.md, chapters/ directory. Support both flat and part-based structures:
Flat structure:
Part-based structure:
2. Gather Metadata
Extract from README.md:
- Title — Project name (H1 heading)
- Author — From frontmatter or infer from git config
- Description — From "The Story" section or premise
3. Generate Identifier
Create a stable identifier for the EPUB:
This identifier is what Apple Books uses to recognize "same book, updated" — preserving highlights and reading position between builds.
4. Collect Chapters
Read all markdown files from chapters/ in order:
- Sort by filename (01-chapter.md, 02-chapter.md, etc.)
- For part-based projects, read parts in order (part-1, part-2, etc.)
- Convert markdown to HTML
- Preserve chapter breaks
5. Check for Cover
Look in covers/ for:
cover.pngorcover.jpg(default)- Or use
--coverargument to specify
6. Check for Styles
Look for epub.css in project root. If present, include in epub.
7. Build EPUB
Create a metadata file with the stable identifier:
Use pandoc to compile:
Key options:
--split-level=1— Only break chapters on H1 headings (avoids empty pages)--toc— Include table of contents--toc-depth=1— Only show chapter titles in TOC
8. Create Metadata File (Archive Mode)
Write builds/YYYY-MM-DD/metadata.yaml:
9. Report Build
Output build summary:
Build Directory Structure
Archive Mode
Sync Mode
Apple Books Sync
For highlights to persist between builds:
- Same identifier — The
identifierfield in metadata must stay constant - Same filename — Use
--syncmode for consistent naming - iCloud sync enabled — Both Mac and iPhone need Books enabled in iCloud settings
How it works: Apple Books uses the EPUB's dc:identifier (stored in the OPF file) to recognize books. When you import a new build with the same identifier, it updates the existing book rather than adding a duplicate.
Caveat: Highlights are tied to text position. Major edits (adding/removing paragraphs) may shift or orphan highlights in that area. Minor edits (typos, word changes) are fine.
Covers Directory
Store all cover iterations. The build uses cover.png by default.
Dependencies
Requires pandoc for epub generation:
Tips
- Use
--syncfor daily reading while writing - Use archive mode (default) for milestone builds
- Test epub in Apple Books, Kindle Previewer, or Calibre
- The
covers/directory is for iterations;cover.pngis what gets built
After Building
- Open in Apple Books to test formatting
- Check chapter breaks and styling
- Verify cover displays correctly
- For sync mode, delete old version in Books first if highlights don't update
Troubleshooting
Highlights Not Persisting
- Ensure you're using
--syncmode - Check that the identifier hasn't changed
- Try deleting the old book from Apple Books, then importing fresh
- Verify iCloud sync is enabled for Books on both devices
Empty Pages
If you see blank pages between chapters:
- Check for
page-break-after: alwaysin epub.css — remove or change toauto - Look for double line breaks or
\newpagein markdown files - Ensure
--split-level=1is set (breaks only on H1) - Check chapter files don't end with multiple blank lines
Recommended epub.css
Minimal CSS that avoids empty page issues:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/build/SKILL.md
Popularity
- Repository stars
- 4
- Repository forks
- 3
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 21 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/howells/fiction/build)