Use when translating one file, one section, or all docs with glossary and style constraints.
Single-pass translation of markdown content to Traditional Chinese with glossary compliance, draft isolation, progress tracking, and one Git checkpoint commit per completed batch.
Core principle: Draft first, verify before writeback, never overwrite source with unverified output.
Before ANY action, create tasks using TaskCreate:
Verify required files exist:
glossary.jsonstyle-decisions.jsondata/translation-progress.json
If any are missing, stop and ask user to run /init-doc first.Resolve target files:
$ARGUMENTS specifies concrete file paths or a scoped pattern → use those directly as the current batch.all, or next) → auto-select using progress script:
uv run python scripts/progress_read.py --next 5 --json
not_started, in chapter order.in_progress files: --status in_progress.翻譯進度:已完成 X / Y 個章節
本批次已從進度表自動選取以下檔案:
- [in_progress 繼續] <file>
- [not_started 新增] <file>
…
是否繼續?或請指定其他範圍。
Verification: Target file list confirmed; all required files exist.
uv run python scripts/validate_glossary.py
uv run python scripts/term_read.py --fail-on-missing --fail-on-forbidden
If preflight fails, stop and fix terminology first.
Verification: Both commands exit 0.
Read style-decisions.json.translation_mode.mode.
If missing, ask user in Traditional Chinese:
Persist mode before translating.
Verification: translation_mode.mode persisted in style-decisions.json.
For each target file, obtain its draft path (this also creates the directory):
uv run python scripts/draft.py --skill translate path <TARGET_FILE>
Use the printed path as <DRAFT_FILE> for that file.
Verification: Draft path returned; directory exists.
For each target file:
in_progressuv run python scripts/progress_edit.py --file <TARGET_FILE> --status in_progress
glossary.json, and style-decisions.json(特別包含 translation_notes)DRAFT_FILE=$(uv run python scripts/draft.py --skill translate path <TARGET_FILE>)
Translate to $DRAFT_FILE:
.claude/skills/translate/.state/draft-manifest.json; do not add translation metadata to frontmatterstyle-decisions.json.translation_notesfrontmatter.title as the page title; do not restate it anywhere in the body as a heading of any level (#, ##, etc.)# or ## 概覽 heading$DRAFT_FILEstyle-decisions.json.translation_notes?frontmatter.title?概覽/overview heading that does not exist in the source?1d6, +2)? Covers body text, headings, table cells, and game labels (status conditions, item tags, rule keywords/phrases). Terminology must match glossary.json; proper nouns follow style-decisions.json policy.uv run python scripts/draft.py --skill translate writeback <TARGET_FILE>
uv run python scripts/progress_edit.py --file <TARGET_FILE> --status completed
Do NOT defer this update; run it before moving to the next file.Unknown term handling:
uv run python scripts/term_edit.py --term "<TERM>" --set-zh "<ZH>" --status approved --mark-term
uv run python scripts/term_read.py --fail-on-forbidden
Then continue translating with the updated glossary.
Verification: Self-review checklist passes; writeback exits 0; progress JSON updated.
After all files in the current batch are processed:
git status --short and verify batch scope before staging.data/translation-progress.jsonglossary.json if changed in this batchstyle-decisions.json if changed in this batchgit commit -m "progress: X/Y"
uv run python scripts/progress_read.py --jsoncompleted in this batch, skip the commit.Verification: git log -1 shows progress commit.
uv run python scripts/validate_glossary.py
uv run python scripts/term_read.py --fail-on-missing --fail-on-forbidden
Mark final verification task item completed.
Verification: Both validation commands exit 0; all tasks completed.
digraph translate {
rankdir=TB;
scope [label="Resolve scope\n& preconditions", shape=box];
preflight [label="Terminology\npreflight", shape=box];
mode [label="Resolve\ntranslation mode", shape=box];
translate [label="Translate file\n(self-review loop)", shape=box];
writeback [label="Writeback +\nupdate progress", shape=box];
checkpoint [label="Batch checkpoint\n& commit", shape=box];
more [label="More files?", shape=diamond];
verify [label="Final\nverification", shape=box];
scope -> preflight -> mode -> translate;
translate -> writeback;
writeback -> checkpoint;
checkpoint -> more;
more -> translate [label="yes"];
more -> verify [label="no"];
}
progress_edit.py) at file start and file close.| Thought | Reality |
|---|---|
| "Just overwrite source, I'll review later" | Draft isolation exists for a reason. NEVER overwrite without self-review. |
| "Skip task updates until the end" | Sync contract is per-file, not per-run. |
| "I'll invent a translation for this unknown term" | Run term_edit.py --set-zh workflow. No exceptions. |
| "Skip terminology preflight, it was fine last time" | Glossary changes between runs. Always preflight. |
| "One file left, no need for checkpoint commit" | Every completed batch gets a commit. No exceptions. |
| "I can batch-replace with regex for speed" | Manual translation only. Script-generated prose is forbidden. |
| "I'll add a heading to restate the title" | Never restate frontmatter.title as a body heading. |
| "I'll add an overview heading for clarity" | Never invent a heading that does not exist in the source. |
Stop when:
Return to Step 1 or 3 when:
After translation, run /check-consistency and /check-completeness as needed.
If uv run python scripts/progress_read.py shows all files are completed after this batch, invoke the final-proofread skill to run the three-gate quality sweep before publishing.
/translate
/translate docs/src/content/docs/rules/basic.md
/translate rules
/translate all