agentleFS
kcy4334-lgtmkcy4334-lgtm/translate-book-arxiv/CLAUDE.md

translate-book-arxiv

CLAUDE.md38 starsChanged 24 days agoMITView on GitHub

translate-book is a Claude Code Skill that translates books (PDF/DOCX/EPUB) into any language using parallel subagents. Published on GitHub as kcy4334-lgtm/translate-book-arxiv. A fork of deusyu/translate-book; upstream also publishes on ClawHub, this fork does not. - SKILL.md: Skill definition, the orchestration logic that Claude Code / OpenClaw follows - KNOWLEDGE.md: findings log: tool behaviour that surprised us, with the measurement that proved it. Read on unexpected output; append per SKILL.md Step 9. Anything a test now enforces is one line here…

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

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every script, with what it does, is in the README's Project Structure table and only there.

    line 16
  2. Distinctive:

    Test with a small PDF to verify the full pipeline:

    line 26
  3. Distinctive:

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

    line 34
  4. Very specific:

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

    line 38
  5. Very specific:

    Do not let a shipped text file grow past 256 KiB.

    line 48
  6. Very specific:

    Do not put language font data or page geometry anywhere but scripts/layout.py.

    line 49
  7. Very specific:

    Do not reintroduce page* file support.

    line 51
  8. Very specific:

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

    line 52
  9. 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 53

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 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 a Claude Code Skill that translates books (PDF/DOCX/EPUB) into any language using parallel subagents. Published on GitHub as kcy4334-lgtm/translate-book-arxiv. A fork of deusyu/translate-book; upstream also publishes on ClawHub, this fork does not.

Structure

  • SKILL.md: Skill definition, the orchestration logic that Claude Code / OpenClaw follows
  • KNOWLEDGE.md: findings log: tool behaviour that surprised us, with the measurement that proved it. Read on unexpected output; append per SKILL.md Step 9. Anything a test now enforces is one line here pointing at the test
  • KNOWHOW.md and REFEREE.md: what a way of working cost, and which repeated failures belong to a tool, a brief or a role
  • Every script, with what it does, is in the README's Project Structure table and only there. CLAUDE.md and AGENTS.md each kept a copy of that list, and each had lost a different dozen scripts
  • merge_and_build.py was split into latex_cleanup.py, numbering.py, latex_tables.py and build_common.py to stay under 256 KiB. It imports back every name its callers and tests use, so those imports are not dead

Testing changes

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 Claude Code, OpenClaw, Codex)
  • There is ONE README. Upstream keeps a Chinese one; this fork dropped it rather than carry a translation nobody here can review; it would go stale on the first edit, and a stale translation is worse than none
  • Releases follow .claude/commands/release.md, and only that file spells out the commands. The git tag is the only version anchor in the repo. ClawHub publishing is upstream's, not this fork's

Do not

  • Do not let a shipped text file grow past 256 KiB. Anthropic's plugin directory holds every release that has one for a human reviewer; tests/test_plugin_skill_rules.py fails first
  • Do not put language font data or page geometry anywhere but scripts/layout.py. It used to be duplicated in merge_and_build.py and calibre_html_publish.py and the two copies had already drifted
  • Do not list a variable font (Noto Serif KR, Noto Sans KR) in a CJK stack. Chromium cannot subset-embed one and falls back to a Type3 object per glyph, which bloats the PDF ~8x and stops it being real text. Use a static face. A CFF face (Noto Serif CJK, STIX Two Math, Latin Modern Math) prints as Type3 the same way, so a TrueType one goes ahead of it in any stack, and layout.py's face lists, which doctor.py checks, name only TrueType faces
  • 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
  • The build skips work by file time: book_doc.html is remade when output.md is newer than it, and each format when book_doc.html, an image or the cover is. A new title, template or print profile touches none of those files, so it needs --force-html

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.