translate-book

translate-book

Whole-Book AI Translation

Description

< #Book Translation #AI Translation #Agent Skill #Claude Code #Codex #EPUB #PDF #Open Source

translate-book is an agent skill built for translating whole books. Install it into Codex, Claude Code or OpenClaw and a single sentence — translate this book into Chinese — runs the entire job. Rather than pushing a whole book through one conversation, it splits the text into chunks and hands them to parallel subagents, each starting from a clean context window, which removes the context overflow and truncated output that plague long single-session translations.

The pipeline runs like this: Calibre converts the PDF, DOCX or EPUB into Markdown, which is split into roughly six-thousand-character chunks with each chunk's SHA-256 recorded in a manifest; eight subagents translate in parallel per batch by default; the result is validated one-to-one against the source chunks before being merged and rebuilt through Pandoc and Calibre into HTML with a table of contents, DOCX, EPUB and PDF. An interrupted run resumes at chunk level, and editing the glossary re-translates only the affected chunks instead of the whole book. Seven target languages ship out of the box — Chinese, English, Japanese, Korean, French, German and Spanish — under an MIT licence. Calibre, Pandoc and Python 3 need to be installed locally first.

Features



Parallel subagents:Eight translators run concurrently per batch, each holding its own context window, which sidesteps single-session length limits while keeping requests inside API rate limits.

Chunking and hash validation:Each source chunk's SHA-256 goes into manifest.json and is checked one-to-one against its translation before merging, so stale or corrupt chunks never slip into the finished book; a source fingerprint also aborts the run if the input file was swapped rather than silently reusing old chunks.

Resumable runs:Progress is tracked per chunk in run_state.json, so an interrupted job picks up at the chunk it stopped on instead of restarting from page one.

Glossary consistency:Terminology stays uniform across the book, and changing a glossary entry re-translates only the chunks it touches, avoiding the same proper noun rendered two different ways.

Neighbour context:Every subagent gets short read-only excerpts from the adjacent chunks to resolve pronouns and recurring names, smoothing over the seams between chunks.

Multi-format in and out:PDF, DOCX and EPUB go in; merged Markdown, HTML with a floating table of contents, DOCX, EPUB and a print-ready PDF come out in one build, with an explicit EPUB cover if you want one.

One-command install:npx skills add deusyu/translate-book drops it into Codex or Claude Code, or clone it straight into the skills directory; Claude Code can also invoke it as a slash command.

Open source:The source code is hosted on GitHub, so developers can study the implementation, contribute, or adapt it to their own needs.