Skip to content

Add pluggable language packs, starting with Arabic (v2.10.0) - #205

Open
AHMED-HOMISHAN wants to merge 1 commit into
blader:mainfrom
AHMED-HOMISHAN:feat/arabic-language-pack
Open

Add pluggable language packs, starting with Arabic (v2.10.0)#205
AHMED-HOMISHAN wants to merge 1 commit into
blader:mainfrom
AHMED-HOMISHAN:feat/arabic-language-pack

Conversation

@AHMED-HOMISHAN

Copy link
Copy Markdown

What This Adds

The 33 core patterns documented in this project currently use English examples. As a result, non-English users often have to translate text into English before applying the patterns, then translate it back—introducing the very translation artifacts the skill is designed to eliminate.

This update introduces language packs, allowing language-specific patterns to live alongside the core skill without expanding the main prompt.

SKILL.md

A new Language Packs section (approximately 20 lines) explains how language-specific support works:

  • Edit directly in the source language instead of round-tripping through English, which often produces translationese.
  • Preserve the original register, dialect, and writing style instead of "correcting" them to a standardized form—those corrections are often AI tells.
  • Follow the language's own punctuation, quotation marks, numerals, and typographic conventions.
  • Load languages/<code>.md when it exists. If no pack is available, explicitly say so rather than claiming unsupported coverage.

languages/ar.md

The first language pack implements AR1–AR14, covering Arabic-specific writing patterns that are outside the scope of the core 33 patterns. Examples include:

  • Overused endings such as "مما يعكس".
  • Passive and bloated constructions using "تم" and "قام بـ".
  • Using "حيث" as generic sentence glue.
  • Redundant paired adjectives such as "فريدة ومميزة".
  • Formulaic conclusions like "وفي الختام".
  • Borrowed English idioms such as "في نهاية اليوم" and "يلعب دوراً حاسماً".
  • Long noun chains built with إضافة.
  • Arabic punctuation and typography conventions.
  • The repetitive rhythm created by beginning every sentence with "إنّ".

The pack also documents common false positives that should not be rewritten, including quoted Qur'anic verses, hadith, poetry, proverbs, religious formulas, and deliberate سجع, as well as characteristics of naturally written Arabic that should be preserved.

Why Separate Language Files?

Embedding every language in SKILL.md would eventually make the file too large to remain practical. Language packs keep the runtime prompt compact:

  • SKILL.md remains under 500 lines.
  • Each language pack is capped at 250 lines.

Adding a new language requires only three steps:

  1. Copy languages/TEMPLATE.md to languages/<code>.md.
  2. Add one registry entry in SKILL.md.
  3. Add one language table entry in README.md.

The validator (scripts/validate-package.py) discovers language packs via glob patterns and verifies numbering automatically, so it does not need to be modified.

Core pattern numbering remains 1–33. Language-specific patterns use prefixed identifiers (for example, AR1), so the core numbering never changes.

Verification

The following checks all pass:

  • python3 scripts/validate-package.py
  • npx skills add . --list
  • claude plugin validate .

Additional verification included:

  • Introducing an intentionally broken languages/es.md to confirm the validator detects both numbering mismatches and missing registry entries.
  • Running npx skills add in a fresh project to verify that the languages/ directory is packaged alongside SKILL.md.
  • Using a separate Claude Code session with no knowledge of the test setup. It successfully loaded languages/ar.md, identified the applied AR patterns, removed Arabic-specific AI tells while preserving every numeric value, retained Gulf and Egyptian dialects instead of normalizing them to Modern Standard Arabic, and produced a byte-for-byte identical result when no changes were necessary.

Documentation

README.md now includes:

  • A Language Packs section describing the AR1–AR14 pattern set.
  • A version history entry for this release.

The version number has been updated to 2.10.0 in:

  • SKILL.md
  • README.md
  • plugin.json

The 33 patterns are documented with English examples, so non-English text
was only ever handled by analogy. This adds language behavior to the core
skill and moves language-specific tells into loadable packs.

SKILL.md gains a small LANGUAGE PACKS section: edit in the source language
rather than round-tripping through English, match the source register and
variety instead of normalizing dialects to the standard form, use the
language's own punctuation and numerals, and load languages/<code>.md when
one exists. Behavior degrades to those neutral rules when no pack is
available, and the skill says so rather than claiming full coverage.

First pack: languages/ar.md, patterns AR1-AR14. It covers the tells that
patterns 1-33 do not describe in Arabic, including "mimma yaakis" analysis
tails, "tamma"/"qama bi" bloat, "haythu" as universal glue, doubled
synonyms, sermon-like endings, calqued idiom, noun-chain constructs,
Arabic punctuation and stray tashkeel, and uniform "inna"-led rhythm. It
also lists Arabic false positives so quoted scripture, poetry, proverbs,
religious formulas, and deliberate rhymed prose are never rewritten.

Adding a language is now a drop-in: copy languages/TEMPLATE.md, add one
registry row to SKILL.md and one table to README.md. validate-package.py
discovers packs by glob and checks each pack's frontmatter range against
its headings, its registry row, and its README table, so new languages
need no validator change. SKILL.md is back under the 500-line budget with
packs capped at 250 lines each.

Verified: the skills CLI ships languages/ alongside SKILL.md on install,
and a separate Claude Code session loaded languages/ar.md, cited the AR
pattern numbers it applied, preserved Gulf and Egyptian dialect, and left
an untouched human paragraph byte-identical.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant