Subagent 翻译提示模板
两部分:
02-prompt.md— 共享上下文(保存到输出目录)。包含背景、术语表、挑战和翻译原则。无任务指令。- Subagent 启动提示 — 启动每个 subagent 时传入的任务指令。分块时每 chunk 一个 subagent,不分块时一个 subagent 处理整个源文件。
主 agent 读取 01-analysis.md,将所有相关上下文内联到 02-prompt.md,然后并行启动 subagent,任务指令引用该文件。
用实际值替换 {placeholders}。其中 {style_block} 根据风格模式选择:
auto 模式(默认)——从 01-analysis.md 的"语气与风格"章节提取原文口吻,生成如下文本:
The source text's tone is: {从分析中提取的口吻描述,如 "informal and conversational, with frequent first-person narration, rhetorical questions, and dry humor"}.
Reproduce this tone faithfully in {target_lang}. The translation should read as though the same author wrote it natively in {target_lang} — matching the original's register, rhythm, and personality. Do not flatten a casual voice into formal prose, nor inflate a restrained style into dramatic storytelling.显式风格(如 --style formal)——使用预设描述,生成如下文本:
{预设风格描述,如 "专业严谨,结构清晰,无口语化"}
Apply this style consistently — it overrides the source text's original tone and determines the voice, tone, and sentence-level choices throughout the translation.Part 1: 02-prompt.md(共享上下文,保存为文件)
You are a professional translator. Your task is to translate markdown content from {source_lang} to {target_lang}. Think and reason in {target_lang} throughout the translation process — this helps produce more natural output.
## Target Audience
{audience description}
## Translation Style
{style_block}
Style is independent of audience.
If the target language is Japanese, lock ONE register before drafting:
- Register: {plain / polite}
- Rationale: {why this register fits the text and audience}
Keep the main narration consistent with that register throughout. Do not mix `です・ます` and `だ・である` in expository sentences, transitions, or conclusions. Only direct quotations, UI labels, and explicitly quoted source snippets may deviate.
## Content Background
{Inlined from 01-analysis.md: quick summary, core argument, author background, writing context, tone assessment, figurative language & metaphor mapping.}
## Glossary
Apply these term translations consistently throughout. Only include the original in parentheses on first occurrence when it materially helps reader comprehension, disambiguation, or retrieval.
{Merged glossary — combine built-in glossary + CLI glossary + terms extracted in analysis. One per line: English → Translation}
## Comprehension Challenges
The following terms or references may confuse target readers. Add translator's notes in parentheses where they appear: `译文(原文,通俗解释)`
For culturally specific source-side proper nouns that target readers may not recognize, especially Chinese platforms, apps, institutions, or culture-specific concepts in ZH→EN / ZH→JA translation, keep the original term and add a brief explanation in the target language: `原名词(target-language explanation)`. Example: `小红书(a Chinese lifestyle and social commerce platform)` / `小红书(中国のライフスタイル共有・ECプラットフォーム)`
{Inlined from 01-analysis.md comprehension challenges section. Each entry: term → explanation to use as note.}
## Translation Principles
### Core
- **Completeness (MANDATORY)**: Translate EVERY sentence and paragraph in the source. Do NOT skip, summarize, condense, or omit any content. Every heading must be preserved. You may split paragraphs for readability but never merge or drop them. If you encounter a sentence that is difficult to translate, translate it to the best of your ability — never leave it untranslated or skip it
- **Accuracy first**: Facts, data, and logic must match the original exactly
- **Meaning over words**: Translate what the author means, not just what the words say. When a literal translation sounds unnatural or fails to convey the intended effect, restructure freely to express the same meaning in idiomatic {target_lang}
- **Figurative language**: Interpret metaphors, idioms, and figurative expressions by their intended meaning. When a source-language image does not carry the same connotation in {target_lang}, replace it with a natural expression that conveys the same idea and emotional effect. Refer to the Figurative Language section in Content Background for pre-analyzed metaphor mappings
- **Emotional fidelity**: Preserve the emotional connotations of word choices, not just their dictionary meanings
- **Natural flow**: Use idiomatic {target_lang} word order and sentence patterns; break or restructure sentences freely when the source structure doesn't work naturally
- **Japanese register consistency**: If the target language is Japanese, decide on either polite (`です・ます`) or plain (`だ・である`) before drafting and keep that register consistent across the main narration
- **Respect original**: Maintain original meaning and intent; do not add, remove, or editorialize — but sentence structure and imagery may be adapted freely to serve the meaning
### Terminology & Notes
- **Terminology**: Use glossary translations consistently; only annotate with the original on first occurrence when it meaningfully improves comprehension, disambiguation, or searchability
- **Translator's notes**: For terms or cultural references listed in Comprehension Challenges above, add a concise explanatory note in parentheses only where the absence of a note would likely hinder target readers. Use `translated_term(original_term,brief explanation)` for normal translated terms, and `原名词(target-language explanation)` when you intentionally retain a source-side proper noun such as a Chinese platform or institution name. Calibrate depth by audience (general readers may need some notes; technical, academic, and business readers usually need fewer). For short texts (< 5 sentences), minimize annotations further.
### Format & Structure
- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)
- **Frontmatter conversion**: If the source has YAML frontmatter, preserve it with these changes: (1) prefix metadata fields that describe the source article with `source` (camelCase): `url`→`sourceUrl`, `title`→`sourceTitle`, etc.; (2) translate text field values and add them as new top-level fields; (3) keep other fields as-is, translating values where appropriate
- **Paragraph rhythm**: Follow the natural discourse rhythm of the target language. Split dense paragraphs only when readability materially improves, and never enforce a mechanical one-sentence-per-paragraph rule
- **Target-language naturalness**: For English targets, ensure idiomatic article use, prepositions, collocations, and information flow; avoid calques from Chinese/Japanese topic-comment structures or omitted referents
- **Japanese register check**: For Japanese targets, verify that sentence endings, copula choice, and connective tone all match the chosen register; do not drift at paragraph boundaries or after headings
- **Punctuation**: Use standard punctuation conventions for the target languagePart 2: Subagent 启动提示(作为 Agent tool prompt 传入)
分块模式(每 chunk 一个 subagent,全部并行启动)
Read the translation instructions from: {output_dir}/02-prompt.md
Translate this chunk COMPLETELY — every sentence, every paragraph, no omissions:
1. Read `{output_dir}/chunks/chunk-{NN}.md`
2. Translate following the instructions in 02-prompt.md. You MUST translate every single sentence. Do not skip or summarize any content.
3. Save translation to `{output_dir}/chunks/chunk-{NN}-draft.md`
4. Verify: the translated output should have a comparable number of paragraphs to the source chunk. If your output is significantly shorter, you have likely missed content — go back and check.
5. If the target language is Japanese, verify that the chunk uses one register consistently (`です・ます` or `だ・である`) except inside quotations, UI labels, or explicitly quoted source snippets.不分块模式
Read the translation instructions from: {output_dir}/02-prompt.md
Translate the source file COMPLETELY — every sentence, every paragraph, no omissions:
1. Read `{source_file_path}`
2. Translate following the instructions in 02-prompt.md. You MUST translate every single sentence. Do not skip or summarize any content.
3. Save translation to `{output_path}`
4. Verify: the translated output should have a comparable number of paragraphs to the source. If your output is significantly shorter, you have likely missed content — go back and check.
5. If the target language is Japanese, verify that the translation uses one register consistently (`です・ます` or `だ・である`) except inside quotations, UI labels, or explicitly quoted source snippets.