audit-rtl
Find LTR-only Tailwind classes (ml-, mr-, pl-, pr-, left-, right-, text-left, text-right) in JSX files. These break the Arabic-first layout. Use after editing pages and before /complete-session.
SKILL.md.claude/skills/audit-rtl/SKILL.md
GitHubaudit-rtl
The app is RTL-first. Any directional class that uses left/right instead of logical start/end will visually break for Arabic users.
Forbidden patterns
| Use this | Not this |
|---|---|
ms-2 |
ml-2 |
me-4 |
mr-4 |
ps-3 |
pl-3 |
pe-6 |
pr-6 |
start-0 |
left-0 |
end-2 |
right-2 |
text-start |
text-left |
text-end |
text-right |
border-s |
border-l |
border-e |
border-r |
rounded-s-md |
rounded-l-md |
rounded-e-md |
rounded-r-md |
Steps
- Grep
apps/web/src/for each forbidden pattern in.tsxand.tsfiles. Use a single combined regex if possible. - Filter out false positives:
- Inside
// rtl-okcomment annotations (rare opt-out) - Inside CSS variables / arbitrary values that don't refer to direction
- Inside imported third-party components we can't change
- Inside
- Group by file with line numbers.
- Report as a table — file, line, current class, suggested replacement.
- Offer to fix — apply replacements one file at a time, asking the user to approve the first one as a sanity check, then batch the rest.
Verification
- All
.tsxfiles scanned - False positives filtered
- Replacements proposed (not applied without permission)
Anti-patterns
- Don't blindly replace all occurrences —
text-rightinside adir="ltr"block (e.g. an English-only admin panel) is intentional - Don't replace classes inside
node_modules - Don't change
right/leftin inline JS logic (those are computed values, not Tailwind classes)