bilingual-readme-sync
Keep README.md and README.pt-BR.md structurally aligned in any repo that uses the 2-file bilingual pattern.
When to run
- After any edit to
README.md in a repo that has a README.pt-BR.md sibling.
- After any edit to the canonical EN README in a repo pair (e.g.
ai-dev-toolkit → mirror into ai-dev-toolkit-pt-br).
- Before release cuts, to guarantee the PT reader sees the same content the EN reader does.
Invariants
- Line-count parity (±5%). A stub PT file next to a 300-line EN file is the trigger to ship a full translation.
- Structural parity: same number of H1/H2/H3 headings, same table rows, same code blocks in the same order.
- Language-switch header as line 1:
[English](README.md) | [Português](README.pt-BR.md).
- In a PT-primary repo (e.g.
ai-dev-toolkit-pt-br): the English link points to the canonical EN repo URL, not a local file.
- Code blocks, URLs, file paths, badges, shell commands: verbatim identical between EN and PT.
- Technical terms kept in English:
forge-kit, Claude Code, Codex, OpenCode, Cursor, Windsurf, GitHub Copilot, MCP, MIT, TypeScript, ESLint, CI, PR, skill/rule/agent/hook/pattern, skill names (loop, route, dispatch, tdd, secure, resume).
Diff heuristic (quick audit)
wc -l README.md README.pt-BR.md
# If the two differ by more than ~5%, parity is broken.
For a deeper audit, compare heading structure:
grep -c "^#" README.md README.pt-BR.md
grep -c "^##" README.md README.pt-BR.md
grep -c "^\`\`\`" README.md README.pt-BR.md # code block openers
Workflow
Scenario A — EN-primary repo (e.g. ai-dev-toolkit)
- Read current
README.md and README.pt-BR.md.
- If line-count parity is broken or new sections exist in EN but not PT, dispatch a translation subagent (see prompt template below).
- Ensure both files start with:
[English](README.md) | [Português](README.pt-BR.md)
# <Title>
- Commit as
docs(readme): sync PT translation with EN.
Scenario B — PT-primary repo (e.g. ai-dev-toolkit-pt-br)
- Pull canonical EN README from the EN repo; treat as source of truth.
- PT repo's
README.md is the PT version — mirror structure from canonical EN.
- Language-switch header uses absolute URL for the EN link:
[English](https://github.com/<org>/<en-repo>) | [Português](README.md)
# <Título>
- If repo currently has a redundant
README.pt-BR.md (duplicate of README.md), git rm it.
- Commit as
docs: parity with <canonical-repo> README.
Scenario C — repo pair (EN canonical ↔ PT fork)
Do both A and B in one session. Use git worktrees so the two commits land on separate feature branches, one PR per repo.
Translation subagent prompt template
When dispatching a translation task to executor:
Translate the English README at <path> (<N> lines) to Brazilian Portuguese, and write the result to <destination>.
Rules:
- Preserve ALL code blocks verbatim (commands, JSON, file lists).
- Preserve ALL URLs, badge markdown, file paths.
- Preserve markdown structure (headings levels, tables, lists).
- Keep technical terms in English: forge-kit, Claude Code, Codex, OpenCode, Cursor, Windsurf, GitHub Copilot, MCP, MIT, ESLint, TypeScript, CI, PR, skill, agent, hook, rule, pattern, skill names.
- Translate: headings, body prose, table description columns, troubleshooting text.
- Start output with language-switch header (exact form depends on EN-primary vs PT-primary repo).
Include a curated "section title translations" table in the dispatched prompt so the subagent matches existing PT terminology.
Cross-repo propagation (ai-dev-toolkit ecosystem)
When shipping README changes in this ecosystem, update 3 locations:
ai-dev-toolkit/README.md + README.pt-BR.md (EN-primary)
ai-dev-toolkit-pt-br/README.md (PT-primary, points back to canonical EN repo)
ai-dev-toolkit-setup/README.md + README.pt-BR.md (independent, but same pattern)
All three must carry the language-switch header. Parity is ratcheted by running this skill after any README edit.
Non-goals
- This skill does not translate entire
docs/ trees automatically. Use a separate translation pipeline for docs/guides/ etc. This skill is scoped to README parity.
- It does not lint prose quality or fix typos in existing translations — it only enforces structural + code-block parity.
Related
spec-new — for larger content additions that warrant a spec record.
aggregate-roadmap — for propagating roadmap state across repo pairs.
1---2name: bilingual-readme-sync3description: Keep EN/PT README.md pairs in parity across a repo (and across twin repos like ai-dev-toolkit + ai-dev-toolkit-pt-br).4---56# bilingual-readme-sync78Keep `README.md` and `README.pt-BR.md` structurally aligned in any repo that uses the 2-file bilingual pattern.910## When to run1112- After any edit to `README.md` in a repo that has a `README.pt-BR.md` sibling.13- After any edit to the canonical EN README in a repo pair (e.g. `ai-dev-toolkit` → mirror into `ai-dev-toolkit-pt-br`).14- Before release cuts, to guarantee the PT reader sees the same content the EN reader does.1516## Invariants17181. **Line-count parity** (±5%). A stub PT file next to a 300-line EN file is the trigger to ship a full translation.192. **Structural parity**: same number of H1/H2/H3 headings, same table rows, same code blocks in the same order.203. **Language-switch header** as line 1: `[English](README.md) | [Português](README.pt-BR.md)`.21 - In a **PT-primary repo** (e.g. `ai-dev-toolkit-pt-br`): the English link points to the canonical EN repo URL, not a local file.224. **Code blocks, URLs, file paths, badges, shell commands**: verbatim identical between EN and PT.235. **Technical terms** kept in English: `forge-kit`, `Claude Code`, `Codex`, `OpenCode`, `Cursor`, `Windsurf`, `GitHub Copilot`, `MCP`, `MIT`, `TypeScript`, `ESLint`, `CI`, `PR`, skill/rule/agent/hook/pattern, skill names (`loop`, `route`, `dispatch`, `tdd`, `secure`, `resume`).2425## Diff heuristic (quick audit)2627```bash28wc -l README.md README.pt-BR.md29# If the two differ by more than ~5%, parity is broken.30```3132For a deeper audit, compare heading structure:3334```bash35grep -c "^#" README.md README.pt-BR.md36grep -c "^##" README.md README.pt-BR.md37grep -c "^\`\`\`" README.md README.pt-BR.md # code block openers38```3940## Workflow4142### Scenario A — EN-primary repo (e.g. `ai-dev-toolkit`)43441. Read current `README.md` and `README.pt-BR.md`.452. If line-count parity is broken or new sections exist in EN but not PT, dispatch a translation subagent (see prompt template below).463. Ensure both files start with:47 ```48 [English](README.md) | [Português](README.pt-BR.md)4950 # <Title>51 ```524. Commit as `docs(readme): sync PT translation with EN`.5354### Scenario B — PT-primary repo (e.g. `ai-dev-toolkit-pt-br`)55561. Pull canonical EN README from the EN repo; treat as source of truth.572. PT repo's `README.md` **is** the PT version — mirror structure from canonical EN.583. Language-switch header uses absolute URL for the EN link:59 ```60 [English](https://github.com/<org>/<en-repo>) | [Português](README.md)6162 # <Título>63 ```644. If repo currently has a redundant `README.pt-BR.md` (duplicate of `README.md`), `git rm` it.655. Commit as `docs: parity with <canonical-repo> README`.6667### Scenario C — repo pair (EN canonical ↔ PT fork)6869Do both A and B in one session. Use git worktrees so the two commits land on separate feature branches, one PR per repo.7071## Translation subagent prompt template7273When dispatching a translation task to `executor`:7475```76Translate the English README at <path> (<N> lines) to Brazilian Portuguese, and write the result to <destination>.7778Rules:79- Preserve ALL code blocks verbatim (commands, JSON, file lists).80- Preserve ALL URLs, badge markdown, file paths.81- Preserve markdown structure (headings levels, tables, lists).82- Keep technical terms in English: forge-kit, Claude Code, Codex, OpenCode, Cursor, Windsurf, GitHub Copilot, MCP, MIT, ESLint, TypeScript, CI, PR, skill, agent, hook, rule, pattern, skill names.83- Translate: headings, body prose, table description columns, troubleshooting text.84- Start output with language-switch header (exact form depends on EN-primary vs PT-primary repo).85```8687Include a curated "section title translations" table in the dispatched prompt so the subagent matches existing PT terminology.8889## Cross-repo propagation (ai-dev-toolkit ecosystem)9091When shipping README changes in this ecosystem, update **3 locations**:92931. `ai-dev-toolkit/README.md` + `README.pt-BR.md` (EN-primary)942. `ai-dev-toolkit-pt-br/README.md` (PT-primary, points back to canonical EN repo)953. `ai-dev-toolkit-setup/README.md` + `README.pt-BR.md` (independent, but same pattern)9697All three must carry the language-switch header. Parity is ratcheted by running this skill after any README edit.9899## Non-goals100101- This skill does **not** translate entire `docs/` trees automatically. Use a separate translation pipeline for `docs/guides/` etc. This skill is scoped to README parity.102- It does not lint prose quality or fix typos in existing translations — it only enforces structural + code-block parity.103104## Related105106- `spec-new` — for larger content additions that warrant a spec record.107- `aggregate-roadmap` — for propagating roadmap state across repo pairs.