baoyu-translate/SKILL.md
Translates articles and documents between languages with three modes - quick (direct), normal (analyze then translate), and refined (analyze, translate, review, polish). Supports custom glossaries and terminology consistency via EXTEND.md. Use when user asks to "translate", "翻译", "精翻", "translate article", "translate to Chinese/English", "改成中文", "改成英文", "convert to Chinese", "localize", "本地化", or needs any document translation. Also triggers for "refined translation", "精细翻译", "proofread translation", "快速翻译", "快翻", "这篇文章翻译一下", or when a URL or file is provided with translation intent.
npx skillsauth add run6270/skill baoyu-translateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Three-mode translation skill: quick for direct translation, normal for analysis-informed translation, refined for full publication-quality workflow with review and polish.
Scripts in scripts/ subdirectory. ${SKILL_DIR} = this SKILL.md's directory path. Resolve ${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun. Replace ${SKILL_DIR} and ${BUN_X} with actual values.
| Script | Purpose |
|--------|---------|
| scripts/chunk.ts | Split markdown into chunks by AST blocks (sections, headings, paragraphs), with line/word fallback for oversized blocks. Use --output-dir <dir> to write chunks into <dir>/chunks/ instead of <source-dir>/chunks/ |
Check EXTEND.md existence (priority order):
# macOS, Linux, WSL, Git Bash
test -f .baoyu-skills/baoyu-translate/EXTEND.md && echo "project"
test -f "$HOME/.baoyu-skills/baoyu-translate/EXTEND.md" && echo "user"
# PowerShell (Windows)
if (Test-Path .baoyu-skills/baoyu-translate/EXTEND.md) { "project" }
if (Test-Path "$HOME/.baoyu-skills/baoyu-translate/EXTEND.md") { "user" }
| Path | Location |
|------|----------|
| .baoyu-skills/baoyu-translate/EXTEND.md | Project directory |
| $HOME/.baoyu-skills/baoyu-translate/EXTEND.md | User home |
| Result | Action | |--------|--------| | Found | Read, parse, apply settings. On first use in session, briefly remind: "Using preferences from [path]. You can edit EXTEND.md to customize glossary, audience, etc." | | Not found | MUST run first-time setup (see below) — do NOT silently use defaults |
EXTEND.md Supports: Default target language | Default mode | Target audience | Custom glossaries | Translation style | Chunk settings
Schema: references/config/extend-schema.md
CRITICAL: When EXTEND.md is not found, you MUST run the first-time setup before ANY translation. This is a BLOCKING operation.
Full reference: references/config/first-time-setup.md
Use AskUserQuestion with all questions (target language, mode, audience, style, save location) in ONE call. After user answers, create EXTEND.md at the chosen location, confirm "Preferences saved to [path]", then continue.
All configurable values in one place. EXTEND.md overrides these; CLI flags override EXTEND.md.
| Setting | Default | EXTEND.md key | CLI flag | Description |
|---------|---------|---------------|----------|-------------|
| Target language | zh-CN | target_language | --to | Translation target language |
| Mode | normal | default_mode | --mode | Translation mode |
| Audience | general | audience | --audience | Target reader profile |
| Style | storytelling | style | --style | Translation style preference |
| Chunk threshold | 4000 | chunk_threshold | — | Word count to trigger chunked translation |
| Chunk max words | 5000 | chunk_max_words | — | Max words per chunk |
| Mode | Flag | Steps | When to Use |
|------|------|-------|-------------|
| Quick | --mode quick | Translate | Short texts, informal content, quick tasks |
| Normal | --mode normal (default) | Analyze → Translate | Articles, blog posts, general content |
| Refined | --mode refined | Analyze → Translate → Review → Polish | Publication-quality, important documents |
Default mode: Normal (can be overridden in EXTEND.md default_mode setting).
Style presets — control the voice and tone of the translation (independent of audience):
| Value | Description | Effect |
|-------|-------------|--------|
| storytelling | Engaging narrative flow (default) | Draws readers in, smooth transitions, vivid phrasing |
| formal | Professional, structured | Neutral tone, clear organization, no colloquialisms |
| technical | Precise, documentation-style | Concise, terminology-heavy, minimal embellishment |
| literal | Close to original structure | Minimal restructuring, preserves source sentence patterns |
| academic | Scholarly, rigorous | Formal register, complex clauses OK, citation-aware |
| business | Concise, results-focused | Action-oriented, executive-friendly, bullet-point mindset |
| humorous | Preserves and adapts humor | Witty, playful, recreates comedic effect in target language |
| conversational | Casual, spoken-like | Friendly, approachable, as if explaining to a friend |
| elegant | Literary, polished prose | Aesthetically refined, rhythmic, carefully crafted word choices |
Custom style descriptions are also accepted, e.g., --style "poetic and lyrical".
Auto-detection:
Upgrade prompt: After normal mode completes, display:
Translation saved. To further review and polish, reply "继续润色" or "refine".
If user responds, continue with review → polish steps (same as refined mode Steps 4-6 in refined-workflow.md) on the existing output.
/translate [--mode quick|normal|refined] [--from <lang>] [--to <lang>] [--audience <audience>] [--style <style>] [--glossary <file>] <source>
<source>: File path, URL, or inline text--from: Source language (auto-detect if omitted)--to: Target language (from EXTEND.md or default zh-CN)--audience: Target reader profile (from EXTEND.md or default general)--style: Translation style (from EXTEND.md or default storytelling)--glossary: Additional glossary file to merge with EXTEND.md glossaryAudience presets:
| Value | Description | Effect |
|-------|-------------|--------|
| general | General readers (default) | Plain language, more translator's notes for jargon |
| technical | Developers / engineers | Less annotation on common tech terms |
| academic | Researchers / scholars | Formal register, precise terminology |
| business | Business professionals | Business-friendly tone, explain tech concepts |
Custom audience descriptions are also accepted, e.g., --audience "AI感兴趣的普通读者".
1.1 Check EXTEND.md (see Preferences section above)
1.2 Load built-in glossary for the language pair if available:
1.3 Merge glossaries: EXTEND.md glossary + built-in glossary + --glossary file (CLI overrides all)
Materialize source (file as-is, inline text/URL → save to translate/{slug}.md), then create output directory: {source-dir}/{source-basename}-{target-lang}/. Detect source language if --from not specified.
Full details: references/workflow-mechanics.md
Output directory contents (all intermediate and final files go here):
| File | Mode | Description |
|------|------|-------------|
| translation.md | All | Final translation (always this name) |
| 01-analysis.md | Normal, Refined | Content analysis (domain, tone, terminology) |
| 02-prompt.md | Normal, Refined | Assembled translation prompt |
| 03-draft.md | Refined | Initial draft before review |
| 04-critique.md | Refined | Critical review findings (diagnosis only) |
| 05-revision.md | Refined | Revised translation based on critique |
| chunks/ | Chunked | Source chunks + translated chunks |
Quick mode does not chunk — translate directly regardless of length. Before translating, estimate word count. If content exceeds chunk threshold (default 4000 words), proactively 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." Then proceed if user doesn't switch.
For normal and refined modes:
| Content | Action | |---------|--------| | < chunk threshold | Translate as single unit | | >= chunk threshold | Chunk translation (see Step 3.1) |
3.1 Long Content Preparation (normal/refined modes, >= chunk threshold only)
Before translating chunks:
${BUN_X} ${SKILL_DIR}/scripts/chunk.ts <file> [--max-words <chunk_max_words>] [--output-dir <output-dir>]
01-analysis.md (if exists) and assembles shared context using Part 1 of references/subagent-prompt-template.md — inlining content background, merged glossary, and comprehension challenges02-prompt.md in the output directory (shared context only, no task instructions)02-prompt.md for shared context, translates its chunk, saves to chunks/chunk-NN-draft.md02-prompt.md (glossary + comprehension challenges from analysis)02-prompt.mdchunks/frontmatter.md exists, prepend it. Save as 03-draft.md (refined) or translation.md (normal)chunks/After chunked draft is merged, return control to main agent for critical review, revision, and polish (Step 4).
Translation principles (apply to all modes):
译文(English original,通俗解释). Calibrate annotation depth to the target audience: general readers need more notes than technical readers. Only add notes where genuinely needed; do not over-annotate obvious terms.Translate directly → save to translation.md. No analysis file, but still apply all translation principles above — especially: interpret figurative language by meaning (not word-for-word), preserve emotional connotations, and restructure sentences for natural target-language flow.
01-analysis.md (domain, tone, audience, terminology, reader comprehension challenges, figurative language & metaphor mapping)02-prompt.md (translation instructions with inlined context)02-prompt.md) → translation.mdAfter completion, prompt user: "Translation saved. To further review and polish, reply 继续润色 or refine."
If user continues, proceed with critical review → revision → polish (same as refined mode Steps 4-6 below), saving 03-draft.md (rename current translation.md), 04-critique.md, 05-revision.md, and updated translation.md.
Full workflow for publication quality. See references/refined-workflow.md for detailed guidelines per step.
The subagent (if used in Step 3.1) only handles the initial draft. All subsequent steps (critical review, revision, polish) are handled by the main agent, which may delegate to subagents at its discretion.
Steps and saved files (all in output directory):
01-analysis.md (domain, tone, terminology, reader comprehension challenges, figurative language & metaphor mapping)02-prompt.md (translation instructions with inlined context)03-draft.md (initial translation with translator's notes; from subagent if chunked)04-critique.md (diagnosis only: accuracy, Europeanized language, strategy execution, expression issues)05-revision.md (apply all critique findings to produce revised translation)translation.md (final publication-quality translation)Each step reads the previous step's file and builds on it.
Final translation is always at translation.md in the output directory.
Display summary:
**Translation complete** ({mode} mode)
Source: {source-path}
Languages: {from} → {to}
Output dir: {output-dir}/
Final: {output-dir}/translation.md
Glossary terms applied: {count}
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
documentation
Provide a lookup index of dbt models (BigQuery tables) to guide query writing against a data warehouse. Use when you need to query, analyze, or look up data in a dbt-powered data warehouse, or when resolving a vague data question into the right BigQuery tables to query.
development
Evidence-first academic integrity auditing and public-interest science storytelling distilled from the full Bilibili video corpus of 耿同学讲故事 plus public interviews. Use when investigating suspected paper/data/image/academic-identity problems, evaluating biomedical or health-tech claims, drafting official complaint memos, or writing rigorous Chinese public-interest scripts with explicit evidence boundaries.
tools
Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool.
testing
Assists in writing high-quality content by conducting research, adding citations, improving hooks, iterating on outlines, and providing real-time feedback on each section. Transforms your writing process from solo effort to collaborative partnership.