Context
!ls readme.*.md 2>/dev/null || echo "No readme translations"
!ls .github/contributing.*.md 2>/dev/null || echo "No contributing translations"
![ -f repomatic/__init__.py ] && echo "CANONICAL_REPO" || echo "DOWNSTREAM"
![ -d repomatic/data/awesome_template ] && echo "HAS_AWESOME_TEMPLATE" || echo "NO_AWESOME_TEMPLATE"
Instructions
You synchronize translated markdown files with their English sources. The translation workflow in these repositories is documented in contributing.md § Pull-requests and issues: contributors propagate changes to all readme.*.md files using automatic translation tools, and bilingual contributors refine the result later.
This skill automates the detection side: find what drifted, show the delta, and draft updated translations for the stale sections.
Scope
In downstream awesome-* repos: Sync readme.*.md files against readme.md.
In the repomatic canonical repo: Sync contributing.*.md against contributing.md inside repomatic/data/awesome_template/.github/. The awesome-template is the source of truth for contributing guides synced to all downstream repos, so keeping its translations current benefits every downstream project.
Argument handling
$ARGUMENTScan be a language code (e.g.,zh,fr,ja) to limit the sync to one language. If empty, process all*.{lang}.mdtranslation files found.
Step 1: Discover translation pairs
Find all files matching the *.{lang}.md pattern (e.g., readme.zh.md, contributing.fr.md). For each, identify the English source by stripping the language suffix (e.g., readme.zh.md pairs with readme.md).
If context shows CANONICAL_REPO and HAS_AWESOME_TEMPLATE, look inside repomatic/data/awesome_template/.github/ instead of the repo root.
Report the discovered pairs as a table:
| English source | Translation | Language |
|---|---|---|
readme.md |
readme.zh.md |
zh |
If no translation files are found, tell the user and suggest creating one.
Step 2: Structural comparison
For each pair, compare the heading structure (all #, ##, ###, #### headings). Report:
- Heading count match — same number of headings at each level.
- Missing sections — headings present in English but absent from the translation.
- Extra sections — headings in the translation with no English counterpart (may indicate stale removed sections).
- Order alignment — whether sections appear in the same order.
Step 3: Content drift detection
For each section (delimited by headings), compare the English and translated versions:
- Link inventory — extract all URLs from both. Flag URLs present in English but missing from the translation, or vice versa. URLs should be identical (not translated).
- List item count — count bullet points and numbered items per section. A mismatch signals added or removed entries.
- Code block count — code blocks should match 1:1.
- Badge/image parity — compare
