with one click
yiyue31-translator
// 当用户输入”翻译”,”translate” “translate article”, “translate to Chinese”, “改成中文”,”convert to Chinese”等指令时启用。当用户提供url、文件路径、直接粘贴内容,并表达翻译意图时启用。
// 当用户输入”翻译”,”translate” “translate article”, “translate to Chinese”, “改成中文”,”convert to Chinese”等指令时启用。当用户提供url、文件路径、直接粘贴内容,并表达翻译意图时启用。
| name | yiyue31-translator |
| description | 当用户输入"翻译","translate" "translate article", "translate to Chinese", "改成中文","convert to Chinese"等指令时启用。当用户提供url、文件路径、直接粘贴内容,并表达翻译意图时启用。 |
| version | 2.0.0 |
| author | Yiyue31 |
Professional translator that converts English articles to Chinese with topic-based glossary management, translation style selection, and a generate-evaluate loop for translation quality assurance.
{skill-dir} = this SKILL.md's directory path. It means the directory where this SKILL.md is located.
User should provide one of the following:
Iterative refinement: generate → evaluate → revise. Used by Step 2 and Step 4.
Parameters (caller provides):
{max-rounds}: Maximum iterations{threshold}: Passing score out of 10{eval-prompt}: Path to evaluation prompt file{round-file}: Save pattern for round N output (include {N} placeholder for round number){final-file}: Final output path on pass{eval-file}: Save pattern for evaluation report (include {N} placeholder){eval-context}: Additional context to pass to evaluator (original article, glossary, style, etc.){timer-tag}: Optional timer tag for global timeout. When set, also provide {timeout-seconds}.Procedure:
{timer-tag} provided: node {skill-dir}/scripts/timer.js start --tag {timer-tag}.{max-rounds}):
{timer-tag} provided: node {skill-dir}/scripts/timer.js check --tag {timer-tag} --timeout {timeout-seconds}. If "expired": true → use best candidate as final → exit.{round-file} (replace {N} with round number).{eval-prompt}, providing round output and {eval-context} as input. Save report to {eval-file} (replace {N}).**[X/10]** total line from evaluation report. Score ≥ {threshold} → copy to {final-file} → PASS, exit loop. Score < {threshold} → track as best candidate if highest so far, next round.{final-file}, report score.Single-shot evaluation, no loop.
Parameters: {eval-prompt}, {input-file}, {output-file}, {threshold} (default 8.0).
Procedure: Call subagent with {eval-prompt}, providing {input-file} content. Save report to {output-file}. Extract total score from **[X/10]** line. Score ≥ {threshold} → PASS, else FAIL.
Retrieve article content based on input type:
wget or curl.Read tool.Processing:
untitled-{timestamp}). Sanitize filesystem-unsafe characters (/ \ : * ? " < > |).{title}/translation/ exists, delete it.{title}/translation/original-{title}.md.Analysis requirements:
{skill-dir}/glossary/. Extract title, h2/h3 headings, keywords. Match against glossary topics. AI determines best topic — notify user, no confirmation needed.{skill-dir}/glossary/{topic}.md, identify terms to keep in English. Scan for terms not in glossary.Run Generate-Evaluate Loop:
{max-rounds}: 3, {threshold}: 8.0{eval-prompt}: {skill-dir}/references/evaluate-topic-prompt.md{round-file}: {title}/translation/analysis-topic-round{N}-{title}.md{final-file}: {title}/translation/analysis-topic-{title}.md{eval-file}: {title}/translation/evaluation-topic-round{N}-{title}.md{eval-context}: original article content, glossary file list from {skill-dir}/glossary/After loop passes — user interaction:
Display to user:
## Article Analysis
**Original Title**: {Original English Title}
**Language**: {from} → {to}
**Identified Topic**: {Topic Name}
**Glossary Loaded**: {skill-dir}/glossary/{topic}.md ({N} terms)
**New Terms**: {list of new terms found}
{skill-dir}/glossary/{topic}.md.| Option | Description |
|---|---|
| Literal | Word-by-word, preserve original structure, suitable for technical docs |
| Free | Adapt to Chinese conventions, restructure sentences, suitable for blogs |
Default: Literal.
Exclusions: Skip terms already in the glossary.
Targets and translation rules:
Output format:
| Location | Original | Chinese Translation (English original) |
|---|---|---|
| 1.2 | "This approach allows us to hit the ground running." | "这种方法让我们能够立刻投入工作(hit the ground running)" |
Save to: {title}/translation/special-phrases-{title}.md.
Translation rules:
Prompt(提示词)).{skill-dir}/references/markdown-format-checklist.md.Chinese(English original, explanation).**{golden quote}**.Free translation additional rules (skip when Literal):
Run Generate-Evaluate Loop:
{max-rounds}: 5, {threshold}: 8.0{eval-prompt}: {skill-dir}/references/evaluate-translation-prompt.md{round-file}: {title}/translation/translated-round{N}-{title}-zh.md{final-file}: {title}/translation/translated-{title}-zh.md{eval-file}: {title}/translation/evaluation-round{N}-{title}.md{timer-tag}: {title}, {timeout-seconds}: 1800{eval-context}: original article, glossary, translation style (Literal/Free), special phrases table from Step 3After each round save, run word count: node {skill-dir}/scripts/word-counter.js {title}/translation/translated-round{N}-{title}-zh.md, display results.
After loop completes:
---
title: {translated title}
source_title: {original English title}
source_url: {url or empty}
source_author: {author or empty}
translated_at: {date}
translation_style: literal or free
topic: {topic}
language: English → Chinese
word_count: {from word-counter}
---
node {skill-dir}/scripts/word-counter.js {title}/translation/translated-{title}-zh.mdFile location: {skill-dir}/glossary/{topic}.md
# Topic: {Topic Name}
| English Term | Translation |
|--------------|-------------|
| AI | [KEEP] |
| Agent | 智能体 |
| API Gateway | API 网关 |
[HINT] Download the complete skill directory including SKILL.md and all related files