agentleFS
JimLiuJimLiu/baoyu-skills/skills/baoyu-translate/SKILL.md

baoyu-translate

Skill27k starsChanged 6 months agoMITView on GitHub

This skill should be used when the user asks to "translate", "翻译", "精翻", "translate article", "translate to Chinese", "translate to English", "改成中文", "改成英文", "convert to Chinese", "localize", "本地化", "refined translation", "精细翻译", "proofread translation", "快速翻译", "快翻", "这篇文章翻译一下", or provides a URL/file with translation intent. Supports three modes (quick/normal/refined) with custom glossary support.

4 other projects use a version of this, 4 of them edited; 4 of 4 edited versions we compared changed its rules.

How people change it

4 of 4 edited versions changed its rules, and some changes recur.

Of the 4 edited versions we compared: 4 made changes of their own.

Rules people drop

  1. Check EXTEND.md (see Preferences)dropped by 4 of 4
  2. All intermediate and final files go in the output directory:dropped by 4 of 4
  3. Quick mode never chunks. If content exceeds the chunk threshold, warn: "This article is ~{N} words. …dropped by 4 of 4
  4. Assemble prompt: read 01-analysis.md (if it exists) and build shared context with Part 1 of [references/subagent-prompt-template.md](references/subagent-prompt-template.md), inlining target style, content background, merged glossary, and translation …dropped by 4 of 4
  5. Keep all intermediate files in chunks/dropped by 4 of 4
  6. After merging, the main agent takes over for review, revision, and polish (Step 4).dropped by 4 of 4
  7. Rewrite, not translate: write natural, engaging target language as if a skilled native writer composed it. Test: "Does this read like it was originally written in the target language?"dropped by 4 of 4
  8. When this skill prompts the user, follow this tool-selection rule (priority order):dropped by 3 of 4

Rules people add

  1. A rule we can't quote: its licence doesn't allow itadded by 4 of 4
  2. A rule we can't quote: its licence doesn't allow itadded by 4 of 4
  3. A rule we can't quote: its licence doesn't allow itadded by 4 of 4
  4. A rule we can't quote: its licence doesn't allow itadded by 4 of 4
  5. A rule we can't quote: its licence doesn't allow itadded by 4 of 4
  6. A rule we can't quote: its licence doesn't allow itadded by 4 of 4
  7. A rule we can't quote: its licence doesn't allow itadded by 4 of 4
  8. A rule we can't quote: its licence doesn't allow itadded by 4 of 4

We split this file and each edited version into the rules they give an agent and match them by wording. A version that adds no rule of its own and has not changed since this file last did reads as an older text, so what it lacks is not counted as dropped. We keep no past texts of a file, so that is inferred, and an edited version that started from an older text still counts its gaps as drops.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Most recently taken up by

Who's talking about JimLiu/baoyu-skills

The biggest 5 of 66 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 66

Talked about on GitHub, YouTube, Bluesky and the web (66 times).

On GitHub · 50

45 more on GitHub

On YouTube · 12

7 more on YouTube

On Bluesky · 3

On the web · 1

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 3 are common, 8 are distinctive, and 3 are very specific to this project.

  • 3

    Common

    Most of the 4 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When this skill prompts the user, follow this tool-selection rule (priority order):

    line 23
  2. Distinctive:

    Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each …

    line 26
  3. Distinctive:

    Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call.

    line 27
  4. Distinctive:

    Check EXTEND.md (see Preferences)

    line 105
  5. Distinctive:

    All intermediate and final files go in the output directory:

    line 113
  6. Distinctive:

    Quick mode never chunks: If content exceeds the chunk threshold, warn: "This article is ~{N} words.

    line 127
  7. Very specific:

    Assemble prompt: read 01-analysis.md (if it exists) and build shared context with Part 1 of references/subagent-prompt-template.md, …

    line 136
  8. Common:

    No chunks (under threshold): one subagent for the whole source file

    line 140
  9. Very specific:

    No Agent tool: translate chunks sequentially inline using 02-prompt.md

    line 141
  10. Very specific:

    Keep all intermediate files in chunks/

    line 143
  11. Distinctive:

    After merging, the main agent takes over for review, revision, and polish (Step 4).

    line 145
  12. Distinctive:

    Rewrite, not translate: write natural, engaging target language as if a skilled native writer composed it.

    line 151
  13. Common:

    Preserve format: all markdown formatting (headings, bold, italic, images, links, code blocks)

    line 155
  14. Common:

    If candidates were found, append after the summary a short note that some embedded images may still need image-text localization, followed …

    line 201

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Translator

User Input Tools

When this skill prompts the user, follow this tool-selection rule (priority order):

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.
  2. Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.
  3. Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.

Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.

