open-index/open-npm huggingface dataset:
npm package: @rtl-first/audit
Description: Scan any project for RTL readiness across all 5 layers
Author: Mohammad AlShammari
Latest version: 0.1.0

# @rtl-first/audit

Scan any project for RTL readiness across the [five layers of RTL support](../../docs/for-contributors/methodology.md).

## Usage

```bash
npx @rtl-first/audit ./my-project
```

## What it checks

| Layer | What it scans | How |
|-------|--------------|-----|
| **1 — Text engine** | Rich-text editors (ProseMirror, Slate, etc.) | Checks package.json dependencies |
| **2 — Direction logic** | `dir="rtl"`, DirectionProvider | Scans .ts/.tsx/.html files |
| **3 — CSS layout** | Physical CSS properties | Counts margin-left, padding-right, etc. |
| **4 — Translations** | ar.json existence and completeness | Compares with en.json |
| **5 — Hardcoded text** | English strings in JSX | Scans .tsx/.jsx files |

## Output

```
RTL Audit Report — my-project
═══════════════════════════════════════

Layer 1 — Text engine         ✅ No rich-text editor detected
Layer 2 — Direction logic     ❌ No dir="rtl" on document root
Layer 3 — CSS layout          ⚠️  423 files use physical properties
Layer 4 — Translations        ⚠️  ar.json not found (en.json: 1,660 keys)
Layer 5 — Hardcoded text      ❌ 89 hardcoded English strings in JSX

RTL Readiness Score: 12/100
```

## Output formats

```bash
npx @rtl-first/audit ./project                    # Terminal (default)
npx @rtl-first/audit ./project --format json       # JSON (for CI/CD)
npx @rtl-first/audit ./project --format markdown   # Markdown (for issues)
```

## Zero dependencies

This tool has no external dependencies. It uses only Node.js built-in modules.

## License

MIT
npm package: @rtl-first/contributor-agent
Description: AI-powered agent that generates RTL contribution plans, issue templates, and PR descriptions from audit results
Author: Mohammad AlShammari
Latest version: 0.1.0

# @rtl-first/contributor-agent

AI-powered agent that generates contribution plans, GitHub issue templates, and PR descriptions from RTL audit results. Part of the [rtl-first](https://github.com/imohad/rtl-first) framework.

## How it works

1. Run `@rtl-first/audit` on a project to get a JSON report
2. Feed the report to `@rtl-first/contributor-agent`
3. Get a ready-to-use issue template, ordered PR descriptions, and a week-by-week strategy

## Usage

```bash
# Step 1: Audit the project
npx @rtl-first/audit ./dify --format json > dify-audit.json

# Step 2: Generate contribution plan
npx @rtl-first/contributor-agent dify-audit.json

# Step 3: Export as files (issue + PR descriptions)
npx @rtl-first/contributor-agent dify-audit.json --output ./contribution-plan
```

## Two modes

### Template mode (default, no API key needed)

Uses built-in templates to generate structured issue and PR descriptions. Works offline, instant results.

### AI mode (with Claude API key)

Set `ANTHROPIC_API_KEY` or pass `--api-key` to get an AI-enhanced strategy recommendation on top of the templates.

```bash
ANTHROPIC_API_KEY=sk-ant-... npx @rtl-first/contributor-agent dify-audit.json
```

## What it generates

### GitHub Issue

A complete issue body with:
- RTL audit summary table
- What's working vs what needs improvement
- Specific numbers (CSS properties, missing keys, hardcoded strings)
- Contribution proposal asking maintainers for alignment
- Suggested priority order

### PR Descriptions (ordered by priority)

1. **Translations** — complete missing Arabic keys (safest, always welcome)
2. **Hardcoded strings** — replace with i18n keys (small PRs, build trust)
3. **CSS codemod** — submit script, not changed files (reviewable)
4. **Direction logic** — add `dir="rtl"` and DirectionProvider (architectural)

Each PR includes: title, body, risk level, and affected files.

### Week-by-week Strategy

```
Now      Open an issue with the audit report
Week 1   Complete Arabic translations
Week 1   Fix hardcoded strings (3-5 files per PR)
Week 2   Submit CSS codemod as a script
Week 3   Add direction detection
```

## Output formats

```bash
# Terminal (default)
npx @rtl-first/contributor-agent audit.json

# JSON
npx @rtl-first/contributor-agent audit.json --format json

# Export files
npx @rtl-first/contributor-agent audit.json --output ./plan
# Creates: ISSUE.md, PR-1-*.md, PR-2-*.md, ..., plan.json
```

## Zero dependencies

No external dependencies. Claude API is optional (for AI-enhanced mode only).

## License

MIT
npm package: @rtl-first/translation-kit
Description: Find missing translation keys and hardcoded strings for RTL localization
Author: Mohammad AlShammari
Latest version: 0.1.0

# @rtl-first/translation-kit

Find missing translation keys and generate ready-to-translate files. Part of the [rtl-first](https://github.com/imohad/rtl-first) framework.

## Usage

```bash
# Auto-detect locale files in a project
npx @rtl-first/translation-kit ./my-project

# Compare specific locale files
npx @rtl-first/translation-kit --source en.json --target ar.json

# Compare locale folders (Next.js / Dify style)
npx @rtl-first/translation-kit --source i18n/en-US --target i18n/ar-TN

# Export missing keys as JSON (ready for translators)
npx @rtl-first/translation-kit --source en.json --target ar.json --output missing.json
```

## What it does

1. **Compares locale files** — finds keys in the source that are missing in the target
2. **Supports nested JSON** — flattens keys with dot-notation for accurate comparison
3. **Supports folder-based locales** — compares `en-US/*.json` vs `ar-TN/*.json` file by file
4. **Auto-detects i18n structure** — scans a project and finds locale files automatically
5. **Exports missing keys** — generates a JSON file with source values, ready for translation

## Output

```
Translation Gap Report
──────────────────────────

Source: en-US
Target: ar-TN

Total keys:   4,865
Translated:   4,803
Missing:      62
Coverage:     98.7%

Files with gaps:
  ███████████████░  common.json (38 missing)
  ██████████████░░  workflow.json (11 missing)
  ██████████████░░  plugin.json (8 missing)
  ███████████████░  app-debug.json (5 missing)

Sample missing keys:
  − common.operation.search.find_and_replace_in_page [common.json]
    "Find and Replace in Page"
  − workflow.nodes.parameterExtractor.extractParameters [workflow.json]
    "Extract Parameters"
```

## Export for translators

```bash
npx @rtl-first/translation-kit \
  --source i18n/en-US \
  --target i18n/ar-TN \
  --output missing-keys.json
```

This generates a `missing-keys.json` file with the source text, ready to hand off to a translator:

```json
{
  "common": {
    "operation": {
      "search": {
        "find_and_replace_in_page": "Find and Replace in Page"
      }
    }
  }
}
```

## Zero dependencies

Node.js >= 18 only.

## License

MIT