agentleFS
aniq-ui-proaniq-ui-pro/agent-skills/skills/rtl-check/SKILL.md

rtl-check

Skill1 starsChanged 2 days agoMITView on GitHub

Finds and fixes left/right styling that breaks Arabic, Hebrew, Persian or Urdu (right-to-left) pages in a Next.js App Router project with Tailwind CSS or plain CSS. Use after adding an RTL locale, after any UI change in an app that ships one, or when Arabic pages show spacing, borders, arrows or panels on the wrong side.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check: it ends with a Summary: line.

    line 21
  2. Very specific:

    Fix the layout first: if it says FAIL. Render <html lang={locale} dir={dir}> in the layout that owns <html> (usually …

    line 23
  3. Very specific:

    Check: run step 1 again; the Layout line says ok.

    line 28
  4. Very specific:

    Check: run step 1 again; To fix: 0.

    line 33
  5. Distinctive:

    Check: run step 1 again; every remaining review line is something you chose to keep.

    line 41
  6. Distinctive:

    Check: run step 1 again; those lines are gone from the report.

    line 46
  7. Very specific:

    Check: grep -rn 'type="tel"\|type="email"' src and confirm each field has dir="ltr".

    line 50
  8. Very specific:

    Check: the tag contains dir="rtl" and lang="ar" in the server HTML.

    line 54
  9. Distinctive:

    Check: all exit with code 0.

    line 57
  10. Very specific:

    Add to .claude/settings.json, with the path where this skill lives:

    line 61
  11. Very specific:

    Check: /hooks lists it; ask for a test edit with ml-2 and the report appears.

    line 80

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

rtl-check

scripts/rtl-check.mjs (Node 20+, no dependencies) reports:

  • Layout: whether the layout that renders <html> sets dir from the locale on the server.
  • To fix: physical classes and properties, each with its logical replacement (ml-2 -> ms-2, text-left -> text-start, border-r -> border-e, margin-left -> margin-inline-start).
  • To review: things that may need an rtl: version (arrows, translate-x, gradients, transform origins, rtl:flex-row-reverse).

Steps

  1. Run the check on the app folders (not the API): node ${CLAUDE_SKILL_DIR}/scripts/rtl-check.mjs src (in a monorepo, list each app: ... apps/web apps/admin). Check: it ends with a Summary: line. Exit code 0 means nothing to fix.
  2. Fix the layout first if it says FAIL. Render <html lang={locale} dir={dir}> in the layout that owns <html> (usually app/[locale]/layout.tsx), with dir computed on the server from the locale. Do not set dir in useEffect, and do not put it on <body> or a wrapper <div>. If <html> must stay in a root layout above [locale], an inline <script> in that layout may set lang and dir from the first path segment. Check: run step 1 again; the Layout line says ok.
  3. Apply every "To fix" line with the replacement it prints. Keep mx-*, px-*, inset-x-* and left-1/2 -translate-x-1/2 (they are symmetric). Never add flex-row-reverse for Arabic: flex and grid already follow dir. Check: run step 1 again; To fix: 0.
  4. Decide each "To review" line. Arrows and chevrons that mean next/back get rtl:rotate-180 (or rtl:-scale-x-100). Motion that follows reading order gets an rtl: counterpart (group-hover:translate-x-1 rtl:group-hover:-translate-x-1). Remove rtl:flex-row-reverse. On Tailwind CSS 3, space-x-* and divide-x-* use left and right sides and need rtl:space-x-reverse / rtl:divide-x-reverse; from Tailwind CSS 4 they follow dir and need nothing. Check: run step 1 again; every remaining review line is something you chose to keep.
  5. Mark what is physical on purpose. A before/after slider, a map popup, a progress bar animated by a library, or tabs whose order is already reversed in code: put a comment containing rtl-check-ignore and the reason on the line above. Check: run step 1 again; those lines are gone from the report.
  6. Keep left-to-right content left to right. Prices, phone numbers, emails, order references and code get <bdi dir="ltr"> (inline) or dir="ltr" (inputs and blocks). Check: grep -rn 'type="tel"\|type="email"' src and confirm each field has dir="ltr".
  7. Check the real page. With the dev server running, request an Arabic page: curl -s http://localhost:<port>/ar | grep -o '<html[^>]*>' Check: the tag contains dir="rtl" and lang="ar" in the server HTML.
  8. Run the project's own checks (lint, typecheck, build). Check: all exit with code 0.

Run it after every edit (optional)

Add to .claude/settings.json, with the path where this skill lives:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          { "type": "command", "command": "node \"$CLAUDE_PROJECT_DIR\"/.claude/skills/rtl-check/scripts/rtl-check.mjs --hook" }
        ]
      }
    ]
  }
}

The hook checks only the edited file. When it finds something it exits with code 2, and Claude Code shows its report to Claude, which fixes the line in its next step. Check: /hooks lists it; ask for a test edit with ml-2 and the report appears.

Options: --json, --no-review, --ignore <text> (skip paths containing the text).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.