arabic-design
Skill27 starsChanged 54 days agoMITView on GitHub
Make AI-generated designs render Arabic text correctly — clean, connected, professional. Fixes the letter-spacing trap that breaks connected script, wrong font fallbacks, clipped diacritics, and RTL/bidi bugs in mixed Arabic+English text. Use whenever generating or styling ANY Arabic text in HTML/CSS/React/UI — especially when Arabic "looks broken", letters overlap or disconnect, words render in the wrong order, or diacritics get clipped.
In this repository6 other files it gives its agents.
- agent-starter-kitSkill
- claude-arabicSkill
- content-os-builderSkill
- security-reviewSkill
- video-cutSkill
- youtube-chaptersSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
Never apply font-style: italic to Arabic (fake oblique breaks the script) and never rely on text-transform (Arabic has no case).
- Distinctive: line 56
If unsure, go looser. Clipped diacritics are an instant "looks broken" tell.
- Very specific: line 61
Don't sprinkle dir attributes on every element.
- Very specific: line 62
Use logical CSS properties so layout flips correctly: margin-inline-start, padding-inline-end, text-align: start — instead of margin-left, …
- Very specific: line 76
The
الـ+ Latin-word trap: never place the Arabic definite-article prefix (الـ, بالـ, للـ) immediately before an isolated Latin word — … - Very specific: line 83
Use Arabic punctuation in Arabic sentences: ؟ not ?, ، not ,.
- Very specific: line 84
If a ? or ، floats to the wrong side, the cause is almost always a straddling Latin token — wrap it in .ltr or rephrase so the sentence …
- Distinctive: line 86
When splitting a headline across lines, each line must continue the sentence naturally — Arabic readers read stacked lines as one flowing …
- Very specific: line 98
No negative letter-spacing on any Arabic-containing selector:
- Very specific: line 102
Every hit must be pure-Latin/numeric.
- Very specific: line 103
Every Arabic element has an explicit Arabic-capable font-family.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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.
Files
Arabic Design — clean Arabic in AI-generated UI
Arabic is a cursive, connected script: letters join, and diacritics (ً ّ َ) sit above/below the baseline. Most AI-generated CSS is tuned for Latin type — and that's exactly what breaks Arabic. Apply these rules by default whenever the design contains Arabic; don't wait to be told.
Rule 1 — NEVER negative letter-spacing on Arabic (the #1 bug)
Latin design trends love tight tracking (letter-spacing: -0.02em). On Arabic, negative tracking
overlaps the letter joins and crushes words into an unreadable blur. Positive tracking is just as
wrong — it disconnects letters that must join.
/* ❌ WRONG — crushes connected letters into a blur */
h1 { letter-spacing: -1.5px; } /* element contains Arabic */
/* ✅ RIGHT */
h1 { letter-spacing: normal; } /* or 0 — always, for any element containing Arabic */- Any element containing Arabic (or mixed Arabic+Latin) →
letter-spacing: normal. Full stop. - Negative/positive tracking is allowed only on pure-Latin/numeric elements (big stat numbers,
$99,VS, all-caps Latin labels).
Rule 2 — Use a real Arabic font (never Latin-font fallback)
A Latin font with no Arabic glyphs silently falls back to a system font — mismatched weight, broken look. Always declare an Arabic-capable font explicitly, with a full stack:
/* pick one that matches the design's mood: */
font-family: "Cairo", "Tajawal", "IBM Plex Sans Arabic", "Noto Kufi Arabic", sans-serif; /* modern UI */
font-family: "Almarai", "Rubik", "Baloo Bhaijaan 2", sans-serif; /* rounded/friendly */
font-family: "Noto Naskh Arabic", "Amiri", serif; /* editorial/classic */- Load the Arabic weights you actually use (400/700 at minimum).
- Never apply
font-style: italicto Arabic (fake oblique breaks the script) and never rely ontext-transform(Arabic has no case).
Rule 3 — Line-height must clear the diacritics
Bold display Arabic needs vertical room, or dots/diacritics collide with the line above.
| Context | Safe line-height |
| Display headline (large, bold) | 1.3 |
| Mid headline | 1.35 |
| Body / captions | 1.5–1.7 |
If unsure, go looser. Clipped diacritics are an instant "looks broken" tell.
Rule 4 — Direction & bidi (the "words are reversed" family of bugs)
- Set direction once at the root (
<html dir="rtl">for Arabic-first pages) — children inherit. Don't sprinkledirattributes on every element. - Use logical CSS properties so layout flips correctly:
margin-inline-start,padding-inline-end,text-align: start— instead ofmargin-left,text-align: left. - Wrap embedded Latin words/numbers inside Arabic text in an isolated span so the bidi
algorithm doesn't reorder them:
.ltr { display: inline-block; direction: ltr; }حدد أول <span class="ltr">MVP</span> قبل ما تبدأ - The
direction: ltrparent leak (root cause of reversed word order): layout containers set todirection: ltrfor card/column order leak LTR into the Arabic text inside — soMarketplace مدمجrenders asمدمج Marketplace. Fix: LTR only for layout order; every Arabic text block inside gets explicitdirection: rtl. - The
الـ+ Latin-word trap: never place the Arabic definite-article prefix (الـ,بالـ,للـ) immediately before an isolated Latin word — the detached letters jump to the wrong side. Drop the article (عبر CLInotعبر الـ CLI) or rephrase. - Flip directional icons (arrows) in RTL contexts; a "next" arrow points left in Arabic UI.
Rule 5 — Punctuation & line breaks
- Use Arabic punctuation in Arabic sentences:
؟not?,،not,. - If a
?or،floats to the wrong side, the cause is almost always a straddling Latin token — wrap it in.ltror rephrase so the sentence doesn't break mid-clause around it. - When splitting a headline across lines, each line must continue the sentence naturally — Arabic readers read stacked lines as one flowing thought.
Rule 6 — Mobile legibility
Arabic letterforms are denser than Latin at the same px size. For social/mobile canvases (e.g. 1080px wide), keep body text ≥ ~36–40px and prefer heavier weights (600–800) for display text.
Pre-ship checklist
- No negative
letter-spacingon any Arabic-containing selector:
Every hit must be pure-Latin/numeric. If it wraps Arabic →grep -nE "letter-spacing:\s*-" file.htmlnormal. - Every Arabic element has an explicit Arabic-capable
font-family. - Display Arabic has line-height ≥ 1.3; body ≥ 1.5.
- Embedded Latin words/numbers wrapped in
.ltr; noالـ/بالـ/للـdirectly before a Latin word:grep -noE "(الـ|بالـ|للـ) ?<?[A-Za-z]" file.html - No
direction: ltrancestor leaking into Arabic text blocks. - Render and look. Screenshot the result and inspect: letters connected (not crushed, not separated), diacritics not clipped, punctuation on the correct side, word order correct.
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.

