translate-book-parallel
translate-book-parallel — an installable skill for AI agents.
By reason-machines · 1,297 installs
npx skills add reason-machines/trending-skills --skill translate-book-parallel
Source repository · Upstream listing
Translate Book (Parallel Subagents)
Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
A Claude Code skill that translates entire books (PDF/DOCX/EPUB) into any language using parallel subagents. Each chunk gets an isolated context window — preventing truncation and context accumulation that plague single session translation.
Pipeline Overview
Prerequisites
Verify all tools are available:
Installation
Option A: npx (recommended)
Option B: ClawHub
Option C: Git clone
Usage in Claude Code
Once the skill is installed, use natural language inside Claude Code:
The skill orchestrates the full pipeline automatically.
Supported Languages
Code Language
zh Chinese
en English
ja Japanese
ko Korean
fr French
de German
es Spanish
Language codes are extensible — add new ones in the skill definition.
Running Pipeline Steps Manually
Step 1: Convert to Markdown Chunks
This produces inside {book name} temp/ :
chunk0001.md , chunk0002.md , ... (source chunks, ~6000 chars each)
manifest.json (SHA 256 hashes for validation)
Step 2: Translate (Parallel Subagents)
The skill handles this step — it launches 8 concurrent subagents per batch, each translating one chunk independently:
Resumable: Already translated chunks (valid output chunk .md files) are skipped on re run.
Step 3: Merge and Build All Formats
Before merging, validation checks:
Every source chunk has a matching output file (1:1)
Source chunk hashes match manifest.json (no stale outputs)
No output files are empty
Outputs produced:
File Description
output.md Merged translated Markdown
book.html Web version with floating TOC
book.docx Word document
book.epub E book format
book.pdf Print ready PDF
Project Structure
How Manifest Validation Works
If validation fails, the script auto deletes stale output.md and re merges from valid chunk outputs.
Real World Example: Translate a Technical Book
Resuming an Interrupted Translation
Changing Output Metadata After Translation
If you need to update the title, author, template, or image assets without re translating:
Do NOT delete chunk files — those are your translated content. Only delete final artifacts when changing metadata.
Troubleshooting
Problem Solution
Calibre ebook convert not found Install Calibre; ensure ebook convert is in $PATH
Manifest validation failed Source chunks changed — re run convert.py
Missing source chunk Source file deleted — re run convert.py to regenerate
Incomplete translation Re run the skill — resumes from last valid chunk
Changed title/template but output unchanged Delete output.md , book .html , book.docx , book.epub , book.pdf then re run merge and build.py
output.md exists but manifest invalid Script auto deletes stale output and re merges
PDF generation fails Verify Calibre has PDF output support; try ebook convert help
Empty output chunks Retry failed chunks; check API rate limits
Diagnosing Chunk Issues
Configuration Tips
Chunk size: ~6000 chars per chunk is the default. Smaller chunks = more parallelism but more API calls.
Concurrency: Default is 8 parallel subagents per batch. Adjust in SKILL.md if hitting rate limits.
Languages: Add new language codes to the skill triggers and translation prompt in SKILL.md .
Templates: Customize scripts/template.html and scripts/template ebook.html for different HTML/ebook styling.
Key Design Principles
1. Isolated context per chunk — each subagent starts fresh, preventing context overflow on long books
2. Hash based integrity — SHA 256 tracking catches stale or corrupt translated chunks before merging
3. Resumable at chunk granularity — never re translate what's already done
4. Format agnostic input — Calibre handles PDF/DOCX/EPUB normalization before the pipeline begins
5. Multiple output formats — single pipeline produces HTML, DOCX, EPUB, and PDF simultaneously