This skill provides guidelines for accurate, fluent translation, with agent-based parallel processing for large files and multi-file batches. On Translation Translation is writing across languages — rendering content expressed in one language into another, minimizing the gap between them. Good translation goes beyond conveying information accurately. It re-expresses that information in language that is beautiful and natural, capturing the spirit of the original author. When readers encounter the translation, they should feel the piece was written in their language from the start — not carried…

, line)\n for match in broken:\n # 排除脚注定义 [^note]\n if match.startswith('^'):\n continue\n # 排除复选框\n if match.strip() in ('x', 'X', ' ', ''):\n continue\n # 确认下一行以 (url) 开头才报告\n if i + 1 \u003c len(lines) and re.match(r'^\\s*\\(', lines[i + 1]):\n issues.append({\n \"line\": i + 1,\n \"type\": \"broken_link\",\n \"message\": f\"链接可能断裂跨行:[{match[:40]}]\",\n \"content\": line.strip()[:80]\n })\n\n return issues\n\n\ndef validate_markdown(content: str) -> list[dict]:\n \"\"\"执行所有格式校验,返回问题列表。\"\"\"\n lines = content.splitlines(keepends=True)\n # 对于校验函数,使用不带换行符的行\n plain_lines = content.splitlines()\n\n all_issues = []\n all_issues.extend(check_heading_continuity(plain_lines))\n all_issues.extend(check_code_blocks(plain_lines))\n all_issues.extend(check_links(plain_lines))\n\n # 按行号排序\n all_issues.sort(key=lambda x: x[\"line\"])\n return all_issues\n\n\ndef format_report(issues: list[dict]) -> str:\n \"\"\"格式化校验报告。\"\"\"\n if not issues:\n return \"[PASS] 格式校验通过,未发现问题。\"\n\n report_lines = [f\"共发现 {len(issues)} 个潜在问题:\", \"\"]\n\n type_labels = {\n \"heading_skip\": \"标题跳级\",\n \"unclosed_code_block\": \"代码块未闭合\",\n \"broken_link\": \"链接断裂\",\n }\n\n for issue in issues:\n label = type_labels.get(issue[\"type\"], issue[\"type\"])\n report_lines.append(f\" 行 {issue['line']} [{label}] {issue['message']}\")\n if issue.get(\"content\"):\n report_lines.append(f\" → {issue['content']}\")\n\n return \"\\n\".join(report_lines)\n\n\ndef main():\n args = parse_args()\n manifest_path = Path(args.manifest).resolve()\n manifest_dir = manifest_path.parent\n output_path = Path(args.output).resolve()\n\n # 加载清单\n manifest = load_manifest(str(manifest_path))\n print(f\"源文件:{manifest['source']}\")\n print(f\"片段数:{manifest['parts_count']}\")\n\n # 合并片段\n content, merge_errors = merge_parts(manifest, manifest_dir, args.suffix)\n\n if merge_errors:\n print(\"\\n合并失败:\", file=sys.stderr)\n for err in merge_errors:\n print(f\" - {err}\", file=sys.stderr)\n sys.exit(1)\n\n # 写入合并文件\n output_path.write_text(content, encoding=\"utf-8\")\n merged_lines = content.splitlines()\n print(f\"合并完成:{len(merged_lines)} 行 → {output_path.name}\")\n\n # 格式校验\n print(\"\\n--- 格式校验报告 ---\")\n issues = validate_markdown(content)\n report = format_report(issues)\n print(report)\n\n # 以退出码反映是否有问题(0=无问题,1=有问题但已合并)\n if issues:\n # 有问题但文件已成功合并,使用退出码 0 但在输出中标明\n print(f\"\\n文件已合并至:{output_path}\")\n print(\"请根据上述报告检查并修复问题。\")\n else:\n print(f\"\\n文件已合并至:{output_path}\")\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":8144,"content_sha256":"13277356832fb461cceee5c36542a2ba719630eb3af65f3e7daa291a15656783"},{"filename":"scripts/split_md.py","content":"#!/usr/bin/env python3\n\"\"\"\nsplit_md.py — 按语义边界拆分大 Markdown 文件\n\n用法:\n python split_md.py input.md --max-lines 600 --min-lines 100 --output-dir ./_parts/\n\n输出:\n _part_01.md, _part_02.md, ... + _split_manifest.json\n\"\"\"\n\nimport argparse\nimport io\nimport json\nimport re\nimport sys\nfrom pathlib import Path\n\n# Windows 下强制 UTF-8 输出,避免 GBK 编码错误\nsys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding=\"utf-8\", errors=\"replace\")\nsys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding=\"utf-8\", errors=\"replace\")\n\n\ndef parse_args():\n parser = argparse.ArgumentParser(description=\"按语义边界拆分大 Markdown 文件\")\n parser.add_argument(\"input\", help=\"输入 Markdown 文件路径\")\n parser.add_argument(\"--max-lines\", type=int, default=600, help=\"每个片段最大行数(默认 600)\")\n parser.add_argument(\"--min-lines\", type=int, default=100, help=\"每个片段最小行数(默认 100)\")\n parser.add_argument(\"--output-dir\", default=\"./_parts/\", help=\"输出目录(默认 ./_parts/)\")\n return parser.parse_args()\n\n\ndef read_lines(filepath: str) -> list[str]:\n \"\"\"读取文件所有行,保留换行符。\"\"\"\n path = Path(filepath)\n if not path.exists():\n print(f\"错误:文件不存在 - {filepath}\", file=sys.stderr)\n sys.exit(1)\n return path.read_text(encoding=\"utf-8\").splitlines(keepends=True)\n\n\ndef find_heading_positions(lines: list[str]) -> list[tuple[int, int]]:\n \"\"\"\n 找出所有标题行的位置和层级。\n 返回 [(行号, 层级), ...],行号从 0 开始。\n 跳过代码块内的 # 符号。\n \"\"\"\n headings = []\n in_code_block = False\n\n for i, line in enumerate(lines):\n stripped = line.strip()\n\n # 检测代码块边界\n if stripped.startswith(\"```\"):\n in_code_block = not in_code_block\n continue\n\n if in_code_block:\n continue\n\n # 匹配 ATX 风格标题\n match = re.match(r'^(#{1,6})\\s+\\S', line)\n if match:\n level = len(match.group(1))\n headings.append((i, level))\n\n return headings\n\n\ndef get_title_text(line: str) -> str:\n \"\"\"从标题行提取标题文本。\"\"\"\n match = re.match(r'^#{1,6}\\s+(.+?)(?:\\s*#*\\s*)?

This skill provides guidelines for accurate, fluent translation, with agent-based parallel processing for large files and multi-file batches. On Translation Translation is writing across languages — rendering content expressed in one language into another, minimizing the gap between them. Good translation goes beyond conveying information accurately. It re-expresses that information in language that is beautiful and natural, capturing the spirit of the original author. When readers encounter the translation, they should feel the piece was written in their language from the start — not carried…

, line.strip())\n return match.group(1).strip() if match else line.strip()\n\n\ndef precompute_code_block_ranges(lines: list[str]) -> list[tuple[int, int]]:\n \"\"\"\n 预计算所有代码块的行号区间。\n 返回 [(start, end), ...],start 是 ``` 开始行,end 是 ``` 结束行。\n 代码块内部行号范围为 (start, end) 开区间。\n \"\"\"\n ranges = []\n open_line = None\n\n for i, line in enumerate(lines):\n if line.strip().startswith(\"```\"):\n if open_line is None:\n open_line = i\n else:\n ranges.append((open_line, i))\n open_line = None\n\n # 未闭合的代码块延伸到文件末尾\n if open_line is not None:\n ranges.append((open_line, len(lines)))\n\n return ranges\n\n\ndef is_in_code_block_fast(code_block_ranges: list[tuple[int, int]], line_idx: int) -> bool:\n \"\"\"用二分搜索判断指定行是否在代码块内。\"\"\"\n if not code_block_ranges:\n return False\n\n lo, hi = 0, len(code_block_ranges) - 1\n while lo \u003c= hi:\n mid = (lo + hi) // 2\n start, end = code_block_ranges[mid]\n if line_idx \u003c start:\n hi = mid - 1\n elif line_idx > end:\n lo = mid + 1\n else:\n # line_idx 在 [start, end] 范围内(含边界的 ``` 行本身)\n return True\n return False\n\n\ndef is_in_list(lines: list[str], line_idx: int) -> bool:\n \"\"\"判断指定行是否在列表中间。\"\"\"\n if line_idx >= len(lines):\n return False\n line = lines[line_idx].strip()\n # 如果当前行是列表项或者是列表项的续行(缩进的非空行)\n if re.match(r'^[-*+]\\s|^\\d+\\.\\s', line):\n return True\n # 检查是否是列表续行\n if line and line_idx > 0:\n prev = lines[line_idx - 1].strip()\n if re.match(r'^[-*+]\\s|^\\d+\\.\\s', prev):\n return True\n return False\n\n\ndef find_split_points(lines: list[str], headings: list[tuple[int, int]],\n max_lines: int, min_lines: int) -> list[int]:\n \"\"\"\n 确定拆分点(行号列表)。\n 优先在一级标题处拆,其次二级、三级。\n 确保每个片段在 min_lines ~ max_lines 范围内。\n \"\"\"\n total = len(lines)\n if total \u003c= max_lines:\n return [] # 不需要拆分\n\n # 预计算代码块区间,后续查询用二分搜索\n code_block_ranges = precompute_code_block_ranges(lines)\n\n # 按层级分组标题位置\n h1_positions = [pos for pos, level in headings if level == 1]\n h2_positions = [pos for pos, level in headings if level == 2]\n h3_positions = [pos for pos, level in headings if level == 3]\n all_heading_positions = sorted([pos for pos, _ in headings])\n\n split_points = []\n current_start = 0\n\n while current_start \u003c total:\n remaining = total - current_start\n\n # 如果剩余内容不超过 max_lines,结束\n if remaining \u003c= max_lines:\n break\n\n # 在 [current_start + min_lines, current_start + max_lines] 范围内寻找最佳拆分点\n search_start = current_start + min_lines\n search_end = min(current_start + max_lines, total)\n\n best_point = None\n\n # 优先找 H1\n for pos in h1_positions:\n if search_start \u003c= pos \u003c= search_end:\n best_point = pos\n break # 取第一个符合的 H1\n\n # 其次找 H2\n if best_point is None:\n for pos in h2_positions:\n if search_start \u003c= pos \u003c= search_end:\n best_point = pos\n break\n\n # 再找 H3\n if best_point is None:\n for pos in h3_positions:\n if search_start \u003c= pos \u003c= search_end:\n best_point = pos\n break\n\n # 找任意标题\n if best_point is None:\n for pos in all_heading_positions:\n if search_start \u003c= pos \u003c= search_end:\n best_point = pos\n break\n\n # 找空行作为段落边界\n if best_point is None:\n # 从 search_end 向前找空行\n for pos in range(search_end - 1, search_start - 1, -1):\n if pos \u003c total and lines[pos].strip() == \"\":\n # 确保不在代码块或列表中间\n if not is_in_code_block_fast(code_block_ranges, pos) and not is_in_list(lines, pos):\n best_point = pos + 1 # 拆分点在空行之后\n break\n\n # 实在找不到,强制在 max_lines 处拆\n if best_point is None:\n best_point = search_end\n\n # 确保拆分点不在代码块中间\n if is_in_code_block_fast(code_block_ranges, best_point):\n # 向后找到代码块结束\n for pos in range(best_point, min(best_point + 100, total)):\n if lines[pos].strip().startswith(\"```\"):\n best_point = pos + 1\n break\n\n split_points.append(best_point)\n current_start = best_point\n\n return split_points\n\n\ndef get_context_lines(lines: list[str], start: int, end: int,\n prev_end: int, next_start: int) -> dict:\n \"\"\"生成上下文信息。\"\"\"\n context = {}\n\n # 前文最后 5 行\n if start > 0:\n ctx_start = max(prev_end if prev_end >= 0 else 0, start - 5)\n context[\"preceding_lines\"] = [l.rstrip(\"\\n\\r\") for l in lines[ctx_start:start]]\n\n # 后文前 3 行\n if end \u003c len(lines):\n ctx_end = min(next_start if next_start > 0 else len(lines), end + 3)\n context[\"following_lines\"] = [l.rstrip(\"\\n\\r\") for l in lines[end:ctx_end]]\n\n return context\n\n\ndef get_title_range(lines: list[str], start: int, end: int) -> str:\n \"\"\"获取片段内的标题范围描述。\"\"\"\n titles = []\n in_code = False\n for i in range(start, min(end, len(lines))):\n stripped = lines[i].strip()\n if stripped.startswith(\"```\"):\n in_code = not in_code\n continue\n if in_code:\n continue\n match = re.match(r'^#{1,6}\\s+(.+?)(?:\\s*#*\\s*)?

This skill provides guidelines for accurate, fluent translation, with agent-based parallel processing for large files and multi-file batches. On Translation Translation is writing across languages — rendering content expressed in one language into another, minimizing the gap between them. Good translation goes beyond conveying information accurately. It re-expresses that information in language that is beautiful and natural, capturing the spirit of the original author. When readers encounter the translation, they should feel the piece was written in their language from the start — not carried…

, stripped)\n if match:\n titles.append(match.group(1).strip())\n\n if not titles:\n return f\"Lines {start + 1}-{end}\"\n if len(titles) == 1:\n return titles[0]\n return f\"{titles[0]} ~ {titles[-1]}\"\n\n\ndef main():\n args = parse_args()\n input_path = Path(args.input).resolve()\n output_dir = Path(args.output_dir)\n output_dir.mkdir(parents=True, exist_ok=True)\n\n lines = read_lines(str(input_path))\n total_lines = len(lines)\n\n print(f\"文件:{input_path.name}\")\n print(f\"总行数:{total_lines}\")\n\n if total_lines \u003c= args.max_lines:\n print(f\"文件行数 ({total_lines}) 未超过阈值 ({args.max_lines}),无需拆分。\")\n sys.exit(0)\n\n # 找标题位置\n headings = find_heading_positions(lines)\n print(f\"发现 {len(headings)} 个标题\")\n\n # 确定拆分点\n split_points = find_split_points(lines, headings, args.max_lines, args.min_lines)\n\n if not split_points:\n print(\"未找到合适的拆分点。\")\n sys.exit(0)\n\n # 生成片段\n boundaries = [0] + split_points + [total_lines]\n parts = []\n\n for i in range(len(boundaries) - 1):\n start = boundaries[i]\n end = boundaries[i + 1]\n part_num = i + 1\n part_filename = f\"_part_{part_num:02d}.md\"\n part_path = output_dir / part_filename\n\n # 写入片段文件\n content = \"\".join(lines[start:end])\n part_path.write_text(content, encoding=\"utf-8\")\n\n # 上下文信息\n prev_end = boundaries[i - 1] if i > 0 else -1\n next_start = boundaries[i + 2] if i + 2 \u003c len(boundaries) else -1\n context = get_context_lines(lines, start, end, prev_end, next_start)\n\n # 写上下文文件\n if context:\n ctx_path = output_dir / f\"_part_{part_num:02d}_context.json\"\n ctx_path.write_text(json.dumps(context, ensure_ascii=False, indent=2),\n encoding=\"utf-8\")\n\n title_range = get_title_range(lines, start, end)\n\n parts.append({\n \"file\": part_filename,\n \"start_line\": start + 1, # 转为 1-based\n \"end_line\": end,\n \"lines\": end - start,\n \"title_range\": title_range\n })\n\n print(f\" {part_filename}: 行 {start + 1}-{end} ({end - start} 行) [{title_range}]\")\n\n # 生成 manifest\n manifest = {\n \"source\": input_path.name,\n \"source_path\": str(input_path),\n \"total_lines\": total_lines,\n \"parts_count\": len(parts),\n \"parts\": parts\n }\n\n manifest_path = output_dir / \"_split_manifest.json\"\n manifest_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2),\n encoding=\"utf-8\")\n\n print(f\"\\n拆分完成:{len(parts)} 个片段\")\n print(f\"清单文件:{manifest_path}\")\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":11357,"content_sha256":"fc2451b1bb48f2a17c40d3ade36a89349e33f39bebe0e91dc07c956ce69c921a"},{"filename":"skill-report.json","content":"{\n \"schema_version\": \"2.0\",\n \"meta\": {\n \"generated_at\": \"2026-02-21T00:47:15.237Z\",\n \"slug\": \"fuhehe12-translate\",\n \"source_url\": \"https://github.com/FuHehe12/Nitro-Engine/tree/main/translate\",\n \"source_ref\": \"main\",\n \"model\": \"claude\",\n \"analysis_version\": \"3.0.0\",\n \"source_type\": \"community\",\n \"content_hash\": \"f27e8afc83a483a4db83d4d94301676c6ce86df239f5b2f3b37b3e4f45b04d51\",\n \"tree_hash\": \"a30b4d7a3f963da9a738f94fff93cbecbbc40198f416abf6b5561cd9bbcaf5ce\"\n },\n \"skill\": {\n \"name\": \"translate\",\n \"description\": \"Accurately and fluently translates source text into another language, supporting any language pair. Default target language is Chinese. Use this skill when the user requests translation of Markdown files, batch document translation, or text content translation. Trigger phrases: translate, 翻译,translate markdown, translate document, Chinese translation, batch translate.\",\n \"summary\": \"AI-powered translation skill for Claude that translates Markdown and text files between any language pair with high quality.\",\n \"icon\": \"📦\",\n \"version\": \"1.0.0\",\n \"author\": \"FuHehe12\",\n \"license\": \"MIT\",\n \"category\": \"writing\",\n \"tags\": [\n \"translation\",\n \"localization\",\n \"chinese\",\n \"multilingual\",\n \"document-processing\"\n ],\n \"supported_tools\": [\n \"claude\",\n \"codex\",\n \"claude-code\"\n ],\n \"risk_factors\": [\n \"external_commands\"\n ]\n },\n \"security_audit\": {\n \"risk_level\": \"low\",\n \"is_blocked\": false,\n \"safe_to_publish\": true,\n \"summary\": \"Static analysis flagged 137 potential issues, all of which are false positives. The skill uses Python scripts (split_md.py, merge_md.py) for legitimate file splitting/merging operations and shell commands (rm) for cleanup. No malicious command execution, cryptographic vulnerabilities, or reconnaissance behavior exists. This is a safe translation workflow tool.\",\n \"risk_factor_evidence\": [\n {\n \"factor\": \"external_commands\",\n \"evidence\": [\n {\n \"file\": \"references/refinement-guide.md\",\n \"line_start\": 30,\n \"line_end\": 49\n },\n {\n \"file\": \"references/refinement-guide.md\",\n \"line_start\": 49,\n \"line_end\": 52\n },\n {\n \"file\": \"references/refinement-guide.md\",\n \"line_start\": 52,\n \"line_end\": 53\n },\n {\n \"file\": \"references/refinement-guide.md\",\n \"line_start\": 53,\n \"line_end\": 55\n },\n {\n \"file\": \"references/refinement-guide.md\",\n \"line_start\": 55,\n \"line_end\": 56\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 11,\n \"line_end\": 11\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 12,\n \"line_end\": 12\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 13,\n \"line_end\": 13\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 14,\n \"line_end\": 14\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 14,\n \"line_end\": 14\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 14,\n \"line_end\": 14\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 15,\n \"line_end\": 15\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 16,\n \"line_end\": 16\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 51,\n \"line_end\": 51\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 68,\n \"line_end\": 68\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 76,\n \"line_end\": 81\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 3,\n \"line_end\": 3\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 10,\n \"line_end\": 10\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 18,\n \"line_end\": 18\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 22,\n \"line_end\": 22\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 23,\n \"line_end\": 23\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 24,\n \"line_end\": 24\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 28,\n \"line_end\": 28\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 29,\n \"line_end\": 29\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 30,\n \"line_end\": 30\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 31,\n \"line_end\": 31\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 32,\n \"line_end\": 32\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 33,\n \"line_end\": 33\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 34,\n \"line_end\": 34\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 35,\n \"line_end\": 35\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 39,\n \"line_end\": 39\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 40,\n \"line_end\": 40\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 41,\n \"line_end\": 41\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 45,\n \"line_end\": 45\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 47,\n \"line_end\": 47\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 53,\n \"line_end\": 53\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 54,\n \"line_end\": 54\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 55,\n \"line_end\": 55\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 56,\n \"line_end\": 56\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 62,\n \"line_end\": 62\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 63,\n \"line_end\": 63\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 64,\n \"line_end\": 64\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 65,\n \"line_end\": 65\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 69,\n \"line_end\": 69\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 70,\n \"line_end\": 70\n },\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 71,\n \"line_end\": 71\n },\n {\n \"file\": \"references/user-glossary.md\",\n \"line_start\": 3,\n \"line_end\": 3\n },\n {\n \"file\": \"scripts/merge_md.py\",\n \"line_start\": 95,\n \"line_end\": 118\n },\n {\n \"file\": \"scripts/merge_md.py\",\n \"line_start\": 118,\n \"line_end\": 124\n },\n {\n \"file\": \"scripts/merge_md.py\",\n \"line_start\": 124,\n \"line_end\": 149\n },\n {\n \"file\": \"scripts/split_md.py\",\n \"line_start\": 55,\n \"line_end\": 80\n },\n {\n \"file\": \"scripts/split_md.py\",\n \"line_start\": 80,\n \"line_end\": 80\n },\n {\n \"file\": \"scripts/split_md.py\",\n \"line_start\": 80,\n \"line_end\": 87\n },\n {\n \"file\": \"scripts/split_md.py\",\n \"line_start\": 87,\n \"line_end\": 115\n },\n {\n \"file\": \"scripts/split_md.py\",\n \"line_start\": 115,\n \"line_end\": 217\n },\n {\n \"file\": \"scripts/split_md.py\",\n \"line_start\": 217,\n \"line_end\": 251\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 54,\n \"line_end\": 54\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 67,\n \"line_end\": 67\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 67,\n \"line_end\": 67\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 75,\n \"line_end\": 75\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 79,\n \"line_end\": 79\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 80,\n \"line_end\": 80\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 80,\n \"line_end\": 80\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 80,\n \"line_end\": 80\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 81,\n \"line_end\": 81\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 82,\n \"line_end\": 82\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 109,\n \"line_end\": 109\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 110,\n \"line_end\": 110\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 111,\n \"line_end\": 111\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 113,\n \"line_end\": 113\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 114,\n \"line_end\": 114\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 115,\n \"line_end\": 115\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 118,\n \"line_end\": 118\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 118,\n \"line_end\": 118\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 122,\n \"line_end\": 122\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 127,\n \"line_end\": 127\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 127,\n \"line_end\": 127\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 130,\n \"line_end\": 132\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 132,\n \"line_end\": 133\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 133,\n \"line_end\": 133\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 133,\n \"line_end\": 133\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 133,\n \"line_end\": 133\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 133,\n \"line_end\": 133\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 133,\n \"line_end\": 140\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 140,\n \"line_end\": 141\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 141,\n \"line_end\": 141\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 141,\n \"line_end\": 149\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 149,\n \"line_end\": 150\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 150,\n \"line_end\": 151\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 151,\n \"line_end\": 152\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 152,\n \"line_end\": 154\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 154,\n \"line_end\": 154\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 154,\n \"line_end\": 154\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 154,\n \"line_end\": 160\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 160,\n \"line_end\": 163\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 163,\n \"line_end\": 164\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 164,\n \"line_end\": 167\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 167,\n \"line_end\": 167\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 167,\n \"line_end\": 192\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 192,\n \"line_end\": 206\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 206,\n \"line_end\": 208\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 208,\n \"line_end\": 216\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 216,\n \"line_end\": 226\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 226,\n \"line_end\": 246\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 246,\n \"line_end\": 246\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 246,\n \"line_end\": 247\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 247,\n \"line_end\": 249\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 249,\n \"line_end\": 252\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 252,\n \"line_end\": 254\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 254,\n \"line_end\": 255\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 255,\n \"line_end\": 256\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 256,\n \"line_end\": 257\n }\n ]\n }\n ],\n \"critical_findings\": [],\n \"high_findings\": [],\n \"medium_findings\": [\n {\n \"title\": \"External Command Execution (False Positive)\",\n \"description\": \"Static analyzer flagged 112 instances of 'external_commands' (Ruby/shell backtick execution). These are legitimate file operations: python scripts (split_md.py, merge_md.py) for markdown file processing, and rm commands for temporary file cleanup. No user input is passed to these commands - they operate on fixed file paths within the translation workflow.\",\n \"locations\": [\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 130,\n \"line_end\": 132\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 206,\n \"line_end\": 208\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 249,\n \"line_end\": 251\n }\n ],\n \"confidence\": 0.9,\n \"confidence_reasoning\": \"The flagged commands are standard utility operations for file splitting/merging and cleanup - essential functions for a document translation workflow.\"\n },\n {\n \"title\": \"Weak Cryptographic Algorithm (False Positive)\",\n \"description\": \"Static analyzer flagged 'weak cryptographic algorithm' in multiple reference files. This is a false positive triggered by keywords like 'shared' (detected as 'sh' or 'sha') in normal English text. No actual cryptographic code exists in this skill.\",\n \"locations\": [\n {\n \"file\": \"references/translation-brief-template.md\",\n \"line_start\": 18,\n \"line_end\": 18\n },\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 54,\n \"line_end\": 54\n }\n ],\n \"confidence\": 0.85,\n \"confidence_reasoning\": \"The analyzer uses keyword heuristics that trigger on common English words like 'shared', 'hash' - no cryptographic functions present.\"\n },\n {\n \"title\": \"System Reconnaissance (False Positive)\",\n \"description\": \"Static analyzer flagged 'system reconnaissance' in several locations. This is a false positive triggered by legitimate file path operations (glob, path traversal) used to read reference files and manage translation resources.\",\n \"locations\": [\n {\n \"file\": \"SKILL.md\",\n \"line_start\": 61,\n \"line_end\": 61\n },\n {\n \"file\": \"references/subagent-prompt.md\",\n \"line_start\": 52,\n \"line_end\": 52\n }\n ],\n \"confidence\": 0.85,\n \"confidence_reasoning\": \"File path operations are standard for a document processing skill - reading from references/ directory and managing temp files is legitimate behavior.\"\n }\n ],\n \"low_findings\": [],\n \"dangerous_patterns\": [],\n \"files_scanned\": 9,\n \"total_lines\": 1379,\n \"audit_model\": \"claude\",\n \"audited_at\": \"2026-02-21T00:47:15.237Z\"\n },\n \"content\": {\n \"user_title\": \"Translate documents between any language pair\",\n \"value_statement\": \"This skill enables Claude to accurately translate Markdown and text documents between any language pair with high quality. It handles single files, large documents via splitting, and batch multi-file translation with consistent terminology.\",\n \"seo_keywords\": [\n \"translate\",\n \"translation\",\n \"localization\",\n \"Claude translate\",\n \"Claude Code translate\",\n \"Codex translate\",\n \"Markdown translation\",\n \"Chinese translation\",\n \"multilingual\",\n \"document translation\"\n ],\n \"actual_capabilities\": [\n \"Translate Markdown and plain text files between any language pair\",\n \"Handle large files (over 1000 lines) by splitting, translating in parallel, and merging\",\n \"Batch translate multiple files with consistent terminology via shared glossary\",\n \"Maintain translation style consistency using user-defined style samples\",\n \"Support multiple Chinese locales (zh-CN, zh-TW, zh-HK) with regional terminology\",\n \"Process terminology annotations and build persistent user glossary\"\n ],\n \"limitations\": [\n \"Only supports Markdown and plain text input files\",\n \"Requires conversion of other formats (PDF, Word, HTML) to Markdown first\",\n \"Code blocks are preserved in original form without translation\",\n \"Does not handle image-based text (OCR not supported)\"\n ],\n \"use_cases\": [\n {\n \"title\": \"Translate technical documentation to Chinese\",\n \"description\": \"Convert English API docs, README files, or technical guides into fluent Chinese while preserving code blocks and formatting.\",\n \"target_user\": \"Developers and technical writers localizing their documentation\"\n },\n {\n \"title\": \"Batch translate multi-file projects\",\n \"description\": \"Translate entire documentation folders with consistent terminology across all files using a shared glossary.\",\n \"target_user\": \"Open source project maintainers localizing to multiple languages\"\n },\n {\n \"title\": \"Maintain translation memory with glossary\",\n \"description\": \"Build and persist a personal glossary of domain-specific terms that improves translation consistency over time.\",\n \"target_user\": \"Translators working on ongoing projects with specialized vocabulary\"\n }\n ],\n \"prompt_templates\": [\n {\n \"title\": \"Simple text translation\",\n \"prompt\": \"Translate the following text from English to Chinese (zh-CN):\\n\\n[Your text here]\",\n \"scenario\": \"Quick translation of short text passages\"\n },\n {\n \"title\": \"Translate Markdown file\",\n \"prompt\": \"Use the translate skill to translate the file [filename.md] to Chinese. The file is located at [path/to/file.md].\",\n \"scenario\": \"Translating a single Markdown document while preserving formatting\"\n },\n {\n \"title\": \"Batch translate with glossary\",\n \"prompt\": \"Use the translate skill to translate all Markdown files in the [docs/] directory to Chinese. Ensure consistent terminology using the existing user glossary.\",\n \"scenario\": \"Translating multiple files with consistent terminology\"\n },\n {\n \"title\": \"Large file parallel translation\",\n \"prompt\": \"Use the translate skill to translate the large file [large-document.md] to Chinese. The file has over 2000 lines, so please use parallel processing via sub-agents.\",\n \"scenario\": \"Translating long documents efficiently using split-merge workflow\"\n }\n ],\n \"output_examples\": [\n {\n \"input\": \"Translate: When you deploy a model to production, it is important to note that latency can vary significantly depending on the batch size.\",\n \"output\": \"模型上线后,延迟会因批量大小而明显波动。\"\n },\n {\n \"input\": \"Source: I've been playing around with this framework for about two weeks now, and honestly? It's kind of blown my mind.\",\n \"output\": \"这个框架我折腾了差不多两周,说实话?有点上头。\"\n }\n ],\n \"best_practices\": [\n \"Provide context about the document type (technical, creative, formal) for better tone matching\",\n \"Build and maintain a user glossary for domain-specific terminology consistency\",\n \"For large files, let the skill use sub-agents for parallel processing to save time\"\n ],\n \"anti_patterns\": [\n \"Asking to translate non-text formats like PDF or images without converting to Markdown first\",\n \"Expecting code blocks and URLs to be translated (they are preserved as-is)\",\n \"Skipping the glossary build phase for technical content with specialized terminology\"\n ],\n \"faq\": [\n {\n \"question\": \"What file formats does this skill support?\",\n \"answer\": \"This skill supports Markdown (.md) and plain text (.txt) files. Other formats like PDF, Word documents, or HTML must be converted to Markdown first.\"\n },\n {\n \"question\": \"How does the skill handle very large files?\",\n \"answer\": \"For files over 1000 lines, the skill splits the file into segments, translates them in parallel using sub-agents, and then merges the results into a single translated file.\"\n },\n {\n \"question\": \"Can I use this skill for languages other than Chinese?\",\n \"answer\": \"Yes, the skill supports translation between any language pair. Simply specify the source and target language when requesting translation.\"\n },\n {\n \"question\": \"How does the glossary work?\",\n \"answer\": \"The skill maintains a user glossary file that accumulates terms over time. You can add domain-specific terms that will be applied consistently across all translations.\"\n },\n {\n \"question\": \"Will code blocks be translated?\",\n \"answer\": \"No, code blocks are preserved in their original form. Only comments within code may be translated if you request it.\"\n },\n {\n \"question\": \"What is the difference between zh-CN, zh-TW, and zh-HK locales?\",\n \"answer\": \"These represent different Chinese regional variants. zh-CN is Simplified Chinese (mainland), zh-TW is Traditional Chinese (Taiwan), and zh-HK is Traditional Chinese (Hong Kong). Each has distinct vocabulary and formatting conventions.\"\n }\n ]\n },\n \"file_structure\": [\n {\n \"name\": \"references\",\n \"type\": \"dir\",\n \"path\": \"references\",\n \"children\": [\n {\n \"name\": \"locale-styles.md\",\n \"type\": \"file\",\n \"path\": \"references/locale-styles.md\",\n \"lines\": 161\n },\n {\n \"name\": \"refinement-guide.md\",\n \"type\": \"file\",\n \"path\": \"references/refinement-guide.md\",\n \"lines\": 65\n },\n {\n \"name\": \"subagent-prompt.md\",\n \"type\": \"file\",\n \"path\": \"references/subagent-prompt.md\",\n \"lines\": 84\n },\n {\n \"name\": \"translation-brief-template.md\",\n \"type\": \"file\",\n \"path\": \"references/translation-brief-template.md\",\n \"lines\": 72\n },\n {\n \"name\": \"user-glossary.md\",\n \"type\": \"file\",\n \"path\": \"references/user-glossary.md\",\n \"lines\": 62\n },\n {\n \"name\": \"user-samples.md\",\n \"type\": \"file\",\n \"path\": \"references/user-samples.md\",\n \"lines\": 55\n }\n ]\n },\n {\n \"name\": \"scripts\",\n \"type\": \"dir\",\n \"path\": \"scripts\",\n \"children\": [\n {\n \"name\": \"merge_md.py\",\n \"type\": \"file\",\n \"path\": \"scripts/merge_md.py\",\n \"lines\": 258\n },\n {\n \"name\": \"split_md.py\",\n \"type\": \"file\",\n \"path\": \"scripts/split_md.py\",\n \"lines\": 351\n }\n ]\n },\n {\n \"name\": \"SKILL.md\",\n \"type\": \"file\",\n \"path\": \"SKILL.md\",\n \"lines\": 271\n }\n ]\n}\n","content_type":"application/json; charset=utf-8","language":"json","size":27396,"content_sha256":"1f4bf18c8ade00764979d8e65f5fbdbd451c4c377ed61cea01d2cd19dd6cd846"}],"content_json":{"type":"doc","content":[{"type":"paragraph","content":[{"text":"This skill provides guidelines for accurate, fluent translation, with agent-based parallel processing for large files and multi-file batches.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"On Translation","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Translation is writing across languages","type":"text","marks":[{"type":"strong"}]},{"text":" — rendering content expressed in one language into another, minimizing the gap between them.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"Good translation goes beyond conveying information accurately. It re-expresses that information in language that is beautiful and natural, capturing the spirit of the original author. When readers encounter the translation, they should feel the piece was written in their language from the start — not carried over from a foreign one. Through parallel processing, this standard is maintained even for long texts and multi-file batches.","type":"text"}]},{"type":"paragraph","content":[{"text":"Core anchor","type":"text","marks":[{"type":"strong"}]},{"text":": Translation is writing — not conversion, but re-expression.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Principles","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Imagination brings something into presence; translation gives what has come into presence a voice in another language.","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"The Nature of Translation: Reconstruct → Negotiate → Write","type":"text"}]},{"type":"paragraph","content":[{"text":"Translation is not word-for-word conversion. It is a three-step process:","type":"text"}]},{"type":"paragraph","content":[{"text":"Step 1: Reconstruct — Build the Imaginative Space","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"After reading the source text, construct a complete \"imaginative space\" in your mind. Different types of text generate fundamentally different spaces:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Fiction → a world of characters, scenes, and emotions that you inhabit","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Technical documentation → an expert explaining to a student, and you are listening in","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Academic paper → a rigorous argument unfolding, and you are tracking the chain of reasoning","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Blog post → a friend talking to you, sharing experience and insight","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Product copy → someone demonstrating the value of something to you","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"This is not simply \"understanding the text\" — it is immersion. It means letting the intentional content of the source text manifest in consciousness (Husserl's eidetic intuition), letting absent scenes become present in the mind (Sartre's theory of imagination), and entering the text to grasp its flowing totality (Bergson's intuition). The quality of this imaginative space sets the ceiling for the translation.","type":"text"}]},{"type":"paragraph","content":[{"text":"The output of reconstruction does not stay at the level of \"feeling\" — it must be crystallized into the \"translation tone\" field of the translation brief: surface features such as person and register, and deeper features such as emotional register, narrative rhythm, lexical preferences, signature expressions, the movement of thought, and a sketch of the original \"voice.\" These fields serve as the style baseline for all subsequent translation and sub-agent alignment.","type":"text"}]},{"type":"paragraph","content":[{"text":"Step 2: Negotiate — Enter into Dialogue with the Source","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Once inside the imaginative space, you are not a passive observer but an interlocutor who can \"question the author\":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"What is this word actually trying to express in this context?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"What is the closest way for my readers to understand this concept?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Is the author's tone here serious or ironic?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Does this metaphor have an equivalent in the target language's world?","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"This step is the \"negotiation\" phase of translation — where the translator exercises judgment and brings their own interpretive subjectivity to bear on the source. The glossary fixes unified renderings for key terms; the translation brief captures critical decisions. The more thorough the negotiation, the more fluent the writing that follows.","type":"text"}]},{"type":"paragraph","content":[{"text":"Step 3: Write — Compose in the Target Language","type":"text","marks":[{"type":"strong"}]},{"text":" (executed by sub-agents)","type":"text"}]},{"type":"paragraph","content":[{"text":"Writing is the ceiling of translation — when comprehension is sound and negotiation is thorough, all remaining quality differences come down to craft. The primary agent does not execute writing directly in this step; its role is to ensure the translation brief provides sub-agents with a sufficient style baseline. The five dimensions of writing (precision, rhythm, register, naturalness, locale) and their specific requirements are detailed in the \"Five Elements of Writing\" section of ","type":"text"},{"text":"references/subagent-prompt.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Strategy Must Be Adaptive","type":"text"}]},{"type":"paragraph","content":[{"text":"Hard-coded rules cannot cover every scenario. The same \"rule\" may be exactly inverted across different text types:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Passive voice: eliminate in technical docs → standard practice in academic papers","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Rhetorical devices: avoid in technical docs → essential in literary works","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Domestication vs. foreignization: user manuals favor domestication → cultural texts may call for strategic foreignization","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cognitive load: minimize aggressively in technical docs → literary works may legitimately challenge the reader","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Linguistic economy: pursue maximum concision in technical docs → prose may require elaboration and texture","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Regional vocabulary: mainland China uses \"软件、程序、网络\" → Taiwan uses \"軟體、程式、網路\" → Hong Kong is more heavily influenced by Cantonese","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Accordingly, writing craft (precision, rhythm, register, naturalness), translation techniques (domestication/foreignization, cognitive load management, long-sentence restructuring), and locale positioning (the target region's lexical system and expressive conventions) are not treated as fixed rules. They are ","type":"text"},{"text":"strategic dimensions","type":"text","marks":[{"type":"strong"}]},{"text":" that are adaptively determined in Phase 1 based on the characteristics of the source text and the target audience. Phase 1 produces two temporary files: a ","type":"text"},{"text":"glossary","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"_glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":") to standardize renderings of core terms, and a ","type":"text"},{"text":"translation brief","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"_translation_brief.md","type":"text","marks":[{"type":"code_inline"}]},{"text":") to capture text type, translation tone, target locale, key challenges, and targeted strategies.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Translation Workflow","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Path Conventions","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"SKILL_DIR","type":"text","marks":[{"type":"code_inline"}]},{"text":" = the directory containing this skill (the path following \"Base directory for this skill:\" in the system prompt).","type":"text"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Type","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Location","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Notes","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Skill resources (read-only)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{SKILL_DIR}/references/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"User-persisted files that accumulate over time","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Temporary files","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Same directory as source file","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"_glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"_translation_brief.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"_tone_sample.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Split segments","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"_parts/","type":"text","marks":[{"type":"code_inline"}]},{"text":" subdirectory of source file directory","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Segments and manifest for large-file splits","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Output file","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Same directory as source file","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{filename}_zh.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (suffix matches target language)","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 0: Input Analysis","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill handles ","type":"text"},{"text":"Markdown and plain text","type":"text","marks":[{"type":"strong"}]},{"text":". Other formats (web pages, PDFs, Word documents, images, etc.) must be converted to Markdown before invoking this skill.","type":"text"}]},{"type":"paragraph","content":[{"text":"Language detection","type":"text","marks":[{"type":"strong"}]},{"text":": Source language is detected automatically. The default target language is Chinese (zh-CN); the user may specify a different target language or locale.","type":"text"}]},{"type":"paragraph","content":[{"text":"Scale assessment and strategy","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Scenario","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Strategy","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Single file ≤ 1000 lines","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Primary agent translates directly","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Single file > 1000 lines","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Split → tone anchoring → parallel → merge","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Multiple files","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Shared glossary and translation brief → tone anchoring → parallel processing","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"Decision logic","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Single file ≤ 1000 lines → proceed immediately, no user confirmation needed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Single file > 1000 lines or multiple files → report the plan to the user (file count, total line count, translation strategy) and wait for confirmation before proceeding","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 1: Read-Through and Preparation","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"This is the foundation of translation quality.","type":"text","marks":[{"type":"strong"}]},{"text":" The full text must be understood before any translation begins.","type":"text"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read through the full text","type":"text","marks":[{"type":"strong"}]},{"text":": Understand the topic, argument structure, and writing style to form a holistic impression.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load user-persisted files","type":"text","marks":[{"type":"strong"}]},{"text":" (paths relative to ","type":"text"},{"text":"SKILL_DIR","type":"text","marks":[{"type":"code_inline"}]},{"text":"; must be loaded using the Read tool):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"{SKILL_DIR}/references/user-glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" — the user's accumulated domain glossary","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"{SKILL_DIR}/references/user-samples.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" — the user's preferred translation style samples","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load each file if it exists; skip without error if it does not (these files accumulate gradually over time).","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract the glossary","type":"text","marks":[{"type":"strong"}]},{"text":" (write to temporary ","type":"text"},{"text":"_glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":"):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ground primarily in your read-through understanding, with ","type":"text"},{"text":"user-glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" as a supplementary reference.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"From ","type":"text"},{"text":"user-glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"import only entries relevant to the current document's domain","type":"text","marks":[{"type":"strong"}]},{"text":"; ignore unrelated domain terminology.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract new terms from the current document and merge with the filtered user-accumulated entries.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Three sections: terms to preserve as-is, standardized renderings, polysemous term handling.","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate the translation brief","type":"text","marks":[{"type":"strong"}]},{"text":" (following the template at ","type":"text"},{"text":"{SKILL_DIR}/references/translation-brief-template.md","type":"text","marks":[{"type":"code_inline"}]},{"text":"; write to temporary ","type":"text"},{"text":"_translation_brief.md","type":"text","marks":[{"type":"code_inline"}]},{"text":"):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Text type","type":"text","marks":[{"type":"strong"}]},{"text":": Technical documentation / Academic paper / Blog / Tutorial / Product copy / Other","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Translation tone","type":"text","marks":[{"type":"strong"}]},{"text":": Surface features (person, formality, tense preference) + deep features (emotional register, narrative rhythm, lexical preferences, signature expressions, the movement of thought, a sketch of the original \"voice\")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Language pair","type":"text","marks":[{"type":"strong"}]},{"text":": Source language (auto-detected) → target language (default: Chinese)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Target locale","type":"text","marks":[{"type":"strong"}]},{"text":": Determine the locale (default: zh-CN), which governs lexical choices, terminology, and expressive conventions. Regional differences are documented in ","type":"text"},{"text":"references/locale-styles.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reader profile","type":"text","marks":[{"type":"strong"}]},{"text":": Who the translation is for, which affects vocabulary and depth of expression","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Key translation challenges","type":"text","marks":[{"type":"strong"}]},{"text":": Difficulties specific to this text","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Targeted strategies","type":"text","marks":[{"type":"strong"}]},{"text":": Concrete approaches for the challenges identified above","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cross-file consistency","type":"text","marks":[{"type":"strong"}]},{"text":" (multi-file scenarios): Shared glossary, shared brief, cross-file linkage","type":"text"}]}]}]}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"⚠️ ","type":"text"},{"text":"Steps 2–4 must be executed regardless of file size.","type":"text","marks":[{"type":"strong"}]},{"text":" For small files, the output can be brief — but it cannot be skipped. The purpose of the temporary files is to make translation decisions auditable and to give sub-agents an inheritable style baseline. ","type":"text"},{"text":"_glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"_translation_brief.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" are created in the ","type":"text"},{"text":"source file's directory","type":"text","marks":[{"type":"strong"}]},{"text":".","type":"text"}]}]},{"type":"ordered_list","attrs":{"order":5,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Split large files","type":"text","marks":[{"type":"strong"}]},{"text":" (if required):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python {SKILL_DIR}/scripts/split_md.py {source_file} --max-lines 600 --output-dir {source_dir}/_parts/","type":"text"}]},{"type":"paragraph","content":[{"text":"The script automatically generates: ","type":"text"},{"text":"_part_NN.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (segments), ","type":"text"},{"text":"_part_NN_context.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" (bridging context containing the last 5 lines of the preceding segment as ","type":"text"},{"text":"preceding_lines","type":"text","marks":[{"type":"code_inline"}]},{"text":" and the first 3 lines of the following segment as ","type":"text"},{"text":"following_lines","type":"text","marks":[{"type":"code_inline"}]},{"text":"), and ","type":"text"},{"text":"_split_manifest.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" (the manifest).","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 1.5: Tone Anchoring (Large-Scale Translations Only)","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Execute this phase when translating a single file > 1000 lines or multiple files, to ensure stylistic consistency.","type":"text"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Select a representative passage","type":"text","marks":[{"type":"strong"}]},{"text":": Choose a passage from the source that is content-rich and stylistically representative (300–500 lines), preferring paragraphs that mix technical description with narrative.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Primary agent translates this passage","type":"text","marks":[{"type":"strong"}]},{"text":": Translate it against the glossary and translation brief, producing a \"tone sample\" and writing it to ","type":"text"},{"text":"_tone_sample.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use of the tone sample","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"_tone_sample.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" is passed to all sub-agents alongside ","type":"text"},{"text":"user-samples.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" as a style reference anchor.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Small-scale translations (handled directly by the primary agent) skip this phase.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 2: Translation Execution","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Small-Scale (Primary Agent Translates Directly, ≤ 1000 Lines)","type":"text"}]},{"type":"paragraph","content":[{"text":"Translate the full text against the following three materials and output to ","type":"text"},{"text":"{filename}_zh.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (or the user-specified target language suffix) in the source file's directory:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"_glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (temporary glossary generated in Phase 1)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"_translation_brief.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (temporary translation brief generated in Phase 1)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"{SKILL_DIR}/references/user-samples.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (user style samples, if present)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"[TERM: ...]","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" annotations","type":"text","marks":[{"type":"strong"}]},{"text":": When a new term is encountered during translation that is not in ","type":"text"},{"text":"_glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", annotate it inline in the translation as ","type":"text"},{"text":"[TERM: original → suggested rendering]","type":"text","marks":[{"type":"code_inline"}]},{"text":". Do not list them separately; they will be processed in Phase 4.","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Large-Scale (Sub-Agents Translate in Parallel, > 1000 Lines)","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"⚠️ ","type":"text"},{"text":"Sub-agents are required","type":"text","marks":[{"type":"strong"}]},{"text":": Large-scale translations (> 1000 lines or multiple files) must be processed in parallel through sub-agents. The primary agent must not directly translate segments. The primary agent's responsibilities are preparation, task dispatch, and result verification.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"Dispatch a sub-agent for each segment using the template in ","type":"text"},{"text":"references/subagent-prompt.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"paragraph","content":[{"text":"Sub-agent configuration:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"subagent_type","type":"text","marks":[{"type":"code_inline"}]},{"text":": \"general-purpose\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"model","type":"text","marks":[{"type":"code_inline"}]},{"text":": \"sonnet\" (quality-first)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Multiple sub-agents launched in parallel","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Each sub-agent receives: source segment, glossary, translation brief, bridging context, user style samples, tone sample","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Output requirements","type":"text","marks":[{"type":"strong"}]},{"text":": Output must go to the designated ","type":"text"},{"text":"{part}_zh.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" file; generating merged files (e.g., ","type":"text"},{"text":"_part_47-50_zh.md","type":"text","marks":[{"type":"code_inline"}]},{"text":") is not permitted; translating beyond the assigned source range is not permitted.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Multi-file parallel strategy","type":"text","marks":[{"type":"strong"}]},{"text":": Use TaskCreate/TaskList to track translation progress for each file/segment, and ensure all tasks are complete before proceeding to the next phase.","type":"text"}]},{"type":"paragraph","content":[{"text":"Error recovery","type":"text","marks":[{"type":"strong"}]},{"text":" (with failure criteria):","type":"text"}]},{"type":"paragraph","content":[{"text":"A sub-agent is considered to have failed if any of the following conditions is met:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The output file does not exist.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The output line count is less than 30% of the source line count.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The output contains large blocks of untranslated source text (10 or more consecutive lines identical to the source).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The output filename does not match expectations (e.g., a merged file was generated instead of individual segment files).","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Handling procedure:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Sub-agent failure → retry once with sonnet.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Still failing → compile all failed segments, report the failure reasons and a list of affected segments to the user, and let the user decide how to proceed.","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The primary agent must not take over translation unless explicitly requested by the user.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 3: Verification","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Pre-Merge Verification","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Inspect all translated segments before merging","type":"text","marks":[{"type":"strong"}]},{"text":" to confirm they meet standards and reduce post-merge issues.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"Checklist","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Completeness check","type":"text","marks":[{"type":"strong"}]},{"text":": Confirm that all segments have a corresponding translated file.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Filename check","type":"text","marks":[{"type":"strong"}]},{"text":": Confirm there are no unexpected merged files (e.g., ","type":"text"},{"text":"_part_47-50_zh.md","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Scope check","type":"text","marks":[{"type":"strong"}]},{"text":": Spot-check several segments to confirm none extends beyond the source range.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Format compliance check","type":"text","marks":[{"type":"strong"}]},{"text":": Executed by sub-agents, verifying against the formatting requirements in the translation brief generated in Phase 1:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Heading hierarchy is contiguous","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Code blocks are properly closed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"List indentation is correct","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Table formatting is complete","type":"text"}]}]}]}]}]},{"type":"paragraph","content":[{"text":"Handling check failures","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Problem segments found → compile a list and report to the user","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ask the user whether corrections or re-translation are needed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Execute corrections or re-translation after user confirmation","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Automatic merge","type":"text","marks":[{"type":"strong"}]},{"text":" (split translations only):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python {SKILL_DIR}/scripts/merge_md.py --manifest {source_dir}/_parts/_split_manifest.json --output {source_dir}/{filename}_zh.md","type":"text"}]},{"type":"paragraph","content":[{"text":"The merge script automatically checks: heading hierarchy continuity, code block closure, and link integrity.","type":"text"}]},{"type":"paragraph","content":[{"text":"Primary agent review","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Confirm all sub-agent / segment translations are complete.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Execute the pre-merge verification (see checklist above).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Merge the split segments.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Process ","type":"text"},{"text":"[TERM: ...]","type":"text","marks":[{"type":"code_inline"}]},{"text":" annotations for new terms.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Large files: quickly inspect segment boundaries (5 lines on each side) to ensure contextual continuity.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Multiple files: run a cross-file terminology consistency scan.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Optional: Refinement","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"The translation philosophy emphasizes rewriting over sentence-by-sentence rendering; high-quality translation execution already internalizes awareness of translationese. Refinement is an ","type":"text"},{"text":"optional step","type":"text","marks":[{"type":"strong"}]},{"text":", considered in the following scenarios:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The user explicitly requests refinement.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The primary agent identifies obvious translationese or stylistic inconsistency during review.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Refinement is executed by sub-agents under primary agent oversight. See ","type":"text"},{"text":"references/refinement-guide.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for details.","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Post-Merge Quality Check (Optional)","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"This step requires user input.","type":"text","marks":[{"type":"strong"}]},{"text":" If the user wishes, sub-agents can perform a quality check.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"What is checked","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Format check","type":"text","marks":[{"type":"strong"}]},{"text":": Executed by sub-agents; checks formatting standards of the final merged file.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Terminology consistency","type":"text","marks":[{"type":"strong"}]},{"text":": Scans for consistent use of glossary terms throughout the translation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Translationese detection","type":"text","marks":[{"type":"strong"}]},{"text":": Checks for obvious translationese issues.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Stylistic consistency","type":"text","marks":[{"type":"strong"}]},{"text":": Spot-checks multiple sections to verify uniform translation style.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"How to execute","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ask the user whether to run the quality check.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"After user confirmation, sub-agents execute the check.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Compile findings into a list and report to the user.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The user decides whether corrections are needed.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 4: Output Cleanup","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Glossary writeback","type":"text","marks":[{"type":"strong"}]},{"text":" (mandatory; must not be skipped): Scan the translation for all ","type":"text"},{"text":"[TERM: ...]","type":"text","marks":[{"type":"code_inline"}]},{"text":" annotations, compile the list of new terms added in this session, present the list to the user, and ask whether to write them to ","type":"text"},{"text":"{SKILL_DIR}/references/user-glossary.md","type":"text","marks":[{"type":"code_inline"}]},{"text":". If there are no new terms, explicitly inform the user: \"No new terms were identified in this session.\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Confirm the output file (","type":"text"},{"text":"{filename}_zh.md","type":"text","marks":[{"type":"code_inline"}]},{"text":"; the source file is never overwritten).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Clean up temporary files:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"rm -f _glossary.md _translation_brief.md _tone_sample.md\nrm -rf _parts/","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Files that are not cleaned up","type":"text","marks":[{"type":"strong"}]},{"text":" (user-persisted assets):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/user-glossary.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/user-samples.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/translation-brief-template.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/locale-styles.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Important Notes","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Never overwrite the source file","type":"text","marks":[{"type":"strong"}]},{"text":": Output files receive a language suffix (default: the target language code).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not translate code blocks","type":"text","marks":[{"type":"strong"}]},{"text":": This includes both inline code and fenced code blocks; comments within code may be translated.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Preserve original formatting","type":"text","marks":[{"type":"strong"}]},{"text":": Heading hierarchy, list indentation, table alignment, and blank line separation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Link handling","type":"text","marks":[{"type":"strong"}]},{"text":": Translate link text; leave URLs unchanged.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"YAML frontmatter","type":"text","marks":[{"type":"strong"}]},{"text":": Preserve as-is without translating.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Default target locale","type":"text","marks":[{"type":"strong"}]},{"text":": Defaults to Chinese mainland readers (zh-CN); other locales may be specified in the translation brief.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Glossary takes precedence","type":"text","marks":[{"type":"strong"}]},{"text":": Renderings specified in the glossary must be followed consistently throughout the entire text.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Source language is unrestricted","type":"text","marks":[{"type":"strong"}]},{"text":": Any source language is supported; the detected language is recorded in the translation brief.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"translate","author":"@skillopedia","source":{"stars":336,"repo_name":"marketplace","origin_url":"https://github.com/aiskillstore/marketplace/blob/HEAD/skills/fuhehe12/translate/SKILL.md","repo_owner":"aiskillstore","body_sha256":"247159d768b5e1cc452bf159390f894e4b8e6ed7c62a5aeb7c9bf5cd375289d0","cluster_key":"4beef057d490104aed82fcfebb68f116b0107dfceee1bfd02dca4f3a07b62363","clean_bundle":{"format":"clean-skill-bundle-v1","source":"aiskillstore/marketplace/skills/fuhehe12/translate/SKILL.md","attachments":[{"id":"cf97899d-78e8-5bf4-bb58-e3436c1376cc","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cf97899d-78e8-5bf4-bb58-e3436c1376cc/attachment.md","path":"references/locale-styles.md","size":5561,"sha256":"b696e3611b6e88c9bc78527c0e0f6e32178ee562a2ade949f6b83cb65cc82023","contentType":"text/markdown; charset=utf-8"},{"id":"fadb5a0a-ff2b-5c78-aae2-5f39e8da130a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/fadb5a0a-ff2b-5c78-aae2-5f39e8da130a/attachment.md","path":"references/refinement-guide.md","size":3314,"sha256":"6f233def86f9a9b6035c6ca1641174dadcbf1907258cd9c42087dd260ae26bb4","contentType":"text/markdown; charset=utf-8"},{"id":"31a5a411-91c6-5d4e-a86d-c9a6db98b2ef","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/31a5a411-91c6-5d4e-a86d-c9a6db98b2ef/attachment.md","path":"references/subagent-prompt.md","size":5756,"sha256":"3b101bc6b08c09442bbf84612176b522a1b38b49e23bb5693100d4da578df2d5","contentType":"text/markdown; charset=utf-8"},{"id":"0b5e1cbd-e093-5c20-93a6-0fb972d70e68","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0b5e1cbd-e093-5c20-93a6-0fb972d70e68/attachment.md","path":"references/translation-brief-template.md","size":4526,"sha256":"07d3e8b754a38ebbc3737f8cff13c499ddabd031c259719aa8b765acd85f2c9c","contentType":"text/markdown; charset=utf-8"},{"id":"6a7dc0ce-f616-5f04-910f-510bdf1ee6c0","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6a7dc0ce-f616-5f04-910f-510bdf1ee6c0/attachment.md","path":"references/user-glossary.md","size":2511,"sha256":"bf0ba78d2107851c19812a163f61befda9200cf7a17049aaf971e2226f018e90","contentType":"text/markdown; charset=utf-8"},{"id":"f2e8b198-b1d5-5991-b01b-112464ebac83","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f2e8b198-b1d5-5991-b01b-112464ebac83/attachment.md","path":"references/user-samples.md","size":3050,"sha256":"d87bf239da82f4bfcee0ea6bab72c502a1fca142c56038cffc592bbbe84f4ba5","contentType":"text/markdown; charset=utf-8"},{"id":"dff105a4-113f-5404-aa10-6cc5b98c8350","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/dff105a4-113f-5404-aa10-6cc5b98c8350/attachment.py","path":"scripts/merge_md.py","size":8144,"sha256":"13277356832fb461cceee5c36542a2ba719630eb3af65f3e7daa291a15656783","contentType":"text/x-python; charset=utf-8"},{"id":"975d1c08-429d-58e6-ac38-743dab75fd8d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/975d1c08-429d-58e6-ac38-743dab75fd8d/attachment.py","path":"scripts/split_md.py","size":11357,"sha256":"fc2451b1bb48f2a17c40d3ade36a89349e33f39bebe0e91dc07c956ce69c921a","contentType":"text/x-python; charset=utf-8"},{"id":"04b84e21-90cf-5f80-8721-6c355f26ff83","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/04b84e21-90cf-5f80-8721-6c355f26ff83/attachment.json","path":"skill-report.json","size":27396,"sha256":"1f4bf18c8ade00764979d8e65f5fbdbd451c4c377ed61cea01d2cd19dd6cd846","contentType":"application/json; charset=utf-8"}],"bundle_sha256":"b6f591f0ae5c019c445b507a9e78d5126ba24c7c950bd53e4c5827d00d9183d3","attachment_count":9,"text_attachments":9,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/fuhehe12/translate/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"documents-office","category_label":"Documents"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"documents-office","import_tag":"clean-skills-v1","description":"Accurately and fluently translates source text into another language, supporting any language pair. Default target language is Chinese. Use this skill when the user requests translation of Markdown files, batch document translation, or text content translation. Trigger phrases: translate, 翻译,translate markdown, translate document, Chinese translation, batch translate.","allowed-tools":"Read, Write, Edit, Task, Glob, Grep, Bash"}},"renderedAt":1782980368347}

This skill provides guidelines for accurate, fluent translation, with agent-based parallel processing for large files and multi-file batches. On Translation Translation is writing across languages — rendering content expressed in one language into another, minimizing the gap between them. Good translation goes beyond conveying information accurately. It re-expresses that information in language that is beautiful and natural, capturing the spirit of the original author. When readers encounter the translation, they should feel the piece was written in their language from the start — not carried…