← ClaudeAtlas

arabic-docxlisted

Generate Microsoft Word (.docx) documents in Arabic or any right-to-left script (Persian, Urdu, Hebrew) with correct paragraph direction, RTL tables, complex-script fonts, and proper mixed Arabic/Latin runs. Use this skill whenever the user asks for a Word document, report, letter, contract, proposal, CV, thesis chapter, or any .docx whose content is Arabic or mixes Arabic with Latin technical terms — even if they never say "RTL". Also use it when an existing Word file opens with columns on the wrong side, text drifting left, Latin words landing in the wrong place, or missing spaces around English terms.
asadeisa/arabic-office-skills · ★ 2 · Data & Documents · score 63
Install: claude install-skill asadeisa/arabic-office-skills
# Arabic / RTL Word documents ## Do not reshape the text This is the opposite of PDF generation, and getting it backwards is the most damaging mistake available here. | | reportlab / Pillow | Word | |---|---|---| | Text engine | none | full bidirectional engine | | Expects | final visual-order glyphs | **logical-order, unshaped Unicode** | `arabic_reshaper` and `python-bidi` are correct for PDF and wrong here. Word shapes at render time, so pre-shaped presentation forms get shaped a *second* time — the result looks broken, and the text can no longer be searched, copied, spell-checked, or edited. If you find reshaping code in a .docx generator, that is the bug. What Word needs instead is plain text plus direction flags in the XML. python-docx exposes almost none of them, so `scripts/arabic_docx.py` writes them directly. **Use it rather than reinventing this** — each flag below fails silently and independently. ## Dependencies ```bash pip install python-docx pypdfium2 ``` Writing the .docx needs nothing else. Rendering the preview needs Microsoft Word (any version, via COM on Windows) or LibreOffice (`soffice`, any platform) — whichever is present is found automatically. ## Building a document Import the builder either by copying `scripts/arabic_docx.py` next to your generation script, or by adding this skill's `scripts/` folder to `sys.path`: ```python import pathlib, sys sys.path.insert(0, str(pathlib.Path.home() / ".claude" / "skills" / "arabic-docx" / "scripts"))