modscode JA

modscode / Gallery / rtl-kit

rtl-kit

Right-to-left for Claude Code mods: one file to copy into a mod that orders Hebrew and Arabic right on every surface, aligns wrapped text right, draws markdown, cards, tabs, tables and SVG headers, and reorders text for the terminal

Code you can checkTerminal + desktopPaneBoxButton

What it does

  • Draws a pane
  • Adds /rtl-gallery
  • Hooks session.start

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • Has a desktop-specific branch

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like rtl-kit by Bar Moshe (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/barmoshe-rtl-kit/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the pane: open it with $.ui.open({ id: 'my-pane', title: "rtl-kit" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Button } = $.ui.resolve(e)
    const b = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row-reverse" flexWrap="wrap" gap={1} alignItems="center">
          <Button label={`${b}`} variant="primary" />
          <Button label={`${b}`} variant="primary" />
          <Button label={`${b}`} variant="primary" />
        </Box>
      </Box>
    )
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

rtl-kit/hooks/register.tsx lines 58–161 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const el = $.ui.resolve(e)
    const k = kit(el, e)
    const d = await read($, demo)
    // The theme setting is the terminal's; the desktop follows the system's colour scheme.
    const scheme = e.surface === 'terminal' ? schemeOf((await $.config.list()).find(r => r.key === 'theme')?.value) : 'auto'
    const pick = (id: string) => update($, demo, x => ({ ...x, section: id }))
    const pressed = (what: string) => update($, demo, x => ({ ...x, pressed: what }))
    const { Box, Text } = el

    let body
    if (d.section === 'text') {
      body = k.col('text', [
        k.heading('t:h', 'שורות מעורבות'),
        k.text(MIXED),
        k.text(ARABIC),
        k.heading('t:h2', 'פסקה ארוכה', 2),
        k.para('t:long', LONG),
        k.heading('t:h3', 'כפתורים', 2),
        k.row('t:btns', [
          k.primary('t:primary', 'פעולה ראשית', () => pressed('primary')),
          k.action('t:action', 'לבקש מ-Claude', () => pressed('action')),
          k.quiet('t:quiet', 'ביטול', () => pressed('quiet')),
        ]),
        d.pressed ? k.muted('t:pressed', `נלחץ: ${d.pressed}`) : null,
      ])
    } else if (d.section === 'parts') {
      body = k.col('parts', [
        k.row('p:stats', [
          k.stat('p:s1', 3, 'בקשות ממתינות', 'warn'),
          k.stat('p:s2', 9, 'הזמנות היום', 'info'),
          k.stat('p:s3', 2, 'באיחור', 'bad'),
        ]),
        k.card('p:card', {
          title: 'חדר 4 · יום שני 5.10 · 10:00–12:00',
          meta: 'בקשה של מטפלת לדוגמה. מתנגשת עם הזמנה אחת קיימת.',
          tone: 'warn',
          actions: [
            k.primary('p:approve', 'לאשר', () => pressed('approve')),
            k.action('p:decline', 'לדחות', () => pressed('decline')),
          ],
        }, [k.chips('p:chips', [{ label: 'בקשה', tone: 'warn' }, { label: 'מייל לשוכר', tone: 'info' }])]),
        k.card('p:card2', { title: 'כרטיס שקט', meta: 'גבול עדין, ומודגש במעבר עכבר.' }),
        k.heading('p:list', 'רשימה', 2),
        k.list('p:l', ['פריט ראשון', { text: 'פריט מקונן עם Claude', depth: 1 }, 'פריט שלישי ארוך מספיק כדי לעבור שורה ולהראות שהשורה השנייה מיושרת לימין גם היא']),
        k.heading('p:items', 'שורות ללחיצה', 2),
        k.item('p:i1', 'הכנת שישי', () => pressed('item 1'), 'שבעה שלבים · נשמר להיום'),
        k.item('p:i2', 'קביעת תור', () => pressed('item 2'), 'workflows/booking.md'),
        k.heading('p:table', 'טבלה', 2),
        k.table('p:t', ['שירות', 'מחיר', 'הערות'], [['טיפול לדוגמה', '100 ₪', 'כולל מע"מ'], ['ייעוץ', '180 ₪', 'הערה ארוכה שעוברת שורה בתוך התא']], { widths: [40, 20, 40] }),
        d.pressed ? k.muted('p:pressed', `נלחץ: ${d.pressed}`) : null,
      ])
    } else if (d.section === 'md') {
      body = k.md('md', SAMPLE_MD)
    } else if (d.section === 'svg') {
      if (k.isTerminal) {
        body = k.para('svg:none', 'בטרמינל אין SVG: הכותרת והציר נשארים לחלונית בדסקטופ.')
      } else {
        const head = svgHeader({
          title: 'חדרים · יום שני 5.10', subtitle: '3 בקשות ממתינות · 9 הזמנות · ניסוי', scheme, width: k.svgWidth,
          chips: [{ label: '3 ממתינות', tone: 'warn' }, { label: '9 היום', tone: 'info' }, { label: '1 התנגשות', tone: 'bad' }],
        })
        const day = svgTimeline({
          scheme, width: k.svgWidth, from: 8, to: 21, now: '13:20',
          lanes: [{ id: 'r1', label: 'חדר 1' }, { id: 'r2', label: 'חדר 2' }, { id: 'r4', label: 'חדר 4' }, { id: 'hall', label: 'החלל הקהילתי' }],
          blocks: [
            { lane: 'r1', start: '09:00', end: '11:00', label: 'מטפלת א', tone: 'info' },
            { lane: 'r2', start: '13:00', end: '14:00', label: 'מטפל ב', tone: 'info' },
            { lane: 'r4', start: '10:00', end: '12:00', label: 'בקשה', tone: 'warn' },
            { lane: 'r4', start: '16:00', end: '18:00', label: 'סגור: ניקיון', tone: 'muted' },
            { lane: 'hall', start: '16:00', end: '20:00', label: 'קהילתי', tone: 'ok' },
          ],
        })
        body = k.col('svg', [
          k.svg('svg:head', head, 'כותרת: חדרים, יום שני'),
          <Box key="svg:gap" height={1} />,
          k.svg('svg:day', day, 'ציר זמן של החדרים היום'),
          k.muted('svg:scheme', `ערכת צבעים: ${scheme} (לפי ערכת הצבעים של המערכת)`),
        ])
      }
    } else if (d.section === 'terminal') {
      const lines = [MIXED, ARABIC, 'סוגריים (בתוך) משפט · 10:00–12:00']
      body = k.col('term', [
        k.para('term:what', 'כך נשלח לטרמינל: הסדר החזותי מחושב, כי הטרמינל מדפיס תווים לפי הסדר השמור. כאן זה מוצג בדיוק כפי שהטרמינל ידפיס, ובטרמינל זה ייקרא נכון.'),
        ...lines.map((l, i) => <Text key={`term:${i}`}>{k.isTerminal ? visual(l) : asStored(visual(l))}</Text>),
      ])
    } else {
      const ruler = (n: number) => Array.from({ length: n }, (_, i) => String((i + 1) % 10)).join('')
      body = k.col('ruler', [
        k.para('r:what', `bodyColumns ${k.cols} · רוחב השבירה ${k.width} תווים. השורה הארוכה ביותר שלא נשברת היא היחס הנכון.`),
        <Text key="r:w">{ruler(k.width)}</Text>,
        <Text key="r:c">{ruler(k.cols)}</Text>,
        <Text key="r:c11">{ruler(Math.round(k.cols * 1.1))}</Text>,
        <Text key="r:he">{k.bidi('א'.repeat(k.cols))}</Text>,
      ])
    }

    return (
      <Box flexDirection="column">
        {k.tabs('tabs', SECTIONS, d.section, pick)}
        {body}
      </Box>
    )
  })
