One comprehensive skill for all Arabic handling domains β web RTL, mobile RTL, terminal RTL, document translation, UX writing, Arabic design/typography, RTL linting, and BiDi security.
arabic-handler is a unified skill that consolidates 8 Arabic-related domains into a single reference. Instead of juggling multiple specialized skills, you get one comprehensive resource covering every scenario where Arabic text, RTL layout, or bidirectional content appears in a project.
Merged from 5 source repositories:
almubarmij/arabic-ai-skillsβ Web RTL, Mobile RTL, Terminal RTL, Document Translation, UX WritingMoshe-ship/hurmoz/raqeebβ RTL LintingMoshe-ship/hurmoz/bidi-guardβ BiDi Security (CVE-2021-42574)alMubarmij/Arabic-AI-Skills/arabic-terminal-rtlβ Terminal RenderingJamalMohafil/claude-skills/arabic-designβ Arabic Typography/Design
| # | Domain | Key Use Cases |
|---|---|---|
| 1 | Web RTL | CSS logical properties, Tailwind RTL, React/Next.js RTL setup, BiDi text handling |
| 2 | Mobile RTL | iOS (SwiftUI/UIKit), Android (Compose/Views), React Native β sentinel checks, row composition |
| 3 | Terminal RTL | Windows Terminal, OpenCode, Codex, CLI β character+word reversal for non-BiDi terminals |
| 4 | Document Translation | DOCX β Arabic with exact structure preservation (tables, colors, sections, nested tables) |
| 5 | UX Writing Arabic | Microcopy, error/success/empty states, buttons, tone/voice, consistency, accessibility |
| 6 | Arabic Design/Typography | Font stacks, letter-spacing trap, diacritics, line-height, bidi leaks, Ψ§ΩΩ + Latin trap |
| 7 | RTL Linting (raqeeb) | 0-100 RTL score, 8 category audit, CI/CD integration, auto-fix |
| 8 | BiDi Security (bidi-guard) | Trojan Source detection (CVE-2021-42574), pre-commit hooks, CI scanning |
# Clone to your skills directory
git clone https://github.com/onepurp/arabic-handler.git ~/.config/opencode/skills/arabic-handler
# Or for Claude Code
git clone https://github.com/onepurp/arabic-handler.git ~/.claude/skills/arabic-handlerAuto-detect domain from context:
/arabic-handler
Jump to specific domain:
/arabic-handler web # Web RTL (CSS, React, Next.js, Tailwind)
/arabic-handler mobile # Mobile RTL (iOS, Android, RN)
/arabic-handler terminal # Terminal RTL output
/arabic-handler document # DOCX β Arabic translation
/arabic-handler ux # UX writing, microcopy, error messages
/arabic-handler design # Arabic typography, fonts, design rules
/arabic-handler lint # raqeeb RTL linting
/arabic-handler security # bidi-guard BiDi security scan
| File | Description |
|---|---|
SKILL.md |
Main skill β 1,700+ lines covering all 8 domains |
references/css-logical-properties.md |
Complete physicalβlogical CSS mapping + Tailwind utilities + Arabic font stacks |
references/ux-writing-checklist.md |
Pre-ship review checklist (8 sections, 60+ checks, templates) |
references/arabic-glossary.md |
Bilingual ENβAR glossary (UX, dev, design, Arabic-specific terms) |
- CSS Logical Properties β Complete mapping table (margin, padding, border, positioning, text, sizing)
- Tailwind v3.3+/v4 β Logical utilities (
ms-4,me-4,ps-4,pe-4,start-4,end-4,rounded-s-lg,rounded-e-lg) - Next.js App Router β
next/fontwith Tajawal, locale-awaredirattribute - BiDi Handling β
unicode-bidi: isolate,.ltr-contentpattern, phone/URL isolation
- Sentinel Check β Full-width Arabic text block to verify root RTL before any fixes
- Row Composition β Two-zone pattern: text (visual right, flexible) + accessory (visual left, pinned)
- Control Direction β Local LTR for compound controls (+/-, steppers, segmented) while row stays RTL
- Framework-Native β
leading/trailing(iOS),start/end(Android),I18nManager.isRTL(RN)
- Character Reversal β Reverse chars inside each Arabic word
- Word Order Reversal β Reverse word order per Arabic segment
- Preserve β Code, commands, paths, URLs, JSON, English, numbers, slash commands
- 4-Phase Pipeline β Analyze β Dictionary β Generate β Verify
- 3-Level RTL β Text direction (bidi/rtl/complex_script) + Alignment (right) + Layout (columns LβR for data)
- Multi-Pass Matching β 7-pass normalization (95%+ success vs 60% exact-match)
- Nested Tables β Extract content from cells containing nested tables (checklists, forms)
- Auto Color Correction β White text on dark backgrounds
- Voice/Tone Framework β Fixed voice (wise, curious, confident), contextual tone (4 dimensions)
- Emotional Context β Positive (encouraging), Neutral (confident, value-linked), Negative (honest, solution-oriented)
- Button Patterns β Verb + Noun, Confirmation (Verb + Result), Transformation (Value + Action)
- Error/Success/Empty State Templates β Problem+Solution+Positive framing
- Rule 1 β
letter-spacing: normalALWAYS for Arabic (negative crushes, positive disconnects) - Rule 2 β Explicit Arabic font stacks (Cairo/Tajawal, Almarai/Rubik, Noto Naskh/Amiri)
- Rule 3 β Line-height β₯ 1.3 display, β₯ 1.5 body (diacritics need room)
- Rule 4 β Root
dir="rtl"once, logical properties, isolate Latin tokens, noΨ§ΩΩbefore Latin - Rule 6 β Mobile: β₯ 36-40px body, 600-800 weight for display
raqeeb scan ./src/ # Local files
raqeeb url "https://site.sa" # Live URL
raqeeb report ./src/ --format markdown
raqeeb fix ./src/ --yes # Auto-fix for CI
raqeeb ci --threshold 75 # CI gatebidi-guard scan ./src/ # Detect U+202E (RLO), U+202D (LRO), U+2067 (RLI), etc.
bidi-guard ci # CI integration
bidi-guard fix ./src/ --yes # Auto-remove| # | Mistake | Fix |
|---|---|---|
| 1 | text-align: left for Arabic |
Use text-align: start |
| 2 | margin-left/padding-right don't flip |
Use logical properties |
| 3 | flex-direction: row-reverse for RTL |
row auto-reverses; row-reverse double-flips |
| 4 | Phone/URL/code inherits RTL | Wrap in <span dir="ltr"> |
| 5 | Negative letter-spacing on Arabic |
Always normal β crushes connected letters |
| 6 | Latin font fallback for Arabic | Explicit Arabic-capable font-family |
| 7 | No full-width for Arabic text blocks | Give text blocks full available width |
| 8 | Second local RTL override | Prefer framework-native logical direction |
| 9 | Hard-coded right/left |
Use leading/trailing or start/end |
| 10 | direction: ltr parent leaks |
LTR for layout only; Arabic text gets explicit direction: rtl |
| 11 | Ψ§ΩΩ before isolated Latin word |
Drop article or rephrase |
| 12 | Directional icons not flipped | rtl:rotate-180 or I18nManager.isRTL |
| 13 | Multi-line DOCX cells split | Preserve \n within cells |
| 14 | No visual check after fixes | Generate comparison images/screenshot |
| 15 | English punctuation in Arabic | Use Ψ Ψ not ? , |
| 16 | Buttons with bare nouns | Verb + Noun (Ψ£ΨΆΩ ΩΨͺΨ§Ψ¨Ψ§Ω not Ψ₯ΨΆΨ§ΩΨ©) |
| Tool | Purpose |
|---|---|
| Python 3.8+ | Document translation scripts |
python-docx β₯ 0.8.11 |
DOCX manipulation |
Pillow β₯ 9.0.0 |
Image processing |
| LibreOffice | DOCX β PDF (visual comparison) |
Poppler (pdftoppm) |
PDF β PNG (visual comparison) |
pipx |
Install raqeeb and bidi-guard |
# Python deps
pip install python-docx Pillow
# Linting & Security tools
pipx install raqeeb
pipx install bidi-guard| Resource | URL |
|---|---|
| MDN CSS Logical Properties | https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values |
| Tailwind RTL Support | https://tailwindcss.com/docs/hover-focus-and-other-states#rtl-support |
| Tailwind Logical Properties | https://tailwindcss.com/docs/margin#logical-properties |
| Google Fonts Arabic | https://fonts.google.com/?subset=arabic |
| W3C Internationalization | https://www.w3.org/International/articles/inline-bidi-markup/ |
| CVE-2021-42574 (Trojan Source) | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42574 |
| Unicode BiDi Algorithm | https://unicode.org/reports/tr9/ |
Contributions welcome! Areas for improvement:
- Additional language support (Hebrew, Urdu, Farsi, Pashto)
- Enhanced PDF-vs-DOCX gap detection
- Integration with translation APIs (Google, DeepL, LibreTranslate)
- Performance optimization for 100+ page documents
- More framework examples (Vue, Svelte, Astro, Expo)
- Automated visual regression testing
MIT License β Free for personal and commercial use.
Built by merging and unifying these excellent open-source skills:
- almubarmij β arabic-ai-skills (5 domains)
- Moshe-ship β hurmoz/raqeeb & hurmoz/bidi-guard
- alMubarmij β Arabic-AI-Skills/arabic-terminal-rtl
- JamalMohafil β claude-skills/arabic-design
Battle-tested on production projects including:
- Financial forecasts (9 pages, 6 tables, red/pink color scheme)
- Feasibility analyses (academic formatting, multi-section)
- Business proposals (various structures)
- Mobile apps (iOS, Android, React Native)
- Web apps (React, Next.js, Vue)
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: See
SKILL.mdandreferences/directory
One skill. Eight domains. Zero excuses for broken Arabic UI.