Script Directory

{baseDir} = this SKILL.md's directory. ${BUN_X} = bun if installed; else npx -y bun if npx available; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.

ScriptPurpose
scripts/main.tsCLI entry point. Default action splits markdown into chunks; also supports explicit chunk subcommand
scripts/chunk.tsMarkdown chunking implementation used by main.ts and kept compatible for direct invocation

Preferences (EXTEND.md)

First one found wins:

PriorityPathScope
1.baoyu-skills/baoyu-translate/EXTEND.mdProject
2${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-translate/EXTEND.mdXDG
3$HOME/.baoyu-skills/baoyu-translate/EXTEND.mdUser home
  • Found → read and apply. On first use in a session, remind briefly: "Using preferences from [path]. You can edit EXTEND.md to customize glossary, audience, etc."
  • Not found → BLOCKING first-time setup before any translation; never silently use defaults. Ask all questions in references/config/first-time-setup.md (target language, mode, audience, style, save location) in ONE call, write EXTEND.md at the chosen location, confirm "Preferences saved to [path]", then continue.

Supports: target language, mode, audience, glossaries (inline or file path), style, chunk settings. Schema: references/config/extend-schema.md.

Defaults

EXTEND.md overrides defaults; CLI flags override EXTEND.md.

SettingDefaultEXTEND.md keyCLI flag
Target languagezh-CNtarget_language--to
Modenormaldefault_mode--mode
Audiencegeneralaudience--audience
Stylestorytellingstyle--style
Chunk threshold (words, triggers chunking)4000chunk_threshold—
Chunk max words5000chunk_max_words—

Modes

ModeFlagStepsWhen to Use
Quick--mode quickTranslateShort texts, informal content, quick tasks
Normal--mode normal (default)Analyze → TranslateArticles, blog posts, general content
Refined--mode refinedAnalyze → Translate → Review → PolishPublication-quality, important documents

Auto-detection: "快翻", "quick", "直接翻译" → quick; "精翻", "refined", "publication quality", "proofread" → refined; otherwise the default mode.

Style presets (voice and tone, independent of audience; custom descriptions accepted, e.g. --style "poetic and lyrical"):

ValueDescriptionEffect
storytellingEngaging narrative flow (default)Draws readers in, smooth transitions, vivid phrasing
formalProfessional, structuredNeutral tone, clear organization, no colloquialisms
technicalPrecise, documentation-styleConcise, terminology-heavy, minimal embellishment
literalClose to original structureMinimal restructuring, preserves source sentence patterns
academicScholarly, rigorousFormal register, complex clauses OK, citation-aware
businessConcise, results-focusedAction-oriented, executive-friendly, bullet-point mindset
humorousPreserves and adapts humorWitty, playful, recreates comedic effect in target language
conversationalCasual, spoken-likeFriendly, approachable, as if explaining to a friend
elegantLiterary, polished proseAesthetically refined, rhythmic, carefully crafted word choices

Audience presets (custom descriptions accepted, e.g. --audience "AI感兴趣的普通读者"):

ValueDescriptionEffect
generalGeneral readers (default)Plain language, more translator's notes for jargon
technicalDevelopers / engineersLess annotation on common tech terms
academicResearchers / scholarsFormal register, precise terminology
businessBusiness professionalsBusiness-friendly tone, explain tech concepts

Workflow

Step 1: Load Preferences

  1. Check EXTEND.md (see Preferences)
  2. Load the built-in glossary for the language pair if available — EN→ZH: references/glossary-en-zh.md
  3. Merge glossaries: EXTEND.md glossary (inline) + glossary_files (paths relative to EXTEND.md) + built-in + --glossary file (CLI overrides all)

Step 2: Materialize Source & Create Output Directory

Materialize the source (file as-is; inline text/URL → translate/{slug}.md), then create {source-dir}/{source-basename}-{target-lang}/. Detect source language if --from is not given. Details and conflict handling: references/workflow-mechanics.md.

All intermediate and final files go in the output directory:

FileModeDescription
translation.mdAllFinal translation (always this name)
01-analysis.mdNormal, RefinedContent analysis (domain, tone, terminology)
02-prompt.mdNormal, RefinedAssembled translation prompt
03-draft.mdRefinedInitial draft before review
04-critique.mdRefinedCritical review findings (diagnosis only)
05-revision.mdRefinedRevised translation based on critique
chunks/ChunkedSource chunks + translated chunks

Step 3: Assess Content Length

Quick mode never chunks. If content exceeds the chunk threshold, warn: "This article is ~{N} words. Quick mode translates in one pass without chunking — for long content, --mode normal produces better results with terminology consistency." Proceed if the user doesn't switch.

Normal/refined: below threshold → translate as a single unit; at or above → chunked translation (3.1).

3.1 Long Content Preparation (normal/refined, ≥ threshold)

  1. Extract terminology across the whole document (proper nouns, technical terms, recurring phrases)
  2. Build session glossary: merge extracted terms with loaded glossaries, fix consistent translations
  3. Split: ${BUN_X} {baseDir}/scripts/main.ts <file> [--max-words <chunk_max_words>] [--output-dir <output-dir>] — splits at markdown block boundaries (headings, paragraphs, lists, code blocks, tables, etc.); an oversized single block falls back to line, then word splitting
  4. Assemble prompt: read 01-analysis.md (if it exists) and build shared context with Part 1 of references/subagent-prompt-template.md, inlining target style, content background, merged glossary, and translation challenges. Save as 02-prompt.md (shared context only, no task instructions)
  5. Draft via subagents (if an Agent tool is available):
    • One subagent per chunk, all in parallel (Part 2 of the template). Each reads 02-prompt.md, gets its position (chunk N of M + brief context of where it sits in the argument), and saves chunks/chunk-NN-draft.md
    • Consistency comes from the shared 02-prompt.md (glossary, figurative language mapping, comprehension challenges, source voice, translation challenges)
    • No chunks (under threshold): one subagent for the whole source file
    • No Agent tool: translate chunks sequentially inline using 02-prompt.md
  6. Merge chunks in order after all subagents finish; prepend chunks/frontmatter.md if it exists. Save as 03-draft.md (refined) or translation.md (normal)
  7. Keep all intermediate files in chunks/

After merging, the main agent takes over for review, revision, and polish (Step 4).

Step 4: Translate & Refine

Translation principles (all modes):

  • Rewrite, not translate: write natural, engaging target language as if a skilled native writer composed it. Test: "Does this read like it was originally written in the target language?"
  • Accuracy first: facts, data, and logic match the original exactly
  • Natural flow: idiomatic target word order; break long source sentences into shorter ones; render metaphors and idioms by intended meaning, not word-for-word
  • Terminology: standard translations, used consistently; annotate specialized terms with the original in parentheses on first occurrence
  • Preserve format: all markdown formatting (headings, bold, italic, images, links, code blocks)
  • Proactive interpretation: for jargon or concepts the audience may lack context for, add concise explanations in bold parentheses (**解释**) — few, only where genuinely needed
  • Frontmatter (if the source has YAML frontmatter): rename source-metadata fields with a source prefix (camelCase: url→sourceUrl, title→sourceTitle, etc.), add translated values as new top-level fields (skip title if the body has an H1), keep other fields as-is

Quick: translate directly → translation.md.

Normal:

  1. Analyze → 01-analysis.md (domain, tone, terminology, translation challenges)
  2. Assemble prompt → 02-prompt.md (instructions with context, glossary, challenges)
  3. Translate following 02-prompt.md → translation.md

Then tell the user: "Translation saved. To further review and polish, reply 继续润色 or refine." If they do, run refined Steps 4-6 on the existing output: rename current translation.md to 03-draft.md, then write 04-critique.md, 05-revision.md, and an updated translation.md.

Refined — per-step guidelines in references/refined-workflow.md. Each step reads the previous step's file:

  1. Analyze → 01-analysis.md
  2. Assemble prompt → 02-prompt.md (instructions with inlined context)
  3. Draft → 03-draft.md (with translator's notes; from subagents if chunked)
  4. Critical review → 04-critique.md (diagnosis only: accuracy, Europeanized language, strategy execution, expression issues)
  5. Revision → 05-revision.md (apply all critique findings)
  6. Polish → translation.md (publication quality)

Subagents (Step 3.1) only produce the initial draft. Review, revision, and polish belong to the main agent, which may delegate to subagents at its discretion.

Step 5: Output

Final translation is always translation.md in the output directory.

Then run a lightweight image-language pass: collect image references, identify likely text-heavy ones (covers, screenshots, diagrams, charts, frameworks, infographics), and list any whose main text language likely differs from the translated article. List only — do not localize images unless the user asks. Use the article's own image syntax (markdown or wikilink):

Possible image localization needed:
- ![example cover](attachments/example-cover.png): likely still contains source-language text while the article is now in target language
- ![example diagram](attachments/example-diagram.png): likely text-heavy framework graphic, check whether labels need translation

Summary:

**Translation complete** ({mode} mode)

Source: {source-path}
Languages: {from} → {to}
Output dir: {output-dir}/
Final: {output-dir}/translation.md
Glossary terms applied: {count}

If candidates were found, append after the summary a short note that some embedded images may still need image-text localization, followed by the list.

Extension Support

Custom configurations via EXTEND.md — see Preferences above.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.