glossary-builder
Skill1 starsChanged 16 days agoMITView on GitHub
Build, audit, and maintain a bilingual term base from documents, a codebase, or an existing translation — with Arabic-aware matching (alef/hamza folding, diacritics, aliases), gender agreement, and per-chunk term injection. Use when terminology must stay consistent across a long translation, a docs site, or an app.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- tomoyaf/aiskillpod-skillstheir own version, first seen Nov 29, 2026
- nafiz530/SkillShelf-Labstheir own version, first seen Nov 29, 2026
- sreevatsarajesh/AgentForgetheir own version, first seen Nov 22, 2026
- frameforged/technical-documentation-frameworktheir own version, first seen Jul 2, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- frameforged/technical-documentation-framework★ 2same name
- nafiz530/SkillShelf-Labs★ 2same name
- sreevatsarajesh/AgentForge★ 1same name
- tomoyaf/aiskillpod-skills★ 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
- localize-appSkill
- rtl-layoutSkill
- skill-forgeSkill
- subtitle-translateSkill
- translate-docsSkill
- translation-qaSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Before translating anything longer than a few pages (usually called from translate-docs, step 2).
- Very specific: line 30
Not for: a one-paragraph translation (build it in your head), or a UI string table (use localize-app, which seeds terms from the strings …
- Distinctive: line 86
Prefer a rendering that survives inflection ("المستودع" works as subject and object.
- Distinctive: line 88
Do not invent a novel Arabic coinage when an established term exists.
- Distinctive: line 111
Never paste the whole glossary into a translation prompt.
- Distinctive: line 124
When a translator makes a new decision mid-run, add it immediately.
- Very specific: line 127
When a decision changes, edit the target, re-run audit, then re-plan.
- Distinctive: line 128
Commit the glossary next to the translation.
“Common” is measured: kept by at least 6 in 10 of the 4 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
Glossary builder
A glossary is the cheapest quality lever in any translation project. Without one, the same English word becomes four Arabic words across four chapters, and no amount of per-chunk quality fixes that.
Governing rule: a glossary entry is a decision, not a suggestion. If a term is in the glossary with a target, every chunk follows it, even where a synonym would read more elegantly.
When to use this
- Before translating anything longer than a few pages (usually called from
translate-docs, step 2). - The user has an existing translation and wants new text to match it.
- A docs site has drifted: the same concept is named three ways.
- A codebase needs its identifiers pinned so prose never translates them.
Not for: a one-paragraph translation (build it in your head), or a UI string
table (use localize-app, which seeds terms from the strings themselves).
Procedure
1. Decide the scope
| Scope | Input | Typical size |
| Single document | the source Markdown | 15–40 terms |
| Book series | all volumes' source | 80–250 terms |
| Docs site | the docs/ tree | 50–150 terms |
| App + docs | strings + docs + code identifiers | 100–400 terms |
Bigger is not better. A 600-term glossary nobody maintains is worse than 60 terms that are actually enforced. Start with the terms that repeat.
2. Extract candidates
python -m qalam glossary build <paths...> --out glossary.json --min-frequency 2 --limit 200Useful flags:
--code— also propose identifiers found in the source tree, pre-markedkeep_as_isso prose never translates them.--from-glossary existing.json— keep every existing decision and add only new candidates (this is how you extend a glossary safely).--min-frequency 3— for a first pass on a very large corpus.
The extractor proposes; it does not decide. Every target is empty on purpose.
3. Fill in targets — the actual work
Work through the candidates in frequency order and stop when the tail is noise. For each term decide four things:
- Target — the rendering a professional would use in this domain.
- Category —
person,place,org,product,technical,title,other. Categories drive review priorities. - Gender —
masculine,feminine,plural,unknown. This is not cosmetic: Arabic verbs and adjectives agree with it. - Aliases — other surface forms that mean the same thing (abbreviations, transliteration variants, the English form if the Arabic keeps it).
And one flag:
keep_as_is— true for identifiers, brand names that stay in Latin script, and anything the author quotes verbatim. Akeep_as_isterm may havetarget == source.
Quality rules:
- One meaning per entry. If a word has two senses, that is two entries, each with the other's surface form as an alias — resolved with the audit step.
- Prefer a rendering that survives inflection ("المستودع" works as subject and object; a rendering that only works in one case will fight you).
- Do not invent a novel Arabic coinage when an established term exists. If no established term exists, pick the clearest descriptive phrase and note it.
- For people, decide transliteration once (فاراداي not فارادي), and add the Latin form as an alias so matching finds both.
4. Audit before use
python -m qalam glossary audit glossary.jsonThe audit fails on:
- the same surface form used by two entries (polysemy),
- an alias that collides with another entry's source,
- entries with no target and no
keep_as_is, keep_as_isentries whose target differs from the source.
Fix every finding. A conflicting glossary produces conflicting instructions to the translating agent, and the agent will pick arbitrarily.
5. Inject per chunk
Never paste the whole glossary into a translation prompt. Send only what applies:
python -m qalam glossary terms glossary.json chunk0007.mdIt returns the terms that appear in that chunk (by source or alias) plus the highest-frequency terms book-wide, as a Markdown table. If it prints nothing, the prompt gets no term section at all — a dangling "terms:" heading with an empty table is worse than omitting it.
6. Keep it alive
- When a translator makes a new decision mid-run, add it immediately. Because the run state hashes the terms that applied to each chunk, only chunks containing that term are re-translated next run.
- When a decision changes, edit the target, re-run
audit, then re-plan. - Commit the glossary next to the translation. It is project state, not scratch output.
7. Report
Give the user: number of terms, how many have targets, the ten highest-frequency terms, and any term you left undecided with the reason. Do not claim the glossary is "complete" — say which sections were covered.
Schema
{
"version": 1,
"terms": [
{
"source": "repository",
"target": "مستودع",
"category": "technical",
"aliases": ["repo"],
"gender": "masculine",
"confidence": "high",
"frequency": 42,
"keep_as_is": false,
"notes": "ريبو only in developer chat, never in docs"
}
]
}Matching is Arabic-aware: alef/hamza forms fold together, alef maqsura matches yeh, tatweel is ignored, and diacritics are stripped for matching while preserved in display.
Codebase seeding
For a repo that ships Arabic docs or an Arabic UI:
python -m qalam glossary build README.md docs --code --out glossary.jsonIdentifiers that appear three or more times are proposed with
keep_as_is: true and target == source, so a translator is told explicitly to
copy them. That single step removes the most common class of code-translation
damage: a function name that got "translated" in a paragraph.
Failure modes
| Symptom | Cause | Fix |
| Same term translated differently per chapter | Glossary not injected per chunk | Use glossary terms <chunk> in every worker prompt |
| Audit reports duplicates | Two entries share a surface form | Merge, or split into two entries with the other's form as an alias and disambiguate in notes |
| Every chunk re-translates after one edit | You edited a high-frequency term | Expected. Confirm that is what you want before re-running the plan |
| Glossary bloats past 400 terms | Candidates added faster than reviewed | Delete the long tail; keep what repeats |
| Arabic gender disagreements | gender left unknown | Fill it for every person and every inanimate noun whose agreement is not obvious |
References
references/term-choices.md— established Arabic renderings for common technical and academic terms, with the reasoning.references/schema.md— the full schema and the matching rules.
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.