rtl-kit/hooks/rtl.tsx lines 480–483 · Pane
  const tabs = (key: string, items: { id: string; label: string }[], current: string, onPick: (id: string) => unknown) =>
    row(key, items.map(t => (t.id === current
      ? <Button key={`${key}:${t.id}`} label={b(t.label)} variant="primary" onPress={run(() => onPick(t.id))} />
      : <Button key={`${key}:${t.id}`} label={b(t.label)} plain onPress={run(() => onPick(t.id))} />)), { marginBottom: 1 })
rtl-kit/hooks/rtl.tsx lines 431–433 · Pane
  const row = (key: string, children: Node[], props: Record<string, unknown> = {}) => (
    <Box key={key} flexDirection="row-reverse" flexWrap="wrap" gap={1} alignItems="center" {...props}>{children}</Box>
  )
Licence text (MIT)
MIT License

Copyright (c) 2026 Bar Moshe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

What its code calls

nothing found

What its code shows

Read from the source at commit 6dfc1a31dd4f on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.rtl-kit/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.2 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs
Reads and sendsWhether it both reads files or environment variables and reaches the network.reaches no network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add barmoshe/bar-mods
/plugin install rtl-kit@bar-mods

This installs the marketplace's latest commit, which may not be the one read here (6dfc1a31dd4f). Compare them before you install.

Ask Claude about it

With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:

Read the modscode design "barmoshe-rtl-kit" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs