Skip to content
Back to skills

Translate Book

ASecurity

Translate a book or long document (epub, docx, pdf, markdown) to another language using the agent's built-in intelligence. Interactive — asks user for file, language, and style.

  • 225 stars
  • 0 votes
  • 2 copies
  • 16 views
  • Added September 4, 2026
ai-agentspythonbashgitapi

Works with

  • claude code
  • cli
  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill translate-book --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Translate Book?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Translate Book
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-translate-book/badge)](https://www.skillsdirectory.com/skills/neversight-translate-book)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: translate-book
description: Translate a book or long document (epub, docx, pdf, markdown) to another language using the agent's built-in intelligence. Interactive — asks user for file, language, and style.
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
---

# Translate Book

Use the agent's built-in intelligence (like Claude Code, OpenAI Codex, Gemini CLI, GitHub Copilot) to translate an entire book or long document. No external translation API — you ARE the translator. Supports epub, docx, pdf (text-based), and markdown.

## Interaction Language

Detect the user's language from their message and use it as the primary TUI response language throughout the entire workflow. For example, if the user writes in Chinese, all prompts, status updates, and results should be in Chinese.

## Interactive Setup

Ask the user 3 questions before starting (glob for supported files in cwd to offer choices):

1. Which file? (scan for `*.epub`, `*.docx`, `*.pdf`, `*.md`)
2. Target language?
3. Translation style? (e.g. 信达雅、口语化、学术、直译、儿童读物…)

## Workflow

### 1. Unpack
Most book formats are ZIP archives internally (epub, docx). Use `uv` + Python `zipfile` to extract to `work/`. For markdown, read directly. For PDF, extract text via PyMuPDF (warn and stop if scanned/image-only).

### 2. Translate content — only text, preserve everything else
Analyze structure, split content files into **~6 balanced batches**, launch **parallel background agents**.

Each agent only translates human-readable text. Everything else stays untouched:

| Translate | Preserve as-is |
|-----------|---------------|
| Paragraphs, headings, TOC entries | Markup structure (HTML, XML, markdown syntax) |
| Chapter titles, section names | Tags, attributes, CSS classes, IDs, links |
| Body text, dialogue, quotes | Images (`*.jpg`, `*.png`, `*.svg`, ...) |
| Metadata: book title, description | Fonts (`*.ttf`, `*.otf`, `*.woff`, ...) |
| | Stylesheets (`*.css`, `styles.xml`, ...) |
| | Config files (`mimetype`, `container.xml`, `[Content_Types].xml`, `_rels/*`, ...) |
| | Footnote citations, URLs, ISBN, copyright notices |

Format-specific notes:
- **EPUB**: content is in `OEBPS/*.xhtml`; also translate `nav.xhtml` TOC and `toc.ncx`; update `content.opf` language code
- **DOCX**: text lives in `<w:t>` elements within `word/document.xml`, `word/header*.xml`, `word/footer*.xml`; update `docProps/core.xml`
- **PDF**: lossy — export to markdown first, translate, output as `.md` or `.docx` (inform user)
- **Markdown**: preserve all syntax (links, images, code blocks, front matter)

### 3. Repack
Rebuild in the original format. Output as `<name>-<lang>.<ext>`.
- EPUB special rule: `mimetype` must be first ZIP entry, uncompressed (`ZIP_STORED`)

### 4. Validate & cleanup
Structure check, spot-check 2-3 chapters, clean up `work/`

Files in this skill

  • SKILL.md2.8 KB
  • description_ar.txt244 B
  • description_cn.txt163 B
  • description_de.txt216 B
  • description_en.txt180 B
  • description_es.txt199 B
  • description_fr.txt211 B
  • description_it.txt188 B
  • description_ja.txt291 B
  • description_ko.txt219 B
  • description_ru.txt316 B
  • description_tw.txt172 B
  • stats.json68 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.