# Book publisher

> Book publisher is an open-source agent skill for files and documents. Turns manuscripts into print-ready PDFs, Kindle EPUBs and KDP cover files. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/pstuart/pstuart/tree/main/plugins/pstuart-publishing/skills/book-publisher
- **Repository:** https://github.com/pstuart/pstuart
- **GitHub stars:** 20
- **License:** MIT
- **Skill name:** book-publisher
- **Collection:** https://github.com/pstuart/pstuart
- **Categories:** [files and documents](https://ai-powered.com/categories/files-and-documents)
- **Listing updated:** 2026-12-04

## About

Book Publisher is a set of Python scripts and templates for turning a manuscript written in Markdown, Word or plain text into a trade paperback PDF and a Kindle EPUB. The workflow covers converting source files, compiling chapters, generating a table of contents in two rendering passes so page numbers are accurate, and building an index from real page numbers. Interior styling includes running headers, callout boxes, tables, checklists and flowchart helpers.

The skill also guides cover creation. It describes an interactive loop that produces AI-generated bitmap artwork through a local zgen binary, then composes vector text over that art for paperback wraps with spine calculation and Kindle covers. It includes guidance on Amazon KDP dimensions, bleed, and spine text rules, along with a validation checklist for PDF, cover and EPUB output.

Using it requires Python with packages such as fpdf2, pypdf and ebooklib, plus optional Pillow, python-docx and poppler for conversion and validation. Cover generation needs a local zgen install on the PATH.

## When your agent uses it

> Professional book publishing from Markdown, Word, or text to PDF/EPUB. Use when creating books, converting manuscripts to PDF, generating covers (Kindle and paperback with spine), building indexes with real page numbers, creating table of contents, or formatting chapters. Handles trade paperback (5.5x8.5), two-pass TOC generation, EPUB conversion, and Amazon KDP requirements.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs Python scripts](https://github.com/pstuart/pstuart/tree/HEAD/plugins/pstuart-publishing/skills/book-publisher)
- [No network calls found in its scripts](https://github.com/pstuart/pstuart/tree/HEAD/plugins/pstuart-publishing/skills/book-publisher)
- [Includes binary files](https://github.com/pstuart/pstuart/tree/HEAD/plugins/pstuart-publishing/skills/book-publisher)
- [License: MIT](https://github.com/pstuart/pstuart/tree/HEAD/plugins/pstuart-publishing/skills/book-publisher)

## Features

- **Manuscript Conversion:** Converts Word documents and plain text files into Markdown chapters that the build scripts can compile.
- **Trade Paperback PDF:** Renders a 5.5 by 8.5 inch interior with running headers, page numbers and styled sections.
- **Two-Pass Table of Contents:** Renders the book once to collect actual page numbers, then again so the contents page matches.
- **Automatic Index:** Extracts configured index terms from the PDF text and lists their page numbers alphabetically.
- **Kindle EPUB Output:** Builds an EPUB with navigation tables of contents and responsive stylesheet for Kindle devices.
- **Cover and Spine Tools:** Composes paperback wraps with spine width from page count and Kindle covers at 1600 by 2560 pixels.

## Good for

- Convert my Word manuscript into a print-ready PDF with a table of contents
- Generate a Kindle EPUB from my chapter Markdown files
- Build an index with page numbers for my nonfiction book
- Calculate the spine width and create a KDP paperback cover wrap
- Check my PDF layout for orphaned headings and overflowing boxes

## Install

### Claude Code

This skill ships in the `pstuart-publishing` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add pstuart/pstuart
/plugin install pstuart-publishing@pstuart
```

Or copy only this skill to `~/.claude/skills/book-publisher`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/book-publisher &&
cp -R "$tmp/plugins/pstuart-publishing/skills/book-publisher" ~/.claude/skills/book-publisher &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/book-publisher` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/book-publisher` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/book-publisher &&
cp -R "$tmp/plugins/pstuart-publishing/skills/book-publisher" ~/.agents/skills/book-publisher &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/book-publisher` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/book-publisher` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/book-publisher &&
cp -R "$tmp/plugins/pstuart-publishing/skills/book-publisher" ~/.cursor/skills/book-publisher &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/book-publisher` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/pstuart/pstuart.git --path plugins/pstuart-publishing/skills/book-publisher
```

Or copy the folder to `~/.gemini/skills/book-publisher` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/book-publisher`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/book-publisher &&
cp -R "$tmp/plugins/pstuart-publishing/skills/book-publisher" ~/.copilot/skills/book-publisher &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/book-publisher` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/pstuart/pstuart.git
```

Then copy `pstuart/plugins/pstuart-publishing/skills/book-publisher` into your agent's skills folder as `book-publisher`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need installed?

Python packages fpdf2 and pypdf for PDF generation, ebooklib for EPUB, and optionally Pillow, python-barcode, python-docx, poppler and pdf2image for covers, Word conversion and validation. Cover art also needs a local zgen binary on the PATH.

### How does Book publisher get accurate table of contents page numbers?

It renders the whole book once to collect the actual page numbers, then renders again with those references so the contents page matches the final layout.

### When should spine text be added to a paperback cover?

According to the skill, spine text is drawn only when the book reaches KDP's 100-page minimum for spine text. Spine width is calculated from page count and paper thickness.

### Does Book publisher publish books or add access restrictions by default?

No. The skill says outputs stay unrestricted unless the user explicitly asks for owner-password encryption, and publication is treated as a separate action.

### How do I install Book publisher in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/book-publisher to use it in all your projects, or to .claude/skills/book-publisher in one project. Or install the pstuart-publishing plugin, which includes it: /plugin marketplace add pstuart/pstuart, then /plugin install pstuart-publishing@pstuart.

### Does Book publisher run scripts?

Yes. It runs Python scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Book publisher?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Book publisher?

The closest alternatives to Book publisher are PDF, Ni poetry book, Convert PDF to md, PDF and Publish to pages.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [PDF](https://ai-powered.com/skills/pdf-anthropics): PDF is a free agent skill for files and documents.
- [Ni poetry book](https://ai-powered.com/skills/ni-poetry-book): Ni poetry book is an open-source agent skill for files and documents.
- [Convert PDF to md](https://ai-powered.com/skills/convert-pdf-to-md): Convert PDF to md is an open-source agent skill for files and documents.
- [PDF](https://ai-powered.com/skills/pdf-openai): PDF is a free agent skill for files and documents.
- [Publish to pages](https://ai-powered.com/skills/publish-to-pages): Publish to pages is an open-source agent skill for files and documents.
- [Convert excel to md](https://ai-powered.com/skills/convert-excel-to-md): Convert excel to md is an open-source agent skill for files and documents.
- [Convert word to md](https://ai-powered.com/skills/convert-word-to-md): Convert word to md is an open-source agent skill for files and documents.
- [Ni book downloader](https://ai-powered.com/skills/ni-book-downloader): Ni book downloader is an open-source agent skill for files and documents.

---
Source: https://ai-powered.com/skills/book-publisher
