/persian-writing:persian-writingfrom persian-writing
Writes natural Persian (Farsi) prose and builds correct RTL deliverables across Word, PDF, PowerPoint, HTML, Excel, images, email, and social posts. Covers register detection, AI-tell removal, orthography (ZWNJ, Persian digits, guillemets), spell-check, and RTL layout fixes with bundled Vazirmatn font.
Ships in persian-writing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Two failure modes make Persian output look machine-made, and they are independent:
Fixing one without the other still produces something a native reader screenshots and laughs at. This skill fixes both. Work through the two checklists below, and read the reference file for your output format before generating anything.
| Task | Read |
|---|---|
| Any Persian prose (always) | references/writing-style.md |
| Mechanical correctness (always) | references/orthography.md |
| Academic: paper, thesis, report, مقاله/پایاننامه | references/academic.md |
| Educational/technical content, docs, product pages, how-to | references/content-structures.md |
| Telegram, Instagram, captions, carousels, reels, stories | references/social-channels.md |
| SEO content, blog for search, landing/ad copy, کپشن فروش | references/seo-copywriting.md |
| Cleanup/normalize/spell-check existing text (ویرایش، پاکسازی) | references/cleanup/paknevis-rules.md + usage-patterns.md |
| Choosing/embedding fonts | references/fonts.md |
| Word/.docx or docx→PDF | references/docx-pdf.md |
| PowerPoint/.pptx | references/pptx.md |
| HTML, email templates, HTML→PDF | references/html-css.md |
| Images/posters (PIL), new PDFs (reportlab), Excel | references/format-skills-fa.md |
Visual neutrality — read before copying any code example. This skill styles NOTHING. It governs direction, spacing, fonts-for-shaping and text — never colors, accent bars, card backgrounds, or a house look. Every hex, border, and fill in the code examples is a stand-in written in plain grey/black; they exist to show WHERE a property goes, not what value to use. Default output is black text on default background, no accent color. Take colors and visual form ONLY from: the user's explicit request, an attached brand/theme skill, or an input template being matched. Absent those, do not invent a palette and do not carry one over from example to example — unstyled is the correct default, and a surprise purple heading is a bug.
This skill composes with the general docx/pptx/pdf skills: those handle file mechanics; this one overrides and extends them for Persian. When both disagree about RTL behavior, this skill wins — its rules come from debugging real Persian documents. If another active skill or the user specifies particular fonts or colors, those win on aesthetics; this skill still governs RTL mechanics and orthography. This skill itself is brand-neutral: colors in the code examples are placeholders, and Vazirmatn is just the default font, not a requirement.
Full guide in references/writing-style.md. The core moves:
references/academic.md.references/seo-copywriting.md.fa_lint.py --check --rhythm
flags flat rhythm, but lexical tells matter far more — writing-style.md §3.5.
The goal is prose that is genuinely better, not prose tuned to a detector:
AI detectors are unreliable and falsely flag second-language writers at very
high rates, and this skill never helps disguise authorship (§3.6).Full rules in references/orthography.md. These apply to every deliverable:
or HTML ‌.npm install…».
For plain-text output where a line must open with a name,
persian_cleanup.py --bidi adds an invisible direction mark. Full rules:
orthography.md §9.Two scripts enforce this mechanically — use both before delivering Persian text:
# 1. FIX: paknevis-style editorial pass (ZWNJ, chars, digits, punctuation, گیومه)
python3 scripts/persian_cleanup.py --edit --in text.md --out text.md
# 2. LINT: report what still needs contextual judgment (dashes, میشود forms,
# fake tanvin, register issues) — fix these by hand
python3 scripts/fa_lint.py --check text.md
--edit is safe on structured files. Fenced code blocks, inline code and table
rows are lifted out before processing and restored byte-identical, and leading
indentation is never collapsed. This matters because Persian typography rules
are correct for prose and destructive in code: they would turn "text" into
«text», rewrite ASCII digits as Persian, and flatten the spacing a table's
columns rely on. Pass protect_code=False (Python API) only if you truly want
those rules applied everywhere. Keep the file in version control either way —
the tool is careful, not omniscient.
persian_cleanup.py is a full toolkit (paknevis + davat merged): aggressive
cleaning for NLP (--preset persian), single functions (--fn convert_digits),
spell-check against the bundled 453K-word frequency dictionary
(--edit --spellcheck), custom pipelines. Persian «ویرایش» requests → --edit
(conservative, content preserved); «پاکسازی/نرمالایز» → --preset persian
(strips links/mentions/emojis). Details: references/cleanup/. Note: --edit
applies the خانهٔ ezafe style; drop fix_ezafe from --steps to keep خانهی.
Bundled in assets/fonts/ (SIL OFL — free for commercial use):
Other families (Shabnam, Sahel, Samim, Parastoo, Tanha, Gandom) and pairing advice:
references/fonts.md. In offline sandboxes only bundled fonts exist —
scripts/download_fonts.py works only where GitHub is reachable.
Before any docx→PDF or pptx→PDF conversion, install the fonts:
bash scripts/install_fonts.sh # copies assets/fonts → ~/.fonts, runs fc-cache
fc-list | grep -i vazir # verify — else LibreOffice silently falls back
Skipping this is the #1 cause of broken Persian PDFs: conversion "succeeds" but every glyph is DejaVu tofu or disconnected letters.
Format-specific recipes live in the reference files. The universal ones:
bidirectional: true,
AlignmentType.RIGHT renders at the visual left. Always align START.rightToLeft: true + font with hint: "cs" (Complex Script).bidi: true. Tables that must flow right-to-left:
visuallyRightToLeft: true.List Number/List Bullet styles.
Their markers live in numbering.xml, which has no bidi and renders Latin
1. on the wrong side plus an OpenSymbol bullet that breaks font embedding.
Write markers as ordinary runs («۱. », «• ») — docx-pdf.md §6.1.styles.xml has no Persian font and Word's Heading styles
carry a blue color you never asked for. Run persianize_styles(doc) from
docx-pdf.md §6.1 immediately after Document(). Headers/footers are separate
XML parts and need the RTL treatment applied to them directly.keepNext + keepLines (no orphan headings);
cards/boxes go inside a single-cell table with cantSplit: true (never split
across pages); no separator after the last list item; no stray PageBreak
before a section break (blank pages).Two gates. Check the .docx BEFORE converting (catches what code review can't), then check the PDF:
# 1. DOCX: package integrity FIRST (a file Word won't open can't be RTL-checked),
# then section bidi, jc=right traps, cs fonts, list numbering, heading colors.
# --fix repairs missing <w:bidi/>; --sanitize strips the Word-for-Mac template
# artifacts python-docx inherits (the classic "file is corrupt" fingerprint).
python3 scripts/verify_docx.py output.docx --expect-font Vazirmatn --fix --sanitize
# 2. PDF: fallback fonts, blank pages, template leaks, Arabic chars
python3 scripts/verify_pdf.py output.pdf --expect-font Vazirmatn
verify_docx.py exists because setting an RTL flag and that flag reaching the
XML are different things: libraries drop bidi from section properties, and
OOXML requires <w:bidi/> to be the FIRST child of <w:sectPr> — appended
anywhere else, renderers ignore it. Verify the artifact, never the source code.
It also guards the package itself: [Content_Types].xml must be the first ZIP
entry, every relationship Target must resolve, every XML part must be
well-formed and free of control characters. Repairs are written to a temp file
and validated before replacing anything, so a failed repair can't destroy the
document. Details and the already-corrupt-file procedure: docx-pdf.md §4.5.
It checks: near-empty pages, "undefined"/template leaks, non-embedded or fallback
fonts, Arabic ي/ك in extracted text, and page count. Fix every warning, regenerate,
re-verify. For prose, re-read your final text against the native test — one pass of
persian_cleanup.py --edit + fa_lint.py --check plus one honest read-aloud
catches most disasters.
persian-writing/
├── SKILL.md ← you are here
├── references/
│ ├── writing-style.md ← registers, Persian AI tells, colloquial patterns
│ ├── academic.md ← نگارش علمی: papers, theses, citations, formulas
│ ├── orthography.md ← ZWNJ, characters, digits, punctuation, ezafe
│ ├── cleanup/ ← paknevis rules, davat API, usage patterns
│ ├── fonts.md ← catalog, personalities, pairings, embedding
│ ├── content-structures.md ← POV, education vs promotion, body patterns
│ ├── social-channels.md ← Telegram/Instagram craft, repurposing
│ ├── seo-copywriting.md ← Persian SEO writing + کپیرایتینگ
│ ├── docx-pdf.md ← RTL docx recipes, pagination, PDF post-processing
│ ├── pptx.md ← RTL PowerPoint via python-pptx / html2pptx
│ ├── html-css.md ← RTL web, mixed-direction text, print CSS
│ └── format-skills-fa.md ← PIL posters, reportlab PDFs, Excel RTL
├── scripts/
│ ├── persian_cleanup.py ← FIX: edit/clean/normalize/spell-check (paknevis+davat)
│ ├── fa_lint.py ← LINT: report issues needing contextual judgment
│ ├── verify_docx.py ← DOCX RTL checks (+ --fix for section bidi)
│ ├── verify_pdf.py ← post-generation PDF checks
│ ├── check_version.py ← verify the version matches in all four places
│ ├── install_fonts.sh ← bundled fonts → ~/.fonts (run before PDF export)
│ └── download_fonts.py ← fetch extra families (needs GitHub access)
└── assets/
├── fonts/ ← Vazirmatn + Lalezar TTFs
└── persian_words.txt ← 453K-word frequency dictionary (spell-check)
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ali2000hos/persian-writing --plugin persian-writingOther plugins' skills for the same job