agentleFS
deusyudeusyu/translate-book/CLAUDE.md

translate-book

CLAUDE.md2.1k starsChanged 3 months agoMITView on GitHub

translate-book is an agent skill for Codex, Claude Code, and OpenClaw that translates books (PDF/DOCX/EPUB) into any language using parallel subagents. Published on ClawHub as translate-book and on GitHub as deusyu/translate-book. - Python 3.12+ — the version CI runs. - Unit tests need nothing else. Every third-party import in scripts/ is guarded (try/except ImportError or function-local), so the suite runs on a bare stdlib. - The full pipeline additionally needs Calibre (ebook-convert) and Pandoc binaries, plus the pypandoc, beautifulsoup4, and…

  • Commits and pushes

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 2 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the deusyu/translate-book repository that our weekly crawl found: only 5 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

The file

We split this CLAUDE.md into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Unit tests need nothing else: Every third-party import in scripts/ is guarded (try/except ImportError or function-local), so the suite runs …

    line 24
  2. Distinctive:

    Verify: all output_chunk*.md files exist, manifest validation passes, output formats generate.

    line 47
  3. Very specific:

    Only chunk*.md naming — no page* legacy support

    line 51
  4. Very specific:

    Do not reintroduce page* file support — it was intentionally removed

    line 62
  5. Very specific:

    Do not hardcode ~/.claude/skills/ paths in SKILL.md — use {baseDir}

    line 63
  6. Very specific:

    Do not put platform-specific tool names (Agent, sessions_spawn) in allowed-tools as the only option — keep the whitelist cross-platform

    line 64
  7. Distinctive:

    Do not add mtime-based incremental rebuild for HTML/format generation — the current skip logic is intentionally simple (existence check).

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Project

translate-book is an agent skill for Codex, Claude Code, and OpenClaw that translates books (PDF/DOCX/EPUB) into any language using parallel subagents. Published on ClawHub as translate-book and on GitHub as deusyu/translate-book.

Structure

  • SKILL.md — Skill definition, the orchestration logic that Codex / Claude Code / OpenClaw follows
  • scripts/convert.py — PDF/DOCX/EPUB → Markdown chunks (via Calibre HTMLZ); Markdown input (e.g. from MinerU/Marker) skips Calibre
  • scripts/manifest.py — SHA-256 chunk tracking and merge validation
  • scripts/glossary.py — Term-consistency glossary; per-chunk term tables injected into sub-agent prompts
  • scripts/chunk_context.py — Read-only previous/next chunk excerpts injected into sub-agent prompts
  • scripts/meta.py — Per-chunk sub-agent observation file schema
  • scripts/merge_meta.py — Batch-boundary merge of sub-agent observations into the canonical glossary
  • scripts/run_state.py — Selective re-translation planner and run_state.json recorder
  • scripts/merge_and_build.py — Merge translated chunks → HTML/DOCX/EPUB/PDF
  • scripts/calibre_html_publish.py — Calibre format conversion wrapper
  • scripts/template.html, scripts/template_ebook.html — HTML templates

Prerequisites

  • Python 3.12+ — the version CI runs.
  • Unit tests need nothing else. Every third-party import in scripts/ is guarded (try/except ImportError or function-local), so the suite runs on a bare stdlib.
  • The full pipeline additionally needs Calibre (ebook-convert) and Pandoc binaries, plus the pypandoc, beautifulsoup4, and markdown packages. Missing pieces degrade individual output formats rather than failing the run.

Testing changes

Unit tests (what CI runs — fast, no setup):

python3 -m unittest discover -s tests -p 'test_*.py' -v
python3 -m compileall scripts tests

Then test with a small PDF to verify the full pipeline:

python3 scripts/convert.py /path/to/small.pdf --olang zh
# then run translation via the skill
python3 scripts/merge_and_build.py --temp-dir <name>_temp --title "test"

Verify: all output_chunk*.md files exist, manifest validation passes, output formats generate.

Conventions

  • Only chunk*.md naming — no page* legacy support
  • Pipeline output artifacts use the canonical names book.html, book_doc.html, book.docx, book.epub, book.pdf. Internal scripts and skip/cache logic depend on these names; if title-based filenames are added later they must be optional aliases/copies, not silent replacements
  • SKILL.md frontmatter must stay single-line per field (OpenClaw parser requirement)
  • Script paths in SKILL.md use {baseDir} not hardcoded paths
  • Subagent instructions in SKILL.md must be platform-neutral (work on Codex, Claude Code, OpenClaw)
  • Checked-in baseline inputs live under tests/baselines/<book-id>/; generated full-pipeline outputs live under tests/.artifacts/
  • README changes must be synced to both README.md and README.zh-CN.md
  • Releases follow .claude/commands/release.md — three commands in order: git push origin main, git tag vX.Y.Z && git push --tags, npx clawhub@latest publish ./ --version X.Y.Z. Do not skip the git tag; it's the only version anchor in the repo

Do not

  • Do not reintroduce page* file support — it was intentionally removed
  • Do not hardcode ~/.claude/skills/ paths in SKILL.md — use {baseDir}
  • Do not put platform-specific tool names (Agent, sessions_spawn) in allowed-tools as the only option — keep the whitelist cross-platform
  • Do not add mtime-based incremental rebuild for HTML/format generation — the current skip logic is intentionally simple (existence check). Metadata/template changes require manual cleanup. This is documented in the README.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.