π KindlePub
An end-to-end Amazon KDP self-publishing pipeline, packaged as a portable Agent Skill.
Take a finished manuscript all the way onto Amazon β an epubcheck-clean Kindle EPUB, a cover
whose art you generate with Gemini Nano Banana and assemble in KDP Cover Creator (which
auto-sizes the spine β no custom PDFs), drafted KDP metadata, and a field-by-field walk through
KDPβs Details β Content β Pricing β Publish flow for the ebook, paperback, and hardcover.
Why
Shipping a book to KDP is a maze of format gotchas: an EPUB that silently fails epubcheck, a
cover rejected because the spine is off, garbled AI text smeared across the art. KindlePub encodes
the hard-won fixes so your agent gets it right the first time β and because itβs a standard
SKILL.md, it travels with you across Claude Code, Codex, Cursor, Gemini CLI, and the Claude
app instead of being trapped in one tool.
Build everything to the edge; the human enters credentials, operates native file pickers, and presses Publish. The skill never types your passwords.
What it does
| Phase | Output |
|---|---|
| 1 | Lock the manuscript, export a clean DOCX (no copy/paste loss) |
| 2 | Reflowable Kindle EPUB, epubcheck-clean (encodes 3 ebooklib traps that waste hours) |
| 3 | Cover β generate art with Gemini Nano Banana, assemble in KDP Cover Creator (it adds the title and auto-sizes the spine; reuse the front for the ebook) |
| 4 | Print β upload the manuscript DOCX; KDP paginates it and Cover Creator sizes the spine (no custom PDF) |
| 5 | Drafted KDP metadata (description, BISAC categories, keywords, AI-content answers, pricing) |
| 6 | Field-by-field KDP walkthrough (DRM, KDP Select, pre-order, the hardcover print-cost trap) |
| 7 | A saved publication record so the next format and next book go faster |
Install
Any coding agent (via the openskills loader):
git clone https://github.com/jessl2juice/kindlepub
npx openskills install ./kindlepub # installs into Claude Code, Codex, Cursor, Gemini CLIβ¦
Claude app / Cowork: download kindlepub.skill from
Releases and click Save skill.
Manual (any SKILL.md-aware tool): copy this folder to .claude/skills/kindlepub/.
Requirements
Python 3, plus pip deps for the EPUB build:
pip install mammoth ebooklib beautifulsoup4 lxml epubcheck
epubcheck also needs Java on your PATH. (The cover and spine are done in KDP Cover Creator β
no extra image/PDF libraries needed.)
Usage
Just talk to your agent β βI finished my manuscript, help me put it on Amazonβ β and the skill drives the pipeline, handing you each irreversible click. The two scripts build and validate the Kindle EPUB; the cover is generated in Nano Banana and assembled in KDP Cover Creator (in the browser).
python3 scripts/build_epub.py # -> book.epub (edit the CONFIG block first)
python3 scripts/validate_epub.py book.epub
# Cover: generate art with Nano Banana (see references/), then build it in KDP Cover Creator.
Whatβs inside
kindlepub/
βββ SKILL.md # the skill: when to trigger + the 7-phase procedure
βββ scripts/
β βββ build_epub.py # DOCX -> epubcheck-clean reflowable EPUB
β βββ validate_epub.py # epubcheck wrapper (the same check KDP runs)
βββ references/
βββ kdp-walkthrough.md # field-by-field KDP script + Cover Creator steps
βββ metadata-template.md # the metadata you fill in
βββ nanobanana-cover-prompts.md # cover-art prompt recipes + the no-text rule
Why itβs better than winging it
- The EPUB actually validates. The build script encodes three
ebooklibtraps (the encoding-declaration empty-body bug,add_linkCSS attachment, and theset_cover/ OPF-096 page-list crash) that silently produce broken-but-βvalidβ-looking books. - The cover looks human. AI models always sneak garbled text onto pennants, clothing, spines, and screens β so the Nano Banana prompts forbid text on those surfaces and KDP Cover Creator lays the real title in afterward.
- The spine fits with zero math. KDP paginates your manuscript and Cover Creator auto-sizes the spine to that page count β no guessed spine, no custom cover PDF, no rejected upload.
Contributing
PRs welcome β see CONTRIBUTING.md. The bar: keep it generic and secret-free,
keep the SKILL.md frontmatter valid, and preserve the hard-won notes (they exist because
something broke once).
License
MIT β use it, fork it, ship your book.
Acknowledgements
Built on the open Agent Skills standard (SKILL.md), originated by
Anthropic and now read by ~40 agent tools. Part of the Open Skills idea: the way you work
should be yours and portable, not rented back to you by whichever AI app you happened to use.