maintain-i18n
/maintain-i18n
Maintain the zh-TW docs locale — translate missing pages, incrementally sync stale translations against English source drift, and enforce Taiwan terminology. Use when adding or updating docs/zh-tw pages, when English docs changed and translations must catch up, or when checking translation freshness.
Assessment and security
- Files in this package
- 4
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 05.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Maintain the zh-TW docs locale — translate missing pages, incrementally sync stale translations against English source drift, and enforce Taiwan terminology. Use when adding or updating docs/zh-tw pages, when English docs changed and translations must catch up, or when checking translation freshness.
Original author description
Maintain the zh-TW docs locale — translate missing pages, incrementally sync stale translations against English source drift, and enforce Taiwan terminology. Use when adding or updating docs/zh-tw pages, when English docs changed and translations must catch up, or when checking translation freshness.
How it works
- Source of Truth
- Commands
- Workflow
- Hard Rules
- Fallback Rules (full-retranslate instead of hunk-level sync)
- Runtime State
SKILL.md preview
---
name: maintain-i18n
description: Maintain the zh-TW docs locale — translate missing pages, incrementally sync stale translations against English source drift, and enforce Taiwan terminology. Use when adding or updating docs/zh-tw pages, when English docs changed and translations must catch up, or when checking translation freshness.
---
# maintain-i18n
Maintains `docs/zh-tw/**` as a strictly aligned translation of the English docs. English is the single source of truth; never edit English pages from this skill.
## Source of Truth
| Concern | Source |
|---|---|
| Content | English pages under `docs/` (excluding `docs/zh-tw/**`) |
| Sync state | `translation:` frontmatter block in each zh page (committed, reviewable) |
| Style rules | `references/translation-style.md` |
| Terminology | `references/terminology.md` (TW-vs-PRC) + `references/glossary.md` (PikaCSS terms) |
| Machine lint list | `scripts/maintain-i18n/forbidden-terms.json` |
| Out of scope | Generated `docs/api/*.md` (English-only by policy; only `api/index.md` is translated) |
## Commands
```bash
pnpm maintain-i18n:status # page states + freshness table; writes task files to .maintain-i18n/tasks/
pnpm maintain-i18n:status --json # machine-readable report
pnpm maintain-i18n:check # non-mutating strict gate; every page must be fresh and fixtures clean
pnpm maintain-i18n:status --mark-synced <docs/zh-tw/page.md ...> # assert translation matches the current English blob
pnpm maintain-i18n:lint # forbidden-PRC-term scan, anchor conformity, fixture comment-only invariant
pnpm --filter @pikacss/docs test # example tests (includes zh-tw fixtures)
pnpm docs:build # dead-link + twoslash gate
```
## Workflow
1. **Analyze.** Run `pnpm maintain-i18n:status`. Read the task files in `.maintain-i18n/tasks/`. Each task carries the page state (`missing` / `stale` / `orphaned` / `untracked`), freshness %, and for `stale` pages the exact English diff (`git diff <sourceBlob> <currentBlob>`) plus the fallback verdict (incremental vs full-retranslate, see Fallback Rules below).
2. **Translate.**
- `missing`: translate the full current English page. Read `references/translation-style.md` and both terminology files FIRST. Preserve structure 1:1 (heading tree, container types, snippet includes, tables).
- `stale` + incremental verdict: map each diff hunk to the corresponding zh section (hunks carry heading context) and edit only the affected passages. Do not reflow or reword untouched passages.
- `stale` + full-retranslate verdict (task file says so): retranslate the whole page from current English, reusing established terminology.
- `orphaned`: the English source was deleted or renamed. For renames (task file proposes the target) `git mv` the zh page, then treat as `stale`. For deletions, delete the zh page and fix inbound links.
- Fixtures: if the diff touches files under `docs/.examples/`, update the mirrored `docs/zh-tw/.examples/` copies — comments translated, everything else byte-identical.
3. **Mark synced.** `pnpm maintain-i18n:status --mark-synced <pages...>`. This is an explicit assertion that the translation matches the **current English working-tree content**. The command refuses pages whose structural signature (fences, VitePress containers, snippet includes, tables, and list nesting) differs from English; fix `maintain-i18n:lint` errors first. Clean English sources record both `sourceBlob` and `sourceCommit`. English + zh-TW may land in the same commit, but a dirty English source must be staged first and the staged blob must exactly match the working-tree content. In that case `sourceBlob` records the staged object and `sourceCommit` is omitted because no commit identifies that content yet. If English changes after staging, stage it again before marking synced.
4. **Validate.** Use `pnpm docs:check` before handoff. It includes the non-mutating `pnpm maintain-i18n:check`, so any missing, stale, untracked, or orphaned translation blocks the canonical gate. During translation iteration, the narrower sequence `pnpm maintain-i18n:lint` → `pnpm maintain-i18n:check` → `pnpm --filter @pikacss/docs test` → `pnpm docs:build` remains useful.
## Hard Rules
- Code blocks: translate comments ONLY. Identifiers, string values, CSS output, file paths, shell commands stay byte-identical. This is stricter than MDN practice (which also translates strings/output) — do not relax it.
- Every zh heading carries the English anchor: `## 安裝 {#installation}`. The `{#id}` sequence must equal the English page's slug sequence (lint-enforced).
- Internal links → `/zh-tw/...`; links into `/api/*` and external URLs unchanged.
- When unsure whether to translate a term: keep English, use it consistently, and flag it for glossary addition.
- Never edit `docs/api/*.md` (generated) or English source pages.
- Never invent content absent from the English source; zh-TW is a mirror, not an editorial fork.
- A translated body does not mean a synced page. `--mark-synced` is the explicit assertion that the zh-TW body matches the current English blob; never run it merely to silence freshness output. For same-commit English + zh-TW changes, stage the final English content first. The command refuses dirty English whose index blob differs from the working tree, preventing provenance from pointing at a local dangling object that clones cannot retrieve. `sourceCommit` is intentionally omitted until that staged blob is committed.
- If a body was updated but `--mark-synced` was skipped, freshness remains stale even when the prose happens to be current. This has happened before (`available-hooks.md` and `create-a-plugin.md` during #116), so always verify the provenance block as a separate step.
- Translation freshness is a blocking repository invariant. `pnpm maintain-i18n:check` runs `status --strict --no-tasks`, requiring every discovered page to be `fresh` without mutating `.maintain-i18n/tasks/`. There is no generic stale-translation waiver: if an English-only edit does not require zh-TW prose changes, review the translation and use `--mark-synced` to record that assertion.
## Fallback Rules (full-retranslate instead of hunk-level sync)
The status script decides per page; the agent follows the task file. Full retranslation when ANY of:
- changed-line ratio `(added + deleted) / current-total` > 0.6
- English file renamed with git similarity < 50% (treated as delete + new page)
- heading-id sequence LCS against the recorded source < 0.7 (section reordering — hunk mapping unreliable)
- recorded `sourceBlob` unretrievable (`git cat-file` fails) and `sourceCommit` unknown
## Runtime State
`.maintain-i18n/` (gitignored) holds ephemeral task files only. Durable sync state lives in each zh page's `translation:` frontmatter — committed, reviewed in PRs, survives clones.
Files in this package (4)
- SKILL.md 7 KB
- references/glossary.md 7 KB
- references/terminology.md 5 KB
- references/translation-style.md 4 KB
Versions
The database has no other skills named maintain-i18n.
Database snapshot: 13.11.2026 · package version 81884a276ceb (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 100i18n-sync
Translate and synchronize application JSON locale files using source-key usage, project terminology, and focused validation. Use when adding keys or languages, updating source copy, or reviewing missing and stale translations. - 95lov-translation-review
Review Chinese-to-English translations for accuracy, grammar, terminology, and consistency. Produces a structured review report with prioritized issues. Trigger when: user provides a Chinese document and its English translation for review/checking/proofreading, or mentions… - 100i18n-sync
Translate and synchronize application JSON locale files using source-key usage, project terminology, and focused validation. Use when adding keys or languages, updating source copy, or reviewing missing and stale translations. - 100maintain-docs
Orchestrate PikaCSS English documentation maintenance for content drift, missing pages, heading conformity, and API reference generation. Use when: (1) analyzing docs coverage or stale content, (2) code changed and docs may need updates, (3) creating or updating… - 100fill-translations
Find and fill missing or outdated translation strings in the web app's and the mobile app's locales, using the English (en) strings as the source of truth. Use when asked to update, sync, fill or fix translations/i18n, or after adding or changing English strings in… - 91phpbb-docs-translations
Maintain phpBB documentation translation catalogs, terminology, and generated builds across source and languages repositories using the established gettext workflow. Use when updating PO catalogs, running translations.sh, fixing terminology, adding a docs language, or rebuilding…