| name | hebrew-rtl |
| description | Apply RTL Hebrew rules when generating ANY document containing Hebrew text. Use alongside pptx-generator, minimax-docx, minimax-xlsx, minimax-pdf, or any HTML/web output. Fixes BiDi confusion, wrong punctuation, reversed parentheses, layout mirroring, and comma placement errors. Triggers: Hebrew, ืขืืจืืช, RTL, right-to-left, rtl document, Hebrew presentation, Hebrew Word doc, Hebrew Excel, Hebrew PDF, Hebrew slides, ืืฉืจืื, ืขืืจื.
|
| license | MIT |
| metadata | {"version":"1.0.0","category":"localization"} |
Hebrew RTL โ Document Generation Rules
ALWAYS use this skill alongside the relevant document skill (pptx-generator, minimax-docx, etc.).
The 8 Rules (All Formats)
Rule 1 โ Set RTL at document level
Every format has a top-level RTL switch. Set it first, before any content.
Rule 2 โ RTL on EVERY text element
Do NOT assume inheritance. Explicitly set rtlMode, lang: "he-IL", align: "right" on each element individually.
Rule 3 โ Use a helper function
Wrap all RTL settings in a reusable function. Never set them manually per element โ you will miss some.
Rule 4 โ Rich text arrays โ RTL per item
When building arrays of text runs, each item needs its own RTL flag, not just the container.
Rule 5 โ Mirror layout elements
Page numbers โ LEFT side. Accent borders โ LEFT side. Badges โ LEFT side. Everything flips horizontally.
Rule 6 โ Hebrew punctuation
- Use
ืณ (U+05F3 geresh) not apostrophe '
- Use
ืด (U+05F4 gershayim) not double-quote "
- Use
โ (U+2014 em-dash) not hyphen -
Rule 7 โ Natural comma placement
- Correct:
ืืืขืช, ืืืืื ืืืืฆืืจ
- Wrong:
ืืืขืช ,ืืืืื
Comma goes AFTER the word, not before the next one.
Rule 8 โ Test with real mixed content
Always verify with: Hebrew + numbers + English words + punctuation together.
Format-Specific Implementation
PptxGenJS (pptx-generator skill)
pres.rtlMode = true;
function rtl(opts) {
return {
...opts,
fontFace: "Arial",
rtlMode: true,
lang: "he-IL"
};
}
slide.addText("ืืงืกื ืืขืืจืืช", rtl({
x: 0, y: 0, w: 9, h: 1,
fontSize: 14,
align: "right"
}));
slide.addShape(pres.shapes.OVAL, {
x: 0.3, y: 5.1, w: 0.4, h: 0.4,
fill: { color: theme.accent }
});
python-docx (minimax-docx skill)
from docx.oxml.ns import nsdecls
from docx.oxml import parse_xml
from docx.enum.text import WD_ALIGN_PARAGRAPH
def set_rtl(paragraph):
"""Apply RTL to a paragraph โ call on EVERY paragraph."""
pPr = paragraph._p.get_or_add_pPr()
bidi = parse_xml(f'<w:bidi {nsdecls("w")} val="1"/>')
pPr.append(bidi)
paragraph.alignment = WD_ALIGN_PARAGRAPH.RIGHT
p = doc.add_paragraph()
set_rtl(p)
run = p.add_run("ืืงืกื ืืขืืจืืช")
run.font.name = "David"
HTML/CSS
<html lang="he" dir="rtl">
<body>
<style>
body {
direction: rtl;
text-align: right;
font-family: 'Heebo', 'Arial', sans-serif;
}
pre, code {
direction: ltr;
text-align: left;
}
</style>
ReportLab / minimax-pdf
from reportlab.lib.enums import TA_RIGHT
from reportlab.lib.styles import getSampleStyleSheet
styles = getSampleStyleSheet()
hebrew_style = styles['Normal'].clone('Hebrew')
hebrew_style.alignment = TA_RIGHT
hebrew_style.fontName = 'Helvetica'
from reportlab.platypus import Paragraph
p = Paragraph("ืืงืกื ืืขืืจืืช", hebrew_style)
Punctuation Cheat Sheet
| Instead of | Use | Unicode | Example |
|---|
' apostrophe | ืณ geresh | U+05F3 | ืืณื, ืคืืณื |
" double-quote | ืด gershayim | U+05F4 | ืฆืืดื, ืจืืดื |
- hyphen | โ em-dash | U+2014 | ืืดื ื โ ืืืื |
, wrong side | , after word | โ | ืืืขืช, ืืืืื |
Common Failure Modes to Watch For
| Symptom | Cause | Fix |
|---|
| Numbers appear on wrong side | BiDi not set at document level | Rule 1 |
| Parentheses reversed | No per-element RTL | Rule 2 |
| Page number on right | Layout not mirrored | Rule 5 |
| ืฆื"ื looks broken | ASCII quotes instead of gershayim | Rule 6 |
,ืืืื (space before comma) | Wrong comma placement | Rule 7 |
| English inside Hebrew flips | Wrap in <span dir="ltr"> in HTML, or use BiDi marks in other formats | Rule 8 |