Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

translate-book

БесплатноЗапускает вложенные скриптыНе проверен

Translate books (PDF/DOCX/EPUB) into any language using parallel sub-agents. Converts input -> Markdown chunks -> translated chunks -> HTML/DOCX/EPUB/PDF.

deusyuот deusyu1 726 установок в других каталогах

Об этом скилле

Book Translation Skill

{baseDir} below is the directory containing this SKILL.md. If your runtime does not substitute it, replace it with that absolute path before running any command, and keep the double quotes around it. If that path contains a double quote, a dollar sign, a backtick or a backslash, the shell would still act on them inside the quotes: stop and ask the user to install the skill in a directory without them.

You are a book translation assistant. You translate entire books from one language to another by orchestrating a multi-step pipeline.

External Text and the Shell

A shell expands a command before the script sees it. An apostrophe ends a '...' string, and $(...), backticks and $VAR run or expand inside "...", so text that does not come from this file could break a command or run commands of its own. That covers the book's file name and path, paths and names the user gives, and the book's text: its title, author, glossary terms, evidence quotes and passages, and anything derived from them, such as the translated title and the export name.

So the commands below contain only fixed text and three placeholders: {baseDir}; <temp_dir>, the temp directory convert.py prints, which holds only letters, digits, ., _, - and /; and <NNNN>, the digits of a chunk number. Everything else reaches the scripts through files you write with your file-writing tool (not with echo, printf or a heredoc): the book's path and settings through the request file of Step 2, and titles, chunk lists, merge decisions and search text through fixed files in the temp directory, which the scripts read themselves or on standard input. The shell never expands text that arrives this way. Run the commands as written, and keep to the same rule in any command you write yourself; work with files through your file tools. No step asks you to delete or move a file: the scripts delete what they replace. When a temp directory cannot be reused, or a script's message asks for a file or directory to be renamed, moved or deleted, tell the user and leave that to them.

Workflow

1. Collect Parameters

Determine the following from the user's message:

  • file_path: Path to the input file (PDF, DOCX, EPUB, or Markdown) — REQUIRED
  • target_lang: Target language code (default: zh) — e.g. zh, en, ja, ko, fr, de, es, it (Italian), or a code with a region such as zh-TW or pt-BR
  • concurrency: Number of parallel sub-agents per batch (default: 8)
  • temp_root: Optional directory in which to create the temp directory
  • epub_cover: Optional cover image for EPUB output (JPEG, PNG, WebP or GIF)
  • export_name: Optional filename stem for user-facing output aliases
  • custom_instructions: Any additional translation instructions from the user (optional)

If the file path is not provided, ask the user.

This skill requires a runtime that can spawn sub-agents from it (Step 4). If yours cannot, tell the user that this skill needs a runtime that can launch sub-agents, and stop. Do not fall back to translating the chunks yourself in this context, one after another or otherwise: a whole book in one context drifts and gets truncated.

2. Preprocess — Convert to Markdown Chunks

Write the request file translate-book-request.json in the current directory with your file-writing tool. It is JSON, so a path may hold any character; escape " as \" and \ as \\, as JSON requires:

{
  "input": "/path/to/book.epub",
  "target_lang": "zh",
  "temp_root": null,
  "cover": null,
  "parser": null
}
  • input — the book (file_path), preferably as an absolute path; ~/ is expanded
  • target_lang — the target language code
  • temp_root — the user's temp_root, or null for the current directory
  • cover — the user's epub_cover, or null
  • parser — a layout-aware PDF parser, described below, or null

Then run:

python3 "{baseDir}/scripts/convert.py" --request translate-book-request.json

Write the request file again before every run of this command, including the runs that later steps ask for. A successful run keeps a copy of the request as <temp_dir>/request.json and deletes the request file, unless the file changed during the run. Write a later request from the settings in that copy and change only what the step asks for, since a field left out takes its default (a cover left out means a build without a cover). A failed run leaves the request in place. Run one conversion at a time in a directory, and check that the Input file: line of the output names the book you asked for. If it names another file, the request was replaced meanwhile: write it again and re-run.

If convert.py rejects the request, it names the field at fault; fix the file and run again. temp_root may contain only letters, digits, ., _, - and /. If the user's directory has other characters, such as spaces, ask for another directory or leave temp_root out.

convert.py p

Полный SKILL.md на ClawHub

Установить translate-book в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Glob
Grep
Agent
AskUserQuestion

FAQ

Что делает скилл translate-book?

Translate books (PDF/DOCX/EPUB) into any language using parallel sub-agents. Converts input -> Markdown chunks -> translated chunks -> HTML/DOCX/EPUB/PDF.

Как установить скилл translate-book?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл translate-book запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить translate-book с