translate-docs
Skill1 starsChanged 15 days agoMITView on GitHub
Translate long documents, books, and docs between any two languages with consistent terminology, checksummed structure, and a QA gate; Arabic-first defaults with RTL typography, Arabic punctuation, and numbered-script rules. Use when the user asks to translate a Markdown file, book, manual, or whole docs folder, especially Arabic ↔ English.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- kanap-hq/KANAPtheir own version, first seen Nov 8, 2026
- X-T-E-R/kikitheir own version, first seen Nov 1, 2026
- CherryHQ/cherry-studiotheir own version, first seen Oct 25, 2026
- reactive/data-clienttheir own version, first seen Oct 17, 2026
- xiaolai/vmarktheir own version, first seen Oct 8, 2026
- MoonshotAI/kimi-codetheir own version, first seen Oct 8, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- CherryHQ/cherry-studio★ 54ksame name
- MoonshotAI/kimi-code★ 8.3ksame name
- reactive/data-client★ 2ksame name
- xiaolai/vmark★ 942same name
- X-T-E-R/kiki★ 62same name
- kanap-hq/KANAP★ 8same name
- OxyFlax/AI★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- arabic-styleSkill
- extract-docsSkill
- glossary-builderSkill
- localize-appSkill
- rtl-layoutSkill
- skill-forgeSkill
- subtitle-translateSkill
- translation-qaSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 12 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
12
Distinctive
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
- Distinctive: line 36
Ask only for what is missing.
- Very specific: line 58
If python -m qalam fails, the bundle is not on PYTHONPATH.
- Very specific: line 74
Read manifest.json once: it lists every chunk with its heading path, size, and whether it contains code or a table.
- Very specific: line 77
Never translate manifest.json, and never rename a chunk file.
- Very specific: line 103
If a name should stay in Latin script (a brand, a CLI flag), set keep_as_is: true and put the same string in target.
- Distinctive: line 108
If a glossary already exists, do not rebuild it.
- Very specific: line 135
Read chunkNNNN.md in full.
- Distinctive: line 154
Only when the gate has no errors, record the chunk:
- Distinctive: line 163
Parallelism: If the host supports sub-agents, one chunk per sub-agent, four to eight at a time.
- Distinctive: line 187
Every heading, and the table of contents if the source has one.
- Distinctive: line 209
Every gate finding you accepted without fixing, with one line of reasoning.
- Distinctive: line 213
Do not claim the translation is "complete and accurate".
- Distinctive: line 222
Never invent content: If the source is ambiguous, translate the ambiguity, not a guess.
- Distinctive: line 224
Never drop content: Every sentence in the source has a counterpart.
- Distinctive: line 231
Leave the author's voice intact: Do not add introductory sentences, summaries, or "in this section we will" filler.
- Very specific: line 241
Numerals: follow the numerals input.
- Distinctive: line 243
No tashkeel by default: Add harakat only where the source disambiguates meaning or the user asks.
- Distinctive: line 245
Bidirectional text: when a Latin name or number sits in an Arabic sentence, the renderer handles order — do not insert directional marks by …
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Translate documents
You translate whole documents, not snippets. A book or a manual is long enough that a single pass degrades: terminology drifts, sections get skipped, and code turns into prose. This skill turns translation into a pipeline with a state file, a term base, and a gate that runs on real files.
The rule that governs everything below: a translation must be complete, terminologically consistent, and structurally identical to the source. Style is a judgement call; those three are not.
When to use this
The user wants a document translated, or says any of: "translate this book", "عرّب هذا الملف", "translate the docs folder", "make an Arabic version", "translate to Arabic/French/Japanese", "turn this PDF into Arabic Markdown".
- PDF/DOCX/EPUB input → load
extract-docsfirst, then come back here. - Subtitle files (.srt/.vtt) → load
subtitle-translate. - Application strings (.json/.resx/.po/.arb) → load
localize-app. - A paragraph or a single page → just translate it; the pipeline is overhead.
Inputs to confirm before starting
Ask only for what is missing. Do not interrogate the user for the rest.
| Input | Default | Notes |
source | — | File or folder of Markdown. Required. |
source_language | auto | Run python -m qalam lang <file> and confirm if unclear. |
target_language | ar | A BCP-47 code: ar, ar-EG, en, fr, ja. |
register | from source | formal (فصحى معاصرة) for books and docs, neutral for blogs, technical for manuals. |
numerals | preserve | Western, Arabic-Indic (٠١٢), or preserve the source. |
glossary | new | Existing glossary.json if the project has one. |
audience | general | Used for register and example choices only. |
State the values you inferred in one line and continue. This is a long task; a confirmation loop on defaults wastes the user's time.
Setup
python -m qalam info # version, skills, en→ar ratio band
python -m qalam install --tools claude codex cursor opencode --dry-runIf python -m qalam fails, the bundle is not on PYTHONPATH. Use the path the
skill was loaded from: python3 <skill-dir>/../../qalam/cli.py or add the repo
root to PYTHONPATH. Do not reimplement these steps inline — the whole point of
the CLI is that the numbers are computed, not guessed.
Procedure
1. Prepare the working directory
mkdir -p work/ar && cp -n source.md work/source.md
python -m qalam lang work/source.md
python -m qalam chunk work/source.md --out-dir work/ar --target-chars 6000 --max-chars 12000work/ar/ now holds chunk0001.md …, chunkNNNN.md, and manifest.json.
Read manifest.json once: it lists every chunk with its heading path, size, and
whether it contains code or a table. That is your work plan.
Never translate manifest.json, and never rename a chunk file.
2. Build or load the term base
python -m qalam glossary build work/source.md --out work/ar/glossary.json --code
python -m qalam glossary show work/ar/glossary.jsonThe build step proposes candidates only — every target is empty. Fill in the
targets yourself for names, products, and domain terms; leave keep_as_is
entries alone (code identifiers). Then audit:
python -m qalam glossary audit work/ar/glossary.jsonAn unattended glossary is worse than none: it locks in mistakes for the whole document. Spend the time here, on the 20–40 terms that actually repeat.
Rules for a good entry:
- One source form per concept. Polysemous words get separate entries with an alias on each, never one entry with two meanings.
gendermatters in Arabic:masculine,feminine,plural, orunknown. Fill it for people and for nouns whose gender is not obvious.- If a name should stay in Latin script (a brand, a CLI flag), set
keep_as_is: trueand put the same string intarget. - Arabic targets for feminine proper nouns must match the verb agreement used in
the target language.
امرأةis feminine;شخصcan be either.
If a glossary already exists, do not rebuild it. Load it and merge:
python -m qalam glossary build work/source.md --from-glossary work/ar/glossary.json --out work/ar/glossary.json3. Plan the run
python -m qalam plan work/ar --glossary work/ar/glossary.json --target-language ar --jsontranslation_chunk_ids is your queue. record_only_chunk_ids already have a
usable output; record them and move on. unchanged_chunk_ids are done.
python -m qalam record work/ar chunk0003 chunk0007 --glossary work/ar/glossary.json --target-language arThe plan is the only source of truth about what is left. Do not decide by glancing at filenames, and do not retranslate the whole set because one chunk changed — that is what the state file prevents.
4. Translate chunk by chunk
For each chunk in the queue, in order:
- Read
chunkNNNN.mdin full. Do not start writing before you have read it. Get the terms that apply to this chunk:
python -m qalam glossary terms work/ar/glossary.json work/ar/chunk0007.md- Translate into
output_chunkNNNN.mdfollowing the rules inreferences/translation-rules.mdand, for Arabic,references/arabic-typography.md. Self-check before writing the file. Run the gate on the pair:
python -m qalam gate --source work/ar/chunk0007.md --target work/ar/output_chunk0007.md \ --source-language <src> --target-language <tgt> --glossary work/ar/glossary.jsonFix every
error. Read everywarnand either fix it or explain why it is intentional.infolines are review notes, not blockers.Only when the gate has no errors, record the chunk:
python -m qalam record work/ar chunk0007 --glossary work/ar/glossary.json --target-language ar
Writing the file before the check is the most common cause of a half-translated document that looks finished. Write, check, then record.
Parallelism. If the host supports sub-agents, one chunk per sub-agent, four
to eight at a time. Each sub-agent gets: its chunk path, its output path, the
target language, the term table from step 2, and the two reference files. A
sub-agent that cannot run the gate reports its chunk as review rather than
pretending it passed:
python -m qalam record work/ar chunk0011 --status review --note "gate: 2 warnings unread"5. Merge and verify the whole document
python -m qalam merge --source-dir work/ar --translated-dir work/ar --out work/final.md --strict
python -m qalam gate --source work/source.md --target work/final.md \
--source-language <src> --target-language <tgt> --glossary work/ar/glossary.json--strict fails on missing or blank chunks. Treat a failure as unfinished work,
not as a warning to mention in passing.
Then check the things the gate cannot see, by reading:
- Chapter openings and closings — the places translations usually break.
- Every heading, and the table of contents if the source has one.
- The first and last paragraph of every chunk boundary, where a dropped sentence hides most easily.
- Anything the glossary marked
keep_as_is.
6. Deliver a readable preview
python -m qalam preview work/final.md --out work/preview.html \
--target-language ar --source-language <src> --title "<book title>"The preview is a single self-contained file: RTL direction, Arabic font stack, Arabic-friendly line height, code blocks forced LTR, and mirrored punctuation. Open it, or tell the user to open it — do not paste a whole book into chat.
7. Report honestly
Deliver:
- Path to the translated file and to the preview.
- A short table: chunks total / translated / reused from memory / flagged.
- Every gate finding you accepted without fixing, with one line of reasoning.
- What you did not verify (figures, footnotes, anything visual).
- The commands to re-run after edits, so the user can maintain the translation.
Do not claim the translation is "complete and accurate". State what was checked and what was not.
Translation rules that are not negotiable
Full detail is in references/translation-rules.md; the short version:
- Never translate code. Fenced blocks, inline code, CLI flags, file paths, URLs, and HTML tags are copied byte for byte.
- Never invent content. If the source is ambiguous, translate the ambiguity, not a guess. If something is genuinely untranslatable, keep it and note it.
- Never drop content. Every sentence in the source has a counterpart.
- Keep the structure. Same number of headings, list items, links, and images, in the same order.
- Use the glossary. A term with a target is not a suggestion.
- Match the register of the source, not the house style of the model.
- Translate meaning, not words. Idioms become idioms; units, dates, and names follow the target locale's conventions.
- Leave the author's voice intact. Do not add introductory sentences, summaries, or "in this section we will" filler.
Arabic specifics
Load references/arabic-typography.md before translating into Arabic. The
parts that break most often:
- Punctuation is Arabic:
،؛؟, and the Arabic comma after a clause. Western, ; ?inside Arabic prose is a gate warning. - Numerals: follow the
numeralsinput. Keep Western digits inside code, URLs, and version numbers even when prose uses ٠١٢. - No tashkeel by default. Add harakat only where the source disambiguates meaning or the user asks; a fully vocalised body text reads like a schoolbook.
- Bidirectional text: when a Latin name or number sits in an Arabic sentence, the renderer handles order — do not insert directional marks by hand unless the gate or a visual check proves it necessary.
- Terminology consistency beats elegance. The same English term becomes the same Arabic term everywhere, even where a synonym would read better.
- No machine-translation tells. "من المهم أن نلاحظ", "لا شك أن", "في عالم اليوم" are flagged by the gate; rewrite them.
Failure modes and what to do
| Symptom | Cause | Fix |
| Gate reports low length ratio | A chunk was truncated or a chunk is missing | Re-translate that chunk; never pad with words |
Gate reports code_changed | Code was "improved" while translating | Copy the block verbatim from the source |
plan keeps listing the same chunks | Output was written but never recorded | Run qalam record after the gate passes |
| Terminology warnings after a glossary edit | Aliases changed | Expected: the planner invalidates only affected chunks. Re-translate those. |
| Arabic text renders backwards in a viewer | Viewer lacks RTL support | Deliver the HTML preview; do not "fix" it with directional marks |
| Numbers changed | Locale conversion | Numbers are content; keep the value, change only digit style |
References
references/translation-rules.md— the full rule set, with examples.references/arabic-typography.md— RTL, punctuation, numerals, harakat.references/pipeline.md— file layout, state file, resuming, troubleshooting.references/prompts.md— ready prompts for sub-agents and review passes.
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
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.

