Books For Bots banner
prime-radiant-inc prime-radiant-inc

Books For Bots

AI community

Description

Rust CLI that converts EPUBs into a single YAML-headed Markdown file with per-chapter byte and line offsets, giving LLM agents a navigation API for token-efficient reading.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

books-for-bots

Convert an EPUB into a single YAML-headed Markdown file optimized for token-efficient reading by LLM agents.

Why

EPUB is a great format for humans and a terrible format for agents.

A typical agent reading a book has to (a) unpack the zip, (b) parse the OPF manifest, (c) follow the spine, (d) parse each XHTML document, (e) chase cross-document references, (f) do all of that without exhausting its context window. Most don't even try; they paste a chapter at a time from clipboard.

`books-for-bots` flips that. Each book becomes one plain GFM Markdown file with a YAML frontmatter listing every chapter and its **absolute byte and line offsets**. An agent can:

Read book.md --offset 412 --limit 200

…and land directly on Chapter 1's heading, no parsing, no traversal. The frontmatter is the chapter-level navigation API.

What you get

output//.md
output//images/

The Markdown file opens with frontmatter that looks like this (see [`examples/alice/`](examples/alice/) for the full output):

---
title: "Alice's Adventures in Wonderland"
authors: [Lewis Carroll]
published: 2008-06-27
language: en
source_file: examples/alice/alice-pg11-images.epub
chapters:
  - title: CHAPTER I. Down the Rabbit-Hole
    line:         94
    byte:       2866
  - title: CHAPTER II. The Pool of Tears
    line:        158
    byte:      14524
  - title: CHAPTER III. A Caucus-Race and a Long Tale
    line:        216
    byte:      25801
  - title: CHAPTER IV. The Rabbit Sends in a Little Bill
    line:        312
    byte:      35010
  ...
---

## CHAPTER I. Down the Rabbit-Hole

Alice was beginning to get very tired of sitting by her sister...

Below the frontmatter is plain GFM: `## Chapter Heading`, `**bold**`, `*italic*`, `[link](href)`, `[^footnote]`, GFM pipe tables, fenced code blocks. No embedded HTML except where GFM requires it (table cell `
`).

Numeric offsets are leading-padded to a fixed 10-character