translate-sync
Skill15 starsChanged 5 months agoMITView on GitHub
Synchronize content from English across all active languages. Use proactively when content needs multilingual synchronization.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- public/llms-full.txtllms.txt
- public/llms.txtllms.txt
- add-componentSkill
- add-diagram-componentSkill
- add-languageSkill
- add-pageSkill
- ai-diff-reviewerSkill
- dailybotSkill
- deepworkplanSkill
- doc-editSkill
- fix-lintSkill
- git-commit-pushSkill
- pr-review-liteSkill
- quick-fixSkill
- refactor-safeSkill
- responsive-lighthouse-auditSkill
- security-checkSkill
- type-fixSkill
- update-stylesSkill
- write-testsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 10 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Does NOT create new pages from scratch (use add-page)
- Distinctive: line 25
Does NOT modify the translation system architecture
- Very specific: line 26
Does NOT add new languages to src/lib/i18n.ts (only syncs existing active languages)
- Very specific: line 27
Does NOT change Content Collection schemas or content.config.ts
- Distinctive: line 88
Use natural, idiomatic translations (not literal word-for-word)
- Distinctive: line 90
Do NOT translate code blocks, terminal commands, or technical identifiers
- Distinctive: line 97
When syncing a page, verify both the wrapper and the shared component exist
- Distinctive: line 101
Add the missing translations maintaining the same nested structure
- Very specific: line 102
Ensure both en.ts and es.ts export objects with identical key structures
- Very specific: line 103
Update src/lib/translations/types.ts if new interface fields are needed
- Very specific: line 104
Quote safety: use ONLY straight ASCII single quotes ' as string delimiters — never curly/typographic quotes (‘ ’ “ ”), which break the …
- Distinctive: line 190
Use natural, idiomatic translations (not literal)
- Distinctive: line 192
Use informal-professional register for Spanish (Colombian Spanish phrasing, consistent with site voice)
- Distinctive: line 194
CRITICAL — Spanish orthography: ALL Spanish text MUST use correct diacritical marks (ñ, á, é, í, ó, ú).
- Distinctive: line 198
Stop and ask if:
- Distinctive: line 255
Update English page content to match Spanish changes
- Very specific: line 256
Ensure lang = 'en' in target
- Very specific: line 273
Add missing translations to es.ts
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Translate Sync
Objective
Synchronize content from English (en) across all active languages — pages, methodology/spec/kit docs, and translation strings. Ensures multilingual parity across the entire site. (The site is N-language ready; to add a brand-new locale use the add-language skill.)
Non-Goals
- Does NOT create new pages from scratch (use
add-page) - Does NOT modify the translation system architecture
- Does NOT add new languages to
src/lib/i18n.ts(only syncs existing active languages) - Does NOT change Content Collection schemas or
content.config.ts
Tier Classification
Tier: 1 - Light/Cheap
Reasoning: Translation follows established patterns, is content-focused, and has low risk. The source content already exists; this skill produces the counterpart.
Inputs
Required Parameters
$SOURCE_FILE: The file that was recently created or modified (en or es version)
Optional Parameters
$TARGET_LANG: Target language to sync to (default: auto-detect the opposite language from source path)$CONTENT_TYPE: Type of content:page,content-doc(methodology/spec/kit),translation-strings(default: auto-detect from file path)
Prerequisites
- Source file exists and is valid
- For content docs: understand the relevant Content Collection schema in
content.config.ts - For translation strings: understand
src/lib/translations/modular structure
Steps
Step 1: Detect Source Language and Content Type
Determine the source language and content type from the file path. The site ships 17 active languages today (en, es, pt, zh, ja, de, fr, ko, ru, it, tr, id, vi, hi, pl, uk, th); <lang> below is any of those codes:
| Path Pattern | Language | Content Type |
src/content/{methodology,spec,kit}/<lang>/** | the matching lang | content-doc |
src/content/pages/<lang>/** | the matching lang | content-doc (page .md) |
src/lib/translations/<lang>.ts | the matching lang | translation-strings |
Page wrappers under src/pages/ are NOT translated content — they are 3-line routing shells. The default-language wrapper lives at src/pages/<name>.astro and the single dynamic wrapper at src/pages/[lang]/<name>.astro covers every other active language. Page wrappers do not need per-language duplication for translation.
Step 2: Find or Create Target File(s)
Translation fans out from the source to every other active language (not just one target). Use src/lib/i18n.ts getActiveLanguages() as the source of truth.
Map source to target paths:
| Source | Targets |
src/content/{collection}/<src-lang>/{slug}.md | src/content/{collection}/<other-lang>/{slug}.md for every active <other-lang> |
src/lib/translations/<src-lang>.ts | every other src/lib/translations/<other-lang>.ts (preserve interface shape from types.ts) |
When invoked for a single content change, prioritize the source-lang → en path first (if the source isn't English), then en → all other active languages, so the canonical English version is correct before downstream propagation. If a target file does not exist, create it using the source as the template; if it exists, update it to match the source structure.
Translation strings ↔ Markdown endpoints: a rendered page and its src/content/pages/<lang>/<page>.md mirror are two views of one surface — the page renders from src/lib/translations/<lang>.ts, the endpoint mirrors it for agents. When a change originates in a <lang>.ts file (for example a faqPage item edit or insertion), update the matching endpoint by deriving it from the already-edited ts file — read the final ts strings and write the endpoint sections to match — rather than translating the markdown in parallel. Derivation guarantees md↔ts parity by construction; parallel translation invites drift. For edits to existing endpoint text, recover the pre-edit version with git show HEAD:<endpoint> and apply a longest-common prefix/suffix diff so only the true delta changes. Match the endpoint's own bytes for locale quirks (for example, the tr endpoint historically uses ASCII ' where the ts uses ’). Verify with pnpm run md:check and pnpm run md:content-check.
Step 3: Translate Content
Translate the content following these rules:
For content docs (methodology / spec / kit / page .md):
- Translate:
title,description, and body content - Preserve exactly:
order,lang(set to the target language), structural frontmatter fields, code blocks - Use natural, idiomatic translations (not literal word-for-word)
- Preserve all markdown formatting, headings, lists, links
- Do NOT translate code blocks, terminal commands, or technical identifiers
- Direct quotes in English: When translating to Spanish and the content includes a direct quote originally in English, keep the original English text in italics and add a Spanish translation in parentheses immediately after. Example: "Express my will to my agents." ("Expresar mi voluntad a mis agentes.")
For page wrappers (.astro in src/pages/):
- Pages use the Page wrapper pattern: thin 3-line wrappers that import a shared
*Page.astrocomponent - Set the correct
langstring literal:lang="en"orlang="es" - The shared component in
src/components/pages/handlesMainLayout, translations, and content internally - When syncing a page, verify both the wrapper and the shared component exist
For translation strings (en.ts/es.ts):
- Find keys that exist in one locale file but not the other
- Add the missing translations maintaining the same nested structure
- Ensure both
en.tsandes.tsexport objects with identical key structures - Update
src/lib/translations/types.tsif new interface fields are needed - Quote safety: use ONLY straight ASCII single quotes
'as string delimiters — never curly/typographic quotes (‘ ’ “ ”), which break the build. Escape inner apostrophes as\'(e.g.'d\'installer'). Runpnpm run biome:checkafter; aparseerror means a stray curly delimiter slipped in.
Step 4: Validate Synchronization
# Check both files exist
ls -la {source_file} {target_file}
# Run code quality checks
pnpm run biome:check
pnpm run astro:check
pnpm run buildStep 5: Prove currency, not just existence (all 17 languages)
pnpm run i18n:check proves that every file exists and uses the right script.
It does not prove that a translation carries the current English content: in
PLAN_020 four kit command pages passed it while 8–14 languages still held the
pre-v7 text. After an English change, check every language against English:
# Same number of ##/### headings as English (a missing section is a stale translation)
python3 - <<'PY'
import glob, os, re
for en in glob.glob('src/content/<collection>/en/*'):
h = len(re.findall(r'^#{2,3} ', open(en).read(), re.M))
for f in glob.glob(en.replace('/en/', '/*/')):
n = len(re.findall(r'^#{2,3} ', open(f).read(), re.M))
if n != h: print(f, n, 'vs en', h)
PYAlso confirm that each language's file changed in the same commit range as the
English edit (git diff --numstat <base>..HEAD -- src/content/<collection>).
The frontmatter description must stay within 130–160 characters (60–90 for zh/ja/ko).
Fan-out for large syncs (Claude Code)
For a change that touches many files in all 16 non-English languages, commit the
English change first, then give one helper agent four languages each (for
example es/pt/fr/it, de/ru/uk/pl, zh/ja/ko/th, tr/id/vi/hi). Each helper applies
git show <en-commit> to its own language folders only. The lead reviews the
helpers' self-checks, reruns the checks above, commits, and owns the result.
Output Format
Success Output
## Translation Sync Complete
### Source
- File: {source_file}
- Language: {en|es}
- Type: {page|content-doc|translation-strings}
### Target
- File: {target_file}
- Language: {en|es}
- Action: {created|updated}
### Changes
- {list of specific changes made}
### Validation
- Biome check: {pass/fail}
- Astro check: {pass/fail}
- Build: {pass/fail}
### Commit Message
content: sync {content_type} translation for "{identifier}" ({source_lang} -> {target_lang})Guardrails
Scope Limits
- Maximum files: 10 per invocation
- Maximum LOC: 500
Translation Quality Rules
- Use natural, idiomatic translations (not literal)
- Preserve technical terminology without translation (code terms, product names, URLs)
- Use informal-professional register for Spanish (Colombian Spanish phrasing, consistent with site voice)
- Maintain the same markdown structure and formatting
- CRITICAL — Spanish orthography: ALL Spanish text MUST use correct diacritical marks (ñ, á, é, í, ó, ú). Never write
pequeno(→ pequeño),tamano(→ tamaño),analisis(→ análisis),numero(→ número),codigo(→ código),pagina(→ página),ejecucion(→ ejecución),version(→ versión), etc. Run a quick grep check before committing.
Stop Conditions
Stop and ask if:
- Translation quality is uncertain for domain-specific or technical content
- Source file has validation errors or malformed frontmatter
- Content type cannot be determined from the file path
- More than 10 files need synchronization (break into batches)
- Source file contains content that seems incomplete or draft-quality
Definition of Done
- Target file exists with translated content
- Frontmatter structure matches source (for content docs)
- All user-visible text is translated
- Code blocks, commands, and technical content are preserved untranslated
langvalue is correct in target page files- Spanish text has correct diacritical marks (ñ, accents — no
pequeno,tamano,numero,codigo) pnpm run biome:checkpassespnpm run astro:checkpassespnpm run buildpasses
Escalation Conditions
Escalate to higher tier if:
- Content requires domain-specific terminology review -> use
i18n-guardianagent - More than 10 files need synchronization -> break into multiple invocations
- Structural changes are needed (new components, new routes) -> escalate to Tier 2
- Translation system architecture needs modification -> escalate to
architectagent
Examples
Example 1: Sync a New English Methodology Doc to Spanish
Input:
$SOURCE_FILE: src/content/methodology/en/introduction.mdActions:
- Detect: English methodology doc
- Target:
src/content/methodology/es/introduction.md - Translate title, description, and body to Spanish
- Preserve
order, setlang: es, keep frontmatter structure - Validate and report
Creates: src/content/methodology/es/introduction.md
Example 2: Sync a Modified Spanish Page to English
Input:
$SOURCE_FILE: src/pages/es/about.astroActions:
- Detect: Spanish page
- Target:
src/pages/about.astro - Update English page content to match Spanish changes
- Ensure
lang = 'en'in target - Validate and report
Updates: src/pages/about.astro
Example 3: Add Missing Translation Strings
Input:
$SOURCE_FILE: src/lib/translations/en.ts
$CONTENT_TYPE: translation-stringsActions:
- Detect: English translation file
- Compare with
src/lib/translations/es.ts - Find keys present in
en.tsbut missing ines.ts - Add missing translations to
es.ts - Validate and report
Updates: src/lib/translations/es.ts
Related
- add-page - Create multilingual pages
- add-component - Create components with i18n support
i18n-guardianagent - Translation quality specialist
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

