{"id":"5366dc1d-0eb1-4bb6-a927-99fb46666c3c","entityType":"agent","slug":"clawhub-jimliu-baoyu-translate","name":"Baoyu Translate","canonicalUrl":"https://www.xpersona.co/agent/clawhub-jimliu-baoyu-translate","canonicalPath":"/agent/clawhub-jimliu-baoyu-translate","generatedAt":"2026-10-09T20:33:05.729Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T04:35:13.724Z","emptyReason":null},"description":"This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\", \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\",... Skill: Baoyu Translate Owner: jimliu Summary: This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\", \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\",... Tags: latest:1.117.3 Version history: v1.117.3 | 2026-06-13T05:01:28.863Z | auto - Updated description in SKILL.md for improved clarity and brevity. - Removed the file skill-card.md. - No changes to functional cod","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 4.9K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17dfbhg0khk4fvtnx0stqg0yx83j25z:baoyu-translate","sourceUrl":"https://clawhub.ai/jimliu/baoyu-translate","homepage":"https://clawhub.ai/jimliu/skills/baoyu-translate","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/jimliu/baoyu-translate","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/jimliu/skills/baoyu-translate","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\", \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\",..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T04:35:13.724Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T04:35:13.724Z","emptyReason":null},"stars":null,"forks":null,"downloads":4924,"packageName":null,"latestVersion":"1.117.3","tractionLabel":"4.9K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T04:35:13.724Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T04:35:13.724Z","lastCrawledAt":"2026-10-09T04:35:13.724Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T04:35:13.724Z","lastVerifiedAt":null,"highlights":[{"version":"1.117.3","createdAt":"2026-06-13T05:01:28.863Z","changelog":"- Updated description in SKILL.md for improved clarity and brevity. - Removed the file skill-card.md. - No changes to functional code; only documentation updated. - Version bumped to 1.117.3.","fileCount":13,"zipByteSize":22475},{"version":"1.117.2","createdAt":"2026-05-18T02:16:20.295Z","changelog":"## 1.117.2 - 2026-05-17 ### Documentation - `baoyu-cover-image`: ban programmatic text repair on generated bitmaps — disallow ImageMagick / Pillow / Canvas / SVG / HTML overlays to cover, rewrite, or replace title/subtitle text; regenerate from a corrected prompt or switch to a lower-text or no-title variant instead - `baoyu-article-illustrator`, `baoyu-comic`, `baoyu-image-cards`, `baoyu-xhs-images`, `baoyu-infographic`, `baoyu-slide-deck`: sync the same text-repair ban with skill-specific text categories (labels/captions, dialogue/sound effects, titles/body/tags, headings/data values, slide titles/bullets)","fileCount":13,"zipByteSize":22578},{"version":"1.115.4","createdAt":"2026-05-11T23:50:00.440Z","changelog":"### Documentation - Image generation backend selection: emphasize Codex `imagegen` as the priority runtime-native tool (invoke via the `Skill` tool with `skill: \"imagegen\"`) and forbid SVG/HTML/canvas substitution when no raster backend can be resolved — fall through to asking the user instead of silently emitting code-based art. Updated in `docs/image-generation-tools.md` and inlined into `baoyu-article-illustrator`, `baoyu-comic`, `baoyu-cover-image`, `baoyu-image-cards`, `baoyu-infographic`, `baoyu-slide-deck`, and `baoyu-xhs-images`.","fileCount":12,"zipByteSize":21049},{"version":"1.103.2","createdAt":"2026-04-21T22:04:03.692Z","changelog":"- Added \"User Input Tools\" section specifying how to prompt for user settings, prioritizing built-in agent runtime tools (e.g., AskUserQuestion) and providing fallback instructions. - Clarified EXTEND.md discovery order and separated the paths/priorities table for easier reference. - Explained batching behavior for user questions depending on the runtime's tool capabilities. - No changes to core workflow or translation modes. - All other instructions and functionality remain unchanged.","fileCount":12,"zipByteSize":21049},{"version":"1.103.1","createdAt":"2026-04-13T16:17:57.367Z","changelog":"## 1.103.1 - 2026-04-13 ### Fixes - `baoyu-markdown-to-html`: decode HTML entities and strip tags from article summary - `baoyu-post-to-weibo`: decode HTML entities and strip tags from article summary","fileCount":12,"zipByteSize":21065},{"version":"1.103.0","createdAt":"2026-04-13T01:22:40.938Z","changelog":"## 1.103.0 - 2026-04-12 ### Features - baoyu-diagram: add multi-diagram mode for article-wide diagram generation ### Fixes - baoyu-article-illustrator: prevent color names and hex codes from appearing as visible text in generated images - baoyu-cover-image: prevent color names and hex codes from appearing as visible text in generated images - baoyu-image-cards: prevent color names from appearing as visible text in generated images - baoyu-post-to-wechat: decode HTML entities and strip tags from article summary","fileCount":12,"zipByteSize":21066},{"version":"1.76.4","createdAt":"2026-04-09T16:29:46.613Z","changelog":"baoyu-translate v1.76.4 changelog - Updated documentation in SKILL.md, refined-workflow.md, and subagent-prompt-template.md. - Version number updated in SKILL.md. - No functional code changes; documentation improvements only.","fileCount":11,"zipByteSize":20098},{"version":"1.76.3","createdAt":"2026-03-26T01:11:37.317Z","changelog":"baoyu-translate 1.57.0 - Updated version to 1.57.0. - Documentation updates in SKILL.md, references/refined-workflow.md, and references/subagent-prompt-template.md. - No functional or behavioral changes; changes are documentation-only.","fileCount":11,"zipByteSize":25082}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17dfbhg0khk4fvtnx0stqg0yx83j25z:baoyu-translate","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T20:33:05.725Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-translate/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-09T04:35:13.724Z","emptyReason":null},"readme":"Skill: Baoyu Translate\n\nOwner: jimliu\n\nSummary: This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\", \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\",...\n\nTags: latest:1.117.3\n\nVersion history:\n\nv1.117.3 | 2026-06-13T05:01:28.863Z | auto\n\n- Updated description in SKILL.md for improved clarity and brevity.\n- Removed the file skill-card.md.\n- No changes to functional code; only documentation updated.\n- Version bumped to 1.117.3.\n\nv1.117.2 | 2026-05-18T02:16:20.295Z | user\n\n## 1.117.2 - 2026-05-17\n\n### Documentation\n- `baoyu-cover-image`: ban programmatic text repair on generated bitmaps — disallow ImageMagick / Pillow / Canvas / SVG / HTML overlays to cover, rewrite, or replace title/subtitle text; regenerate from a corrected prompt or switch to a lower-text or no-title variant instead\n- `baoyu-article-illustrator`, `baoyu-comic`, `baoyu-image-cards`, `baoyu-xhs-images`, `baoyu-infographic`, `baoyu-slide-deck`: sync the same text-repair ban with skill-specific text categories (labels/captions, dialogue/sound effects, titles/body/tags, headings/data values, slide titles/bullets)\n\nv1.115.4 | 2026-05-11T23:50:00.440Z | user\n\n### Documentation\n- Image generation backend selection: emphasize Codex `imagegen` as the priority runtime-native tool (invoke via the `Skill` tool with `skill: \"imagegen\"`) and forbid SVG/HTML/canvas substitution when no raster backend can be resolved — fall through to asking the user instead of silently emitting code-based art. Updated in `docs/image-generation-tools.md` and inlined into `baoyu-article-illustrator`, `baoyu-comic`, `baoyu-cover-image`, `baoyu-image-cards`, `baoyu-infographic`, `baoyu-slide-deck`, and `baoyu-xhs-images`.\n\nv1.103.2 | 2026-04-21T22:04:03.692Z | auto\n\n- Added \"User Input Tools\" section specifying how to prompt for user settings, prioritizing built-in agent runtime tools (e.g., AskUserQuestion) and providing fallback instructions.\n- Clarified EXTEND.md discovery order and separated the paths/priorities table for easier reference.\n- Explained batching behavior for user questions depending on the runtime's tool capabilities.\n- No changes to core workflow or translation modes.\n- All other instructions and functionality remain unchanged.\n\nv1.103.1 | 2026-04-13T16:17:57.367Z | user\n\n## 1.103.1 - 2026-04-13\n\n### Fixes\n- `baoyu-markdown-to-html`: decode HTML entities and strip tags from article summary\n- `baoyu-post-to-weibo`: decode HTML entities and strip tags from article summary\n\nv1.103.0 | 2026-04-13T01:22:40.938Z | user\n\n## 1.103.0 - 2026-04-12\n\n### Features\n- baoyu-diagram: add multi-diagram mode for article-wide diagram generation\n\n### Fixes\n- baoyu-article-illustrator: prevent color names and hex codes from appearing as visible text in generated images\n- baoyu-cover-image: prevent color names and hex codes from appearing as visible text in generated images\n- baoyu-image-cards: prevent color names from appearing as visible text in generated images\n- baoyu-post-to-wechat: decode HTML entities and strip tags from article summary\n\nv1.76.4 | 2026-04-09T16:29:46.613Z | auto\n\nbaoyu-translate v1.76.4 changelog\n\n- Updated documentation in SKILL.md, refined-workflow.md, and subagent-prompt-template.md.\n- Version number updated in SKILL.md.\n- No functional code changes; documentation improvements only.\n\nv1.76.3 | 2026-03-26T01:11:37.317Z | auto\n\nbaoyu-translate 1.57.0\n\n- Updated version to 1.57.0.\n- Documentation updates in SKILL.md, references/refined-workflow.md, and references/subagent-prompt-template.md.\n- No functional or behavioral changes; changes are documentation-only.\n\nv1.76.2 | 2026-03-25T21:34:10.966Z | auto\n\n- Removed the scripts/bun.lock file for a lighter repository.\n- No changes to logic or features; all usage, configuration, and workflow remain the same.\n- No impact on translation modes, preferences, or CLI operation.\n\nv1.76.1 | 2026-03-22T04:25:05.874Z | auto\n\n**baoyu-translate v1.76.1**\n\n- Added a new `scripts/main.ts` as the CLI entry point, with default and explicit chunking actions.\n- Updated script structure: `main.ts` now calls `chunk.ts` for markdown chunking, which remains directly invocable.\n- Updated SKILL.md to document the new entry point and script usage.\n- Updated dependencies in `scripts/package.json` and lockfile.\n- Internal refactoring to support the new CLI command structure.\n\nv1.60.0 | 2026-03-12T03:51:32.222Z | user\n\n## 1.60.0 - 2026-03-11\n\n### Features\n- `baoyu-url-to-markdown`: support reusing existing Chrome CDP instances and fix port detection order\n\n### Fixes\n- `baoyu-post-to-x`: add missing `fs` import in x-article\n\n### Refactor\n- Unify all CDP skills to use shared `baoyu-chrome-cdp` package with vendored copies\n- Simplify CLAUDE.md, move detailed documentation to `docs/` directory\n- Publish skills directly from synced vendor, removing separate artifact preparation step\n\nv1.0.0 | 2026-03-09T17:19:04.160Z | auto\n\n- Initial release of baoyu-translate skill with multi-mode document translation.\n- Supports quick, normal, and refined translation workflows, including review and polish steps.\n- Customizable terminology and preferences via EXTEND.md; blocks translation and prompts setup if preferences are missing.\n- Auto-detection of mode and language based on user intent.\n- Built-in glossary support and chunked translation for large files.\n- Flexible CLI flags for target language, audience, style, and custom glossaries.\n\nArchive index:\n\nArchive v1.117.3: 13 files, 22475 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (6040b), references/subagent-prompt-template.md (3442b), references/workflow-mechanics.md (812b), scripts/bun.lock (1456b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), skill-card.md (2797b), SKILL.md (15844b), _meta.json (136b)\n\nFile v1.117.3:SKILL.md\n\n---\nname: baoyu-translate\ndescription: >-\n  This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\",\n  \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\", \"convert to Chinese\",\n  \"localize\", \"本地化\", \"refined translation\", \"精细翻译\", \"proofread translation\", \"快速翻译\", \"快翻\",\n  \"这篇文章翻译一下\", or provides a URL/file with translation intent. Supports three modes\n  (quick/normal/refined) with custom glossary support.\nversion: 1.117.3\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-translate\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Translator\n\nThree-mode translation skill: **quick** for direct translation, **normal** for analysis-informed translation, **refined** for full publication-quality workflow with review and polish.\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts in `scripts/` subdirectory. `{baseDir}` = 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 `{baseDir}` and `${BUN_X}` with actual values.\n\n| Script | Purpose |\n|--------|---------|\n| `scripts/main.ts` | CLI entry point. Default action splits markdown into chunks; also supports explicit `chunk` subcommand |\n| `scripts/chunk.ts` | Markdown chunking implementation used by `main.ts` and kept compatible for direct invocation |\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-translate/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-translate/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply. On first use in session, briefly remind: \"Using preferences from [path]. You can edit EXTEND.md to customize glossary, audience, etc.\" |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently use defaults |\n\n**EXTEND.md supports**: default target language, default mode, target audience, custom glossaries (inline or file path), translation style, chunk settings.\n\nSchema: [references/config/extend-schema.md](references/config/extend-schema.md).\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST** run the first-time setup before ANY translation. This is a **BLOCKING** operation.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\nUse `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.\n\n## Defaults\n\nAll configurable values in one place. EXTEND.md overrides these; CLI flags override EXTEND.md.\n\n| Setting | Default | EXTEND.md key | CLI flag | Description |\n|---------|---------|---------------|----------|-------------|\n| Target language | `zh-CN` | `target_language` | `--to` | Translation target language |\n| Mode | `normal` | `default_mode` | `--mode` | Translation mode |\n| Audience | `general` | `audience` | `--audience` | Target reader profile |\n| Style | `storytelling` | `style` | `--style` | Translation style preference |\n| Chunk threshold | `4000` | `chunk_threshold` | — | Word count to trigger chunked translation |\n| Chunk max words | `5000` | `chunk_max_words` | — | Max words per chunk |\n\n## Modes\n\n| Mode | Flag | Steps | When to Use |\n|------|------|-------|-------------|\n| Quick | `--mode quick` | Translate | Short texts, informal content, quick tasks |\n| Normal | `--mode normal` (default) | Analyze → Translate | Articles, blog posts, general content |\n| Refined | `--mode refined` | Analyze → Translate → Review → Polish | Publication-quality, important documents |\n\n**Default mode**: Normal (can be overridden in EXTEND.md `default_mode` setting).\n\n**Style presets** — control the voice and tone of the translation (independent of audience):\n\n| Value | Description | Effect |\n|-------|-------------|--------|\n| `storytelling` | Engaging narrative flow (default) | Draws readers in, smooth transitions, vivid phrasing |\n| `formal` | Professional, structured | Neutral tone, clear organization, no colloquialisms |\n| `technical` | Precise, documentation-style | Concise, terminology-heavy, minimal embellishment |\n| `literal` | Close to original structure | Minimal restructuring, preserves source sentence patterns |\n| `academic` | Scholarly, rigorous | Formal register, complex clauses OK, citation-aware |\n| `business` | Concise, results-focused | Action-oriented, executive-friendly, bullet-point mindset |\n| `humorous` | Preserves and adapts humor | Witty, playful, recreates comedic effect in target language |\n| `conversational` | Casual, spoken-like | Friendly, approachable, as if explaining to a friend |\n| `elegant` | Literary, polished prose | Aesthetically refined, rhythmic, carefully crafted word choices |\n\nCustom style descriptions are also accepted, e.g., `--style \"poetic and lyrical\"`.\n\n**Auto-detection**:\n- \"快翻\", \"quick\", \"直接翻译\" → quick mode\n- \"精翻\", \"refined\", \"publication quality\", \"proofread\" → refined mode\n- Otherwise → default mode (normal)\n\n**Upgrade prompt**: After normal mode completes, display:\n> Translation saved. To further review and polish, reply \"继续润色\" or \"refine\".\n\nIf user responds, continue with review → polish steps (same as refined mode Steps 4-6 in refined-workflow.md) on the existing output.\n\n**Audience presets**:\n\n| Value | Description | Effect |\n|-------|-------------|--------|\n| `general` | General readers (default) | Plain language, more translator's notes for jargon |\n| `technical` | Developers / engineers | Less annotation on common tech terms |\n| `academic` | Researchers / scholars | Formal register, precise terminology |\n| `business` | Business professionals | Business-friendly tone, explain tech concepts |\n\nCustom audience descriptions are also accepted, e.g., `--audience \"AI感兴趣的普通读者\"`.\n\n## Workflow\n\n### Step 1: Load Preferences\n\n1.1 Check EXTEND.md (see Preferences section above)\n\n1.2 Load built-in glossary for the language pair if available:\n- EN→ZH: [references/glossary-en-zh.md](references/glossary-en-zh.md)\n\n1.3 Merge glossaries: EXTEND.md `glossary` (inline) + EXTEND.md `glossary_files` (external files, paths relative to EXTEND.md location) + built-in glossary + `--glossary` file (CLI overrides all)\n\n### Step 2: Materialize Source & Create Output Directory\n\nMaterialize 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.\n\nFull details: [references/workflow-mechanics.md](references/workflow-mechanics.md)\n\n**Output directory contents** (all intermediate and final files go here):\n\n| File | Mode | Description |\n|------|------|-------------|\n| `translation.md` | All | Final translation (always this name) |\n| `01-analysis.md` | Normal, Refined | Content analysis (domain, tone, terminology) |\n| `02-prompt.md` | Normal, Refined | Assembled translation prompt |\n| `03-draft.md` | Refined | Initial draft before review |\n| `04-critique.md` | Refined | Critical review findings (diagnosis only) |\n| `05-revision.md` | Refined | Revised translation based on critique |\n| `chunks/` | Chunked | Source chunks + translated chunks |\n\n### Step 3: Assess Content Length\n\nQuick 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.\n\nFor normal and refined modes:\n\n| Content | Action |\n|---------|--------|\n| < chunk threshold | Translate as single unit |\n| >= chunk threshold | Chunk translation (see Step 3.1) |\n\n**3.1 Long Content Preparation** (normal/refined modes, >= chunk threshold only)\n\nBefore translating chunks:\n\n1. **Extract terminology**: Scan entire document for proper nouns, technical terms, recurring phrases\n2. **Build session glossary**: Merge extracted terms with loaded glossaries, establish consistent translations\n3. **Split into chunks**: Use `${BUN_X} {baseDir}/scripts/main.ts <file> [--max-words <chunk_max_words>] [--output-dir <output-dir>]`\n   - Parses markdown blocks (headings, paragraphs, lists, code blocks, tables, etc.)\n   - Splits at markdown block boundaries to preserve structure\n   - If a single block exceeds the threshold, falls back to line splitting, then word splitting\n4. **Assemble translation prompt**:\n   - Main agent reads `01-analysis.md` (if exists) and assembles shared context using Part 1 of [references/subagent-prompt-template.md](references/subagent-prompt-template.md) — inlining: target style, content background, merged glossary, and translation challenges\n   - Save as `02-prompt.md` in the output directory (shared context only, no task instructions)\n5. **Draft translation via subagents** (if Agent tool available):\n   - Spawn one subagent **per chunk**, all in parallel (Part 2 of the template)\n   - Each subagent reads `02-prompt.md` for shared context, receives chunk position info (chunk N of M + brief context of where it sits in the argument), translates its chunk, saves to `chunks/chunk-NN-draft.md`\n   - Consistency is guaranteed by the shared `02-prompt.md` (glossary, figurative language mapping, comprehension challenges, source voice, and translation challenges from analysis)\n   - If no chunks (content under threshold): spawn one subagent for the entire source file\n   - If Agent tool is unavailable, translate chunks sequentially inline using `02-prompt.md`\n6. **Merge**: Once all subagents complete, combine translated chunks in order. If `chunks/frontmatter.md` exists, prepend it. Save as `03-draft.md` (refined) or `translation.md` (normal)\n7. All intermediate files (source chunks + translated chunks) are preserved in `chunks/`\n\n**After chunked draft is merged**, return control to main agent for critical review, revision, and polish (Step 4).\n\n### Step 4: Translate & Refine\n\n**Translation principles** (apply to all modes):\n\n- **Rewrite, not translate**: Rewrite content into natural, engaging target language as if a skilled native writer composed it from scratch. Quality test: \"Does this read like it was originally written in the target language?\"\n- **Accuracy first**: Facts, data, and logic must match the original exactly\n- **Natural flow**: Use idiomatic target language word order. Break long source sentences into shorter, natural ones. Interpret metaphors and idioms by intended meaning, not word-for-word\n- **Terminology**: Use standard translations consistently. First occurrence of specialized terms: annotate with original in parentheses\n- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)\n- **Proactive interpretation**: For jargon or concepts the target audience may lack context for, add concise explanations in **bold parentheses** `（**解释**）`. Keep annotations few — only where genuinely needed for comprehension\n- **Frontmatter**: If source has YAML frontmatter, rename source-metadata fields with `source` prefix (camelCase: `url`→`sourceUrl`, `title`→`sourceTitle`, etc.), add translated values as new top-level fields (skip `title` if body has H1), keep other fields as-is\n\n#### Quick Mode\n\nTranslate directly → save to `translation.md`. Apply all translation principles above.\n\n#### Normal Mode\n\n1. **Analyze** → `01-analysis.md` (domain, tone, terminology, translation challenges)\n2. **Assemble prompt** → `02-prompt.md` (translation instructions with context, glossary, challenges)\n3. **Translate** (following `02-prompt.md`) → `translation.md`\n\nAfter completion, prompt user: \"Translation saved. To further review and polish, reply **继续润色** or **refine**.\"\n\nIf 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`.\n\n#### Refined Mode\n\nFull workflow for publication quality. See [references/refined-workflow.md](references/refined-workflow.md) for detailed guidelines per step.\n\nThe 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.\n\nSteps and saved files (all in output directory):\n1. **Analyze** → `01-analysis.md` (domain, tone, terminology, translation challenges)\n2. **Assemble prompt** → `02-prompt.md` (translation instructions with inlined context)\n3. **Draft** → `03-draft.md` (initial translation with translator's notes; from subagent if chunked)\n4. **Critical review** → `04-critique.md` (diagnosis only: accuracy, Europeanized language, strategy execution, expression issues)\n5. **Revision** → `05-revision.md` (apply all critique findings to produce revised translation)\n6. **Polish** → `translation.md` (final publication-quality translation)\n\nEach step reads the previous step's file and builds on it.\n\n### Step 5: Output\n\nFinal translation is always at `translation.md` in the output directory.\n\nAfter the final translation is written, do a lightweight image-language pass:\n\n1. Collect image references from the translated article\n2. Identify likely text-heavy images such as covers, screenshots, diagrams, charts, frameworks, and infographics\n3. If any image likely contains a main text language that does not match the translated article language, proactively remind the user\n4. The reminder must be a list only. Do not automatically localize those images unless the user asks\n\nReminder format (use whatever image syntax the article already uses — standard markdown or wikilink):\n```text\nPossible image localization needed:\n- ![example cover](attachments/example-cover.png): likely still contains source-language text while the article is now in target language\n- ![example diagram](attachments/example-diagram.png): likely text-heavy framework graphic, check whether labels need translation\n```\n\nDisplay summary:\n```\n**Translation complete** ({mode} mode)\n\nSource: {source-path}\nLanguages: {from} → {to}\nOutput dir: {output-dir}/\nFinal: {output-dir}/translation.md\nGlossary terms applied: {count}\n```\n\nIf mismatched image-language candidates were found, append a short note after the summary telling the user that some embedded images may still need image-text localization, followed by the candidate list.\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.117.3:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-translate\",\n  \"version\": \"1.117.3\",\n  \"publishedAt\": 1781326888863\n}\n\nFile v1.117.3:references/config/extend-schema.md\n\n# EXTEND.md Schema for baoyu-translate\n\n## Format\n\nEXTEND.md uses YAML format:\n\n```yaml\n# Default target language (ISO code or common name)\ntarget_language: zh-CN\n\n# Default translation mode\ndefault_mode: normal  # quick | normal | refined\n\n# Target audience (affects annotation depth and register)\naudience: general  # general | technical | academic | business | or custom string\n\n# Translation style preference\nstyle: storytelling  # storytelling | formal | technical | literal | academic | business | humorous | conversational | elegant | or custom string\n\n# Word count threshold to trigger chunked translation\nchunk_threshold: 4000\n\n# Max words per chunk\nchunk_max_words: 5000\n\n# Custom glossary (merged with built-in glossary)\n# CLI --glossary flag overrides these\n# Supports inline entries and/or file paths\nglossary:\n  - from: \"Reinforcement Learning\"\n    to: \"强化学习\"\n  - from: \"Transformer\"\n    to: \"Transformer\"\n    note: \"Keep English\"\n\n# Load glossary from external file(s)\n# Supports absolute path or relative to EXTEND.md location\n# File format: markdown table with | from | to | note | columns,\n# or YAML list of {from, to, note} entries\nglossary_files:\n  - ./my-glossary.md\n  - /path/to/shared-glossary.yaml\n\n# Language-pair specific glossaries\nglossaries:\n  en-zh:\n    - from: \"AI Agent\"\n      to: \"AI 智能体\"\n  ja-zh:\n    - from: \"人工知能\"\n      to: \"人工智能\"\n```\n\n## Fields\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| `target_language` | string | `zh-CN` | Default target language code |\n| `default_mode` | string | `normal` | Default translation mode (`quick` / `normal` / `refined`) |\n| `audience` | string | `general` | Target reader profile (`general` / `technical` / `academic` / `business` / custom) |\n| `style` | string | `storytelling` | Translation style (`storytelling` / `formal` / `technical` / `literal` / `academic` / `business` / `humorous` / `conversational` / `elegant` / custom) |\n| `chunk_threshold` | number | `4000` | Word count threshold to trigger chunked translation |\n| `chunk_max_words` | number | `5000` | Max words per chunk |\n| `glossary` | array | `[]` | Universal glossary entries (inline) |\n| `glossary_files` | array | `[]` | External glossary file paths (absolute or relative to EXTEND.md) |\n| `glossaries` | object | `{}` | Language-pair specific glossary entries |\n\n## Glossary Entry\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `from` | yes | Source term |\n| `to` | yes | Target translation |\n| `note` | no | Usage note (e.g., \"Keep English\", \"Only in tech context\") |\n\n## Glossary File Format\n\nExternal glossary files (`glossary_files`) support two formats:\n\n**Markdown table** (`.md`):\n```markdown\n| from | to | note |\n|------|----|------|\n| Reinforcement Learning | 强化学习 | |\n| Transformer | Transformer | Keep English |\n```\n\n**YAML list** (`.yaml` / `.yml`):\n```yaml\n- from: \"Reinforcement Learning\"\n  to: \"强化学习\"\n- from: \"Transformer\"\n  to: \"Transformer\"\n  note: \"Keep English\"\n```\n\nPaths can be absolute or relative to the EXTEND.md file location.\n\n## Priority\n\n1. CLI `--glossary` file entries\n2. EXTEND.md `glossaries[pair]` entries\n3. EXTEND.md `glossary` entries (inline)\n4. EXTEND.md `glossary_files` entries (in listed order, later files override earlier)\n5. Built-in glossary (e.g., `references/glossary-en-zh.md`)\n\nLater entries override earlier ones for the same source term.\n\nFile v1.117.3:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-translate preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY translation. Do NOT:\n- Start translating content\n- Ask about files or output paths\n- Proceed to any workflow steps\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue translation\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Target Language\n\n```yaml\nheader: \"Target Language\"\nquestion: \"Default target language?\"\noptions:\n  - label: \"简体中文 zh-CN (Recommended)\"\n    description: \"Translate to Simplified Chinese\"\n  - label: \"繁體中文 zh-TW\"\n    description: \"Translate to Traditional Chinese\"\n  - label: \"English en\"\n    description: \"Translate to English\"\n  - label: \"日本語 ja\"\n    description: \"Translate to Japanese\"\n```\n\nNote: User may type a custom language code.\n\n### Question 2: Translation Mode\n\n```yaml\nheader: \"Mode\"\nquestion: \"Default translation mode?\"\noptions:\n  - label: \"Normal (Recommended)\"\n    description: \"Analyze content first, then translate\"\n  - label: \"Quick\"\n    description: \"Direct translation, no analysis\"\n  - label: \"Refined\"\n    description: \"Full workflow: analyze → translate → review → polish\"\n```\n\n### Question 3: Target Audience\n\n```yaml\nheader: \"Audience\"\nquestion: \"Default target audience?\"\noptions:\n  - label: \"General readers (Recommended)\"\n    description: \"Plain language, more translator's notes for jargon\"\n  - label: \"Technical\"\n    description: \"Developers/engineers, less annotation on tech terms\"\n  - label: \"Academic\"\n    description: \"Formal register, precise terminology\"\n  - label: \"Business\"\n    description: \"Business-friendly tone, explain tech concepts\"\n```\n\nNote: User may type a custom audience description.\n\n### Question 4: Translation Style\n\n```yaml\nheader: \"Style\"\nquestion: \"Translation style?\"\noptions:\n  - label: \"Storytelling (Recommended)\"\n    description: \"Engaging narrative flow, smooth transitions\"\n  - label: \"Formal\"\n    description: \"Professional, structured, neutral tone\"\n  - label: \"Technical\"\n    description: \"Precise, documentation-style, concise\"\n  - label: \"Literal\"\n    description: \"Close to original structure\"\n  - label: \"Academic\"\n    description: \"Scholarly, rigorous, formal register\"\n  - label: \"Business\"\n    description: \"Concise, results-focused, action-oriented\"\n  - label: \"Humorous\"\n    description: \"Preserves humor, witty, playful\"\n  - label: \"Conversational\"\n    description: \"Casual, friendly, spoken-like\"\n  - label: \"Elegant\"\n    description: \"Literary, polished, aesthetically refined\"\n```\n\nNote: User may type a custom style description.\n\n### Question 5: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"$HOME/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-translate/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md with selected values\n3. Confirm: \"Preferences saved to [path]\"\n4. Mention: \"You can add custom glossary terms to EXTEND.md anytime. See the `glossary` section in the file for the format.\"\n5. Continue with translation using saved preferences\n\n## EXTEND.md Template\n\n```yaml\ntarget_language: [zh-CN/zh-TW/en/ja/...]\ndefault_mode: [quick/normal/refined]\naudience: [general/technical/academic/business/custom]\nstyle: [storytelling/formal/technical/literal/academic/business/humorous/conversational/elegant]\n\n# Custom glossary (optional) — add your own term translations here\n# glossary:\n#   - from: \"Term\"\n#     to: \"翻译\"\n#   - from: \"Another Term\"\n#     to: \"另一个翻译\"\n#     note: \"Usage context\"\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.117.3:references/glossary-en-zh.md\n\n# English → Chinese Glossary\n\nTerms where standard translation is non-obvious or easily mistranslated. Common terms with straightforward translations (e.g., Machine Learning → 机器学习) are omitted — the model already knows these.\n\n| English | Chinese | Notes |\n|---------|---------|-------|\n| AI Agent | AI 智能体 | |\n| Vibe Coding | 凭感觉编程 | |\n| the Bitter Lesson | 苦涩的教训 | Rich Sutton's essay |\n| Context Engineering | 上下文工程 | |\n| AI Wrapper | AI 套壳 | |\n| RLHF | 基于人类反馈的强化学习 | |\n| Hallucination | 幻觉 | AI-specific meaning |\n| Alignment | 对齐 | AI safety context |\n| Guardrails | 护栏 | AI safety context |\n| Agentic | 智能体化的 | |\n| Grounding | 基础化/落地 | Context-dependent |\n| Embedding | 嵌入/向量化 | Context-dependent |\n| Moat | 护城河 | Business context |\n| Flywheel | 飞轮效应 | |\n| Boilerplate | 样板代码 | |\n\nFile v1.117.3:references/refined-workflow.md\n\n# Translation Workflow Details\n\nThis file provides detailed guidelines for each workflow step. Steps are shared across modes:\n\n- **Quick**: Translate only (no steps from this file)\n- **Normal**: Step 1 (Analysis) → Translate\n- **Refined**: Step 1 (Analysis) → Step 2 (Draft) → Step 3 (Review) → Step 4 (Revision) → Step 5 (Polish)\n- **Normal → Upgrade**: After normal mode, user can continue with Step 3 → Step 4 → Step 5\n\nAll intermediate results are saved as files in the output directory.\n\n## Step 1: Content Analysis\n\nBefore translating, analyze the source material. Save analysis to `01-analysis.md` in the output directory.\n\n### 1.1 Content Summary\n\n- What is this content about? What is the core argument?\n- Author background, stance, and writing context\n- Purpose and intended audience of the original\n\n### 1.2 Terminology\n\n- List technical terms, proper nouns, brand names, acronyms\n- Cross-reference with loaded glossaries\n- For terms not in glossary, determine standard translations\n- Record in a terminology table\n\n### 1.3 Tone & Style\n\n- Formal or conversational? Humor, metaphor, cultural references?\n- What register is appropriate for the translation given the target audience?\n\n### 1.4 Translation Challenges\n\nIdentify what may cause difficulty in translation:\n\n- **Comprehension gaps**: Terms or references that target readers may not understand — note what explanation is needed\n- **Figurative language**: Metaphors, idioms, expressions that don't translate literally — note intended meaning and target-language approach (interpret / substitute / retain)\n- **Structural challenges**: Long complex sentences, wordplay, puns, or humor that needs creative adaptation\n\n**Save `01-analysis.md`** with:\n```\n## Content Summary\n[Core argument, author, context, purpose]\n\n## Terminology\n[term → translation, ...]\n\n## Tone & Style\n[assessment]\n\n## Translation Challenges\n- [term/passage] → [challenge type] → [suggested approach]\n- ...\n```\n\n## Step 2: Assemble Translation Prompt\n\nMain agent reads `01-analysis.md` and assembles a complete translation prompt using [references/subagent-prompt-template.md](subagent-prompt-template.md). Inline the following from analysis:\n\n- **Target style**: Resolved style preset + source voice assessment from §1.3\n- **Content background**: Summary from §1.1\n- **Glossary**: Merged glossary with analysis-extracted terms from §1.2\n- **Translation challenges**: All challenges from §1.4\n\nSave to `02-prompt.md`. This prompt is used by the subagent (chunked) or by the main agent itself (non-chunked).\n\n## Step 3: Initial Draft\n\nSave to `03-draft.md` in the output directory.\n\nFor chunked content, the subagent produces this draft (merged from chunk translations). For non-chunked content, the main agent produces it directly.\n\nTranslate the full content following `02-prompt.md`. Apply all **Translation principles** from SKILL.md.\n\n## Step 4: Critical Review\n\nThe main agent critically reviews the draft against the source. Save review findings to `04-critique.md`. This step produces **diagnosis only** — no rewriting yet.\n\n### 4.1 Accuracy\n\n- Compare each paragraph against the original\n- Verify facts, numbers, dates, proper nouns\n- Flag content accidentally added, removed, or altered\n- Check terminology consistency with glossary\n\n### 4.2 Native Voice\n\n- Flag sentences that read as \"translated\" rather than \"written\" — unnatural word order, calques, stiff phrasing\n- For CJK targets: check for unnecessary connectives (因此/然而/此外), passive voice abuse (被/由/受到), noun pile-ups, over-nominalization\n- Flag metaphors translated literally that sound unnatural in the target language\n- Check emotional connotations are preserved, not flattened\n- Note where sentence restructuring would improve readability\n\n### 4.3 Notes & Adaptation\n\n- Are translator's notes accurate, concise, and genuinely helpful?\n- Flag missed comprehension challenges that need notes, and over-annotations on obvious terms\n- Were translation strategies from `02-prompt.md` followed?\n- Do cultural references work in the target language?\n\n**Save `04-critique.md`** with:\n```\n## Accuracy\n- [issue]: [location] — [description]\n\n## Native Voice\n- [issue]: [example] → [suggested fix]\n\n## Notes & Adaptation\n- [add/remove/revise]: [term/passage] — [reason]\n\n## Summary\n[Overall assessment: X critical issues, Y improvements]\n```\n\n## Step 5: Revision\n\nApply all findings from `04-critique.md` to produce a revised translation. Save to `05-revision.md`.\n\nRead `03-draft.md` and `04-critique.md`, fix all accuracy issues, rewrite unnatural expressions, adjust notes, and improve flow.\n\n## Step 6: Polish\n\nSave final version to `translation.md`.\n\nFinal pass on `05-revision.md` for publication quality:\n\n- Read the entire translation as a standalone piece — does it flow as native content?\n- Smooth remaining rough transitions\n- Ensure consistent narrative voice and style throughout\n- Final terminology consistency check\n- Verify formatting is preserved correctly\n\n## Subagent Responsibility\n\nEach subagent (one per chunk) is responsible **only** for producing the initial draft of its chunk (Step 3). The main agent assembles the shared prompt (Step 2), spawns all subagents in parallel, then takes over for critical review (Step 4), revision (Step 5), and polish (Step 6).\n\n## Chunked Refined Translation\n\nWhen content exceeds the chunk threshold and uses refined mode:\n\n1. Main agent runs analysis (Step 1) on the **entire** document first → `01-analysis.md`\n2. Main agent assembles translation prompt → `02-prompt.md`\n3. Split into chunks → `chunks/`\n4. Spawn one subagent per chunk in parallel (each reads `02-prompt.md` for shared context) → merge all results into `03-draft.md`\n5. Main agent critically reviews the merged draft → `04-critique.md`\n6. Main agent revises based on critique → `05-revision.md`\n7. Main agent polishes → `translation.md`\n8. Final cross-chunk consistency check: terminology, narrative flow, transitions at chunk boundaries\n\nFile v1.117.3:references/subagent-prompt-template.md\n\n# Subagent Translation Prompt Template\n\nTwo parts:\n1. **`02-prompt.md`** — Shared context (saved to output directory). Contains background, glossary, challenges, and principles. No task-specific instructions.\n2. **Subagent spawn prompt** — Task instructions passed when spawning each subagent. One subagent per chunk (or per source file if non-chunked).\n\nThe main agent reads `01-analysis.md` (if exists), inlines all relevant context into `02-prompt.md`, then spawns subagents in parallel with task instructions referencing that file.\n\nReplace `{placeholders}` with actual values. Omit sections marked \"if analysis exists\" for quick mode.\n\n---\n\n## Part 1: `02-prompt.md` (shared context, saved as file)\n\n```markdown\nYou are a professional translator. Your task is to translate markdown content from {source_lang} to {target_lang}.\n\n## Target Audience & Style\n\n**Audience**: {audience description}\n\n**Target style**: {style description — e.g., \"storytelling: engaging narrative flow, smooth transitions, vivid phrasing\" or custom style from user}\n\n**Source voice** (from analysis, if exists): {Brief description of the original author's voice — formal/conversational, humor, register, sentence rhythm.}\n\n## Content Background\n\n{Inlined from 01-analysis.md if analysis exists: content summary, core argument, author background, context.}\n\n## Glossary\n\nApply these term translations consistently. First occurrence: include original in parentheses.\n\n{Merged glossary — one per line: English → Translation}\n\n## Translation Challenges\n\n{Inlined from 01-analysis.md §1.4 if analysis exists. Comprehension gaps, figurative language, structural challenges with suggested approaches:}\n\n- **{term/passage}**: {challenge type} → {suggested approach}\n\n## Translation Principles\n\nRewrite the content into natural, engaging {target_lang} — not merely translate it. Every sentence should read as if a skilled native writer composed it from scratch.\n\n- **Accuracy first**: Facts, data, and logic must match the original exactly\n- **Natural flow**: Use idiomatic {target_lang} word order. Break long source sentences into shorter, natural ones. Interpret metaphors and idioms by intended meaning, not word-for-word\n- **Terminology**: Use glossary translations consistently. Annotate with original in parentheses on first occurrence of specialized terms\n- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)\n- **Proactive interpretation**: For jargon or concepts the target audience may lack context for, add concise explanations in **bold parentheses** `（**解释**）`. Keep annotations few — only where genuinely needed\n```\n\n---\n\n## Part 2: Subagent spawn prompt (passed as Agent tool prompt)\n\n### Chunked mode (one subagent per chunk, all spawned in parallel)\n\n```\nRead the translation instructions from: {output_dir}/02-prompt.md\n\nYou are translating chunk {NN} of {total_chunks}.\nContext: {brief description of what this chunk covers and where it sits in the overall argument}\n\nTranslate this chunk:\n1. Read `{output_dir}/chunks/chunk-{NN}.md`\n2. Translate following the instructions in 02-prompt.md\n3. Save translation to `{output_dir}/chunks/chunk-{NN}-draft.md`\n```\n\n### Non-chunked mode\n\n```\nRead the translation instructions from: {output_dir}/02-prompt.md\n\nTranslate the source file and save the result:\n1. Read `{source_file_path}`\n2. Save translation to `{output_path}`\n```\n\nFile v1.117.3:references/workflow-mechanics.md\n\n# Workflow Mechanics\n\nDetails for source materialization, output directory creation, and conflict resolution.\n\n## Materialize Source\n\n| Input Type | Action |\n|------------|--------|\n| File | Use as-is (no copy needed) |\n| Inline text | Save to `translate/{slug}.md` |\n| URL | Fetch content, save to `translate/{slug}.md` |\n\n`{slug}`: 2-4 word kebab-case slug derived from content topic.\n\n## Create Output Directory\n\nCreate a subdirectory next to the source file: `{source-dir}/{source-basename}-{target-lang}/`\n\nExamples:\n- `posts/article.md` → `posts/article-zh/`\n- `translate/ai-future.md` → `translate/ai-future-zh/`\n\n## Conflict Resolution\n\nIf the output directory already exists, rename the existing one to `{name}.backup-YYYYMMDD-HHMMSS/` before creating the new one. Never overwrite existing results.\n\nFile v1.117.3:scripts/package.json\n\n{\n  \"name\": \"baoyu-translate-chunk\",\n  \"private\": true,\n  \"dependencies\": {\n    \"markdown-it\": \"14.1.1\"\n  }\n}\n\nFile v1.117.3:skill-card.md\n\n## Description:\n\nBaoyu Translate helps an agent translate text, files, or URLs with quick, normal, and refined workflows plus configurable language, audience, style, glossary, and chunking support.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[jimliu](https://clawhub.ai/user/jimliu)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users, employees, and developers use this skill to translate articles, documents, inline text, and URL-sourced content into a target language. It supports fast direct translation as well as analysis, review, and polish workflows for publication-quality Markdown output.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The workflow may execute Bun through npx when a local Bun runtime is unavailable.\n\nMitigation: Install and use a trusted Bun runtime before running the skill, or review the command path before allowing npx-based execution.\n\nRisk: Translation workflows save source material, intermediate analysis, drafts, critiques, revisions, chunks, and final translations as local files.\n\nMitigation: Avoid translating sensitive documents unless local intermediate storage is acceptable, and remove generated working files when they are no longer needed.\n\nRisk: Existing output directories may be moved to timestamped backups during conflict resolution.\n\nMitigation: Check the target output directory before running the skill and review backup folders after completion.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/jimliu/skills/baoyu-translate)\n- [Project Homepage](https://github.com/JimLiu/baoyu-skills#baoyu-translate)\n- [EXTEND.md Schema](references/config/extend-schema.md)\n- [First-Time Setup](references/config/first-time-setup.md)\n- [Workflow Mechanics](references/workflow-mechanics.md)\n- [Translation Workflow Details](references/refined-workflow.md)\n- [Subagent Translation Prompt Template](references/subagent-prompt-template.md)\n- [English to Chinese Glossary](references/glossary-en-zh.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Files, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown files with concise status text and occasional inline shell commands]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Final output is translation.md; normal and refined modes may also produce analysis, prompt, draft, critique, revision, and chunk files.]\n\n## Skill Version(s):\n\n1.117.3 (source: server release evidence and SKILL.md frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.117.2: 13 files, 22578 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (6040b), references/subagent-prompt-template.md (3442b), references/workflow-mechanics.md (812b), scripts/bun.lock (1456b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), skill-card.md (3049b), SKILL.md (16018b), _meta.json (136b)\n\nFile v1.117.2:SKILL.md\n\n---\nname: baoyu-translate\ndescription: 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.\nversion: 1.59.0\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-translate\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Translator\n\nThree-mode translation skill: **quick** for direct translation, **normal** for analysis-informed translation, **refined** for full publication-quality workflow with review and polish.\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts in `scripts/` subdirectory. `{baseDir}` = 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 `{baseDir}` and `${BUN_X}` with actual values.\n\n| Script | Purpose |\n|--------|---------|\n| `scripts/main.ts` | CLI entry point. Default action splits markdown into chunks; also supports explicit `chunk` subcommand |\n| `scripts/chunk.ts` | Markdown chunking implementation used by `main.ts` and kept compatible for direct invocation |\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-translate/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-translate/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply. On first use in session, briefly remind: \"Using preferences from [path]. You can edit EXTEND.md to customize glossary, audience, etc.\" |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently use defaults |\n\n**EXTEND.md supports**: default target language, default mode, target audience, custom glossaries (inline or file path), translation style, chunk settings.\n\nSchema: [references/config/extend-schema.md](references/config/extend-schema.md).\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST** run the first-time setup before ANY translation. This is a **BLOCKING** operation.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\nUse `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.\n\n## Defaults\n\nAll configurable values in one place. EXTEND.md overrides these; CLI flags override EXTEND.md.\n\n| Setting | Default | EXTEND.md key | CLI flag | Description |\n|---------|---------|---------------|----------|-------------|\n| Target language | `zh-CN` | `target_language` | `--to` | Translation target language |\n| Mode | `normal` | `default_mode` | `--mode` | Translation mode |\n| Audience | `general` | `audience` | `--audience` | Target reader profile |\n| Style | `storytelling` | `style` | `--style` | Translation style preference |\n| Chunk threshold | `4000` | `chunk_threshold` | — | Word count to trigger chunked translation |\n| Chunk max words | `5000` | `chunk_max_words` | — | Max words per chunk |\n\n## Modes\n\n| Mode | Flag | Steps | When to Use |\n|------|------|-------|-------------|\n| Quick | `--mode quick` | Translate | Short texts, informal content, quick tasks |\n| Normal | `--mode normal` (default) | Analyze → Translate | Articles, blog posts, general content |\n| Refined | `--mode refined` | Analyze → Translate → Review → Polish | Publication-quality, important documents |\n\n**Default mode**: Normal (can be overridden in EXTEND.md `default_mode` setting).\n\n**Style presets** — control the voice and tone of the translation (independent of audience):\n\n| Value | Description | Effect |\n|-------|-------------|--------|\n| `storytelling` | Engaging narrative flow (default) | Draws readers in, smooth transitions, vivid phrasing |\n| `formal` | Professional, structured | Neutral tone, clear organization, no colloquialisms |\n| `technical` | Precise, documentation-style | Concise, terminology-heavy, minimal embellishment |\n| `literal` | Close to original structure | Minimal restructuring, preserves source sentence patterns |\n| `academic` | Scholarly, rigorous | Formal register, complex clauses OK, citation-aware |\n| `business` | Concise, results-focused | Action-oriented, executive-friendly, bullet-point mindset |\n| `humorous` | Preserves and adapts humor | Witty, playful, recreates comedic effect in target language |\n| `conversational` | Casual, spoken-like | Friendly, approachable, as if explaining to a friend |\n| `elegant` | Literary, polished prose | Aesthetically refined, rhythmic, carefully crafted word choices |\n\nCustom style descriptions are also accepted, e.g., `--style \"poetic and lyrical\"`.\n\n**Auto-detection**:\n- \"快翻\", \"quick\", \"直接翻译\" → quick mode\n- \"精翻\", \"refined\", \"publication quality\", \"proofread\" → refined mode\n- Otherwise → default mode (normal)\n\n**Upgrade prompt**: After normal mode completes, display:\n> Translation saved. To further review and polish, reply \"继续润色\" or \"refine\".\n\nIf user responds, continue with review → polish steps (same as refined mode Steps 4-6 in refined-workflow.md) on the existing output.\n\n**Audience presets**:\n\n| Value | Description | Effect |\n|-------|-------------|--------|\n| `general` | General readers (default) | Plain language, more translator's notes for jargon |\n| `technical` | Developers / engineers | Less annotation on common tech terms |\n| `academic` | Researchers / scholars | Formal register, precise terminology |\n| `business` | Business professionals | Business-friendly tone, explain tech concepts |\n\nCustom audience descriptions are also accepted, e.g., `--audience \"AI感兴趣的普通读者\"`.\n\n## Workflow\n\n### Step 1: Load Preferences\n\n1.1 Check EXTEND.md (see Preferences section above)\n\n1.2 Load built-in glossary for the language pair if available:\n- EN→ZH: [references/glossary-en-zh.md](references/glossary-en-zh.md)\n\n1.3 Merge glossaries: EXTEND.md `glossary` (inline) + EXTEND.md `glossary_files` (external files, paths relative to EXTEND.md location) + built-in glossary + `--glossary` file (CLI overrides all)\n\n### Step 2: Materialize Source & Create Output Directory\n\nMaterialize 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.\n\nFull details: [references/workflow-mechanics.md](references/workflow-mechanics.md)\n\n**Output directory contents** (all intermediate and final files go here):\n\n| File | Mode | Description |\n|------|------|-------------|\n| `translation.md` | All | Final translation (always this name) |\n| `01-analysis.md` | Normal, Refined | Content analysis (domain, tone, terminology) |\n| `02-prompt.md` | Normal, Refined | Assembled translation prompt |\n| `03-draft.md` | Refined | Initial draft before review |\n| `04-critique.md` | Refined | Critical review findings (diagnosis only) |\n| `05-revision.md` | Refined | Revised translation based on critique |\n| `chunks/` | Chunked | Source chunks + translated chunks |\n\n### Step 3: Assess Content Length\n\nQuick 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.\n\nFor normal and refined modes:\n\n| Content | Action |\n|---------|--------|\n| < chunk threshold | Translate as single unit |\n| >= chunk threshold | Chunk translation (see Step 3.1) |\n\n**3.1 Long Content Preparation** (normal/refined modes, >= chunk threshold only)\n\nBefore translating chunks:\n\n1. **Extract terminology**: Scan entire document for proper nouns, technical terms, recurring phrases\n2. **Build session glossary**: Merge extracted terms with loaded glossaries, establish consistent translations\n3. **Split into chunks**: Use `${BUN_X} {baseDir}/scripts/main.ts <file> [--max-words <chunk_max_words>] [--output-dir <output-dir>]`\n   - Parses markdown blocks (headings, paragraphs, lists, code blocks, tables, etc.)\n   - Splits at markdown block boundaries to preserve structure\n   - If a single block exceeds the threshold, falls back to line splitting, then word splitting\n4. **Assemble translation prompt**:\n   - Main agent reads `01-analysis.md` (if exists) and assembles shared context using Part 1 of [references/subagent-prompt-template.md](references/subagent-prompt-template.md) — inlining: target style, content background, merged glossary, and translation challenges\n   - Save as `02-prompt.md` in the output directory (shared context only, no task instructions)\n5. **Draft translation via subagents** (if Agent tool available):\n   - Spawn one subagent **per chunk**, all in parallel (Part 2 of the template)\n   - Each subagent reads `02-prompt.md` for shared context, receives chunk position info (chunk N of M + brief context of where it sits in the argument), translates its chunk, saves to `chunks/chunk-NN-draft.md`\n   - Consistency is guaranteed by the shared `02-prompt.md` (glossary, figurative language mapping, comprehension challenges, source voice, and translation challenges from analysis)\n   - If no chunks (content under threshold): spawn one subagent for the entire source file\n   - If Agent tool is unavailable, translate chunks sequentially inline using `02-prompt.md`\n6. **Merge**: Once all subagents complete, combine translated chunks in order. If `chunks/frontmatter.md` exists, prepend it. Save as `03-draft.md` (refined) or `translation.md` (normal)\n7. All intermediate files (source chunks + translated chunks) are preserved in `chunks/`\n\n**After chunked draft is merged**, return control to main agent for critical review, revision, and polish (Step 4).\n\n### Step 4: Translate & Refine\n\n**Translation principles** (apply to all modes):\n\n- **Rewrite, not translate**: Rewrite content into natural, engaging target language as if a skilled native writer composed it from scratch. Quality test: \"Does this read like it was originally written in the target language?\"\n- **Accuracy first**: Facts, data, and logic must match the original exactly\n- **Natural flow**: Use idiomatic target language word order. Break long source sentences into shorter, natural ones. Interpret metaphors and idioms by intended meaning, not word-for-word\n- **Terminology**: Use standard translations consistently. First occurrence of specialized terms: annotate with original in parentheses\n- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)\n- **Proactive interpretation**: For jargon or concepts the target audience may lack context for, add concise explanations in **bold parentheses** `（**解释**）`. Keep annotations few — only where genuinely needed for comprehension\n- **Frontmatter**: If source has YAML frontmatter, rename source-metadata fields with `source` prefix (camelCase: `url`→`sourceUrl`, `title`→`sourceTitle`, etc.), add translated values as new top-level fields (skip `title` if body has H1), keep other fields as-is\n\n#### Quick Mode\n\nTranslate directly → save to `translation.md`. Apply all translation principles above.\n\n#### Normal Mode\n\n1. **Analyze** → `01-analysis.md` (domain, tone, terminology, translation challenges)\n2. **Assemble prompt** → `02-prompt.md` (translation instructions with context, glossary, challenges)\n3. **Translate** (following `02-prompt.md`) → `translation.md`\n\nAfter completion, prompt user: \"Translation saved. To further review and polish, reply **继续润色** or **refine**.\"\n\nIf 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`.\n\n#### Refined Mode\n\nFull workflow for publication quality. See [references/refined-workflow.md](references/refined-workflow.md) for detailed guidelines per step.\n\nThe 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.\n\nSteps and saved files (all in output directory):\n1. **Analyze** → `01-analysis.md` (domain, tone, terminology, translation challenges)\n2. **Assemble prompt** → `02-prompt.md` (translation instructions with inlined context)\n3. **Draft** → `03-draft.md` (initial translation with translator's notes; from subagent if chunked)\n4. **Critical review** → `04-critique.md` (diagnosis only: accuracy, Europeanized language, strategy execution, expression issues)\n5. **Revision** → `05-revision.md` (apply all critique findings to produce revised translation)\n6. **Polish** → `translation.md` (final publication-quality translation)\n\nEach step reads the previous step's file and builds on it.\n\n### Step 5: Output\n\nFinal translation is always at `translation.md` in the output directory.\n\nAfter the final translation is written, do a lightweight image-language pass:\n\n1. Collect image references from the translated article\n2. Identify likely text-heavy images such as covers, screenshots, diagrams, charts, frameworks, and infographics\n3. If any image likely contains a main text language that does not match the translated article language, proactively remind the user\n4. The reminder must be a list only. Do not automatically localize those images unless the user asks\n\nReminder format (use whatever image syntax the article already uses — standard markdown or wikilink):\n```text\nPossible image localization needed:\n- ![example cover](attachments/example-cover.png): likely still contains source-language text while the article is now in target language\n- ![example diagram](attachments/example-diagram.png): likely text-heavy framework graphic, check whether labels need translation\n```\n\nDisplay summary:\n```\n**Translation complete** ({mode} mode)\n\nSource: {source-path}\nLanguages: {from} → {to}\nOutput dir: {output-dir}/\nFinal: {output-dir}/translation.md\nGlossary terms applied: {count}\n```\n\nIf mismatched image-language candidates were found, append a short note after the summary telling the user that some embedded images may still need image-text localization, followed by the candidate list.\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.117.2:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-translate\",\n  \"version\": \"1.117.2\",\n  \"publishedAt\": 1779070580295\n}\n\nFile v1.117.2:references/config/extend-schema.md\n\n# EXTEND.md Schema for baoyu-translate\n\n## Format\n\nEXTEND.md uses YAML format:\n\n```yaml\n# Default target language (ISO code or common name)\ntarget_language: zh-CN\n\n# Default translation mode\ndefault_mode: normal  # quick | normal | refined\n\n# Target audience (affects annotation depth and register)\naudience: general  # general | technical | academic | business | or custom string\n\n# Translation style preference\nstyle: storytelling  # storytelling | formal | technical | literal | academic | business | humorous | conversational | elegant | or custom string\n\n# Word count threshold to trigger chunked translation\nchunk_threshold: 4000\n\n# Max words per chunk\nchunk_max_words: 5000\n\n# Custom glossary (merged with built-in glossary)\n# CLI --glossary flag overrides these\n# Supports inline entries and/or file paths\nglossary:\n  - from: \"Reinforcement Learning\"\n    to: \"强化学习\"\n  - from: \"Transformer\"\n    to: \"Transformer\"\n    note: \"Keep English\"\n\n# Load glossary from external file(s)\n# Supports absolute path or relative to EXTEND.md location\n# File format: markdown table with | from | to | note | columns,\n# or YAML list of {from, to, note} entries\nglossary_files:\n  - ./my-glossary.md\n  - /path/to/shared-glossary.yaml\n\n# Language-pair specific glossaries\nglossaries:\n  en-zh:\n    - from: \"AI Agent\"\n      to: \"AI 智能体\"\n  ja-zh:\n    - from: \"人工知能\"\n      to: \"人工智能\"\n```\n\n## Fields\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| `target_language` | string | `zh-CN` | Default target language code |\n| `default_mode` | string | `normal` | Default translation mode (`quick` / `normal` / `refined`) |\n| `audience` | string | `general` | Target reader profile (`general` / `technical` / `academic` / `business` / custom) |\n| `style` | string | `storytelling` | Translation style (`storytelling` / `formal` / `technical` / `literal` / `academic` / `business` / `humorous` / `conversational` / `elegant` / custom) |\n| `chunk_threshold` | number | `4000` | Word count threshold to trigger chunked translation |\n| `chunk_max_words` | number | `5000` | Max words per chunk |\n| `glossary` | array | `[]` | Universal glossary entries (inline) |\n| `glossary_files` | array | `[]` | External glossary file paths (absolute or relative to EXTEND.md) |\n| `glossaries` | object | `{}` | Language-pair specific glossary entries |\n\n## Glossary Entry\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `from` | yes | Source term |\n| `to` | yes | Target translation |\n| `note` | no | Usage note (e.g., \"Keep English\", \"Only in tech context\") |\n\n## Glossary File Format\n\nExternal glossary files (`glossary_files`) support two formats:\n\n**Markdown table** (`.md`):\n```markdown\n| from | to | note |\n|------|----|------|\n| Reinforcement Learning | 强化学习 | |\n| Transformer | Transformer | Keep English |\n```\n\n**YAML list** (`.yaml` / `.yml`):\n```yaml\n- from: \"Reinforcement Learning\"\n  to: \"强化学习\"\n- from: \"Transformer\"\n  to: \"Transformer\"\n  note: \"Keep English\"\n```\n\nPaths can be absolute or relative to the EXTEND.md file location.\n\n## Priority\n\n1. CLI `--glossary` file entries\n2. EXTEND.md `glossaries[pair]` entries\n3. EXTEND.md `glossary` entries (inline)\n4. EXTEND.md `glossary_files` entries (in listed order, later files override earlier)\n5. Built-in glossary (e.g., `references/glossary-en-zh.md`)\n\nLater entries override earlier ones for the same source term.\n\nFile v1.117.2:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-translate preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY translation. Do NOT:\n- Start translating content\n- Ask about files or output paths\n- Proceed to any workflow steps\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue translation\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Target Language\n\n```yaml\nheader: \"Target Language\"\nquestion: \"Default target language?\"\noptions:\n  - label: \"简体中文 zh-CN (Recommended)\"\n    description: \"Translate to Simplified Chinese\"\n  - label: \"繁體中文 zh-TW\"\n    description: \"Translate to Traditional Chinese\"\n  - label: \"English en\"\n    description: \"Translate to English\"\n  - label: \"日本語 ja\"\n    description: \"Translate to Japanese\"\n```\n\nNote: User may type a custom language code.\n\n### Question 2: Translation Mode\n\n```yaml\nheader: \"Mode\"\nquestion: \"Default translation mode?\"\noptions:\n  - label: \"Normal (Recommended)\"\n    description: \"Analyze content first, then translate\"\n  - label: \"Quick\"\n    description: \"Direct translation, no analysis\"\n  - label: \"Refined\"\n    description: \"Full workflow: analyze → translate → review → polish\"\n```\n\n### Question 3: Target Audience\n\n```yaml\nheader: \"Audience\"\nquestion: \"Default target audience?\"\noptions:\n  - label: \"General readers (Recommended)\"\n    description: \"Plain language, more translator's notes for jargon\"\n  - label: \"Technical\"\n    description: \"Developers/engineers, less annotation on tech terms\"\n  - label: \"Academic\"\n    description: \"Formal register, precise terminology\"\n  - label: \"Business\"\n    description: \"Business-friendly tone, explain tech concepts\"\n```\n\nNote: User may type a custom audience description.\n\n### Question 4: Translation Style\n\n```yaml\nheader: \"Style\"\nquestion: \"Translation style?\"\noptions:\n  - label: \"Storytelling (Recommended)\"\n    description: \"Engaging narrative flow, smooth transitions\"\n  - label: \"Formal\"\n    description: \"Professional, structured, neutral tone\"\n  - label: \"Technical\"\n    description: \"Precise, documentation-style, concise\"\n  - label: \"Literal\"\n    description: \"Close to original structure\"\n  - label: \"Academic\"\n    description: \"Scholarly, rigorous, formal register\"\n  - label: \"Business\"\n    description: \"Concise, results-focused, action-oriented\"\n  - label: \"Humorous\"\n    description: \"Preserves humor, witty, playful\"\n  - label: \"Conversational\"\n    description: \"Casual, friendly, spoken-like\"\n  - label: \"Elegant\"\n    description: \"Literary, polished, aesthetically refined\"\n```\n\nNote: User may type a custom style description.\n\n### Question 5: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"$HOME/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-translate/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md with selected values\n3. Confirm: \"Preferences saved to [path]\"\n4. Mention: \"You can add custom glossary terms to EXTEND.md anytime. See the `glossary` section in the file for the format.\"\n5. Continue with translation using saved preferences\n\n## EXTEND.md Template\n\n```yaml\ntarget_language: [zh-CN/zh-TW/en/ja/...]\ndefault_mode: [quick/normal/refined]\naudience: [general/technical/academic/business/custom]\nstyle: [storytelling/formal/technical/literal/academic/business/humorous/conversational/elegant]\n\n# Custom glossary (optional) — add your own term translations here\n# glossary:\n#   - from: \"Term\"\n#     to: \"翻译\"\n#   - from: \"Another Term\"\n#     to: \"另一个翻译\"\n#     note: \"Usage context\"\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.117.2:references/glossary-en-zh.md\n\n# English → Chinese Glossary\n\nTerms where standard translation is non-obvious or easily mistranslated. Common terms with straightforward translations (e.g., Machine Learning → 机器学习) are omitted — the model already knows these.\n\n| English | Chinese | Notes |\n|---------|---------|-------|\n| AI Agent | AI 智能体 | |\n| Vibe Coding | 凭感觉编程 | |\n| the Bitter Lesson | 苦涩的教训 | Rich Sutton's essay |\n| Context Engineering | 上下文工程 | |\n| AI Wrapper | AI 套壳 | |\n| RLHF | 基于人类反馈的强化学习 | |\n| Hallucination | 幻觉 | AI-specific meaning |\n| Alignment | 对齐 | AI safety context |\n| Guardrails | 护栏 | AI safety context |\n| Agentic | 智能体化的 | |\n| Grounding | 基础化/落地 | Context-dependent |\n| Embedding | 嵌入/向量化 | Context-dependent |\n| Moat | 护城河 | Business context |\n| Flywheel | 飞轮效应 | |\n| Boilerplate | 样板代码 | |\n\nFile v1.117.2:references/refined-workflow.md\n\n# Translation Workflow Details\n\nThis file provides detailed guidelines for each workflow step. Steps are shared across modes:\n\n- **Quick**: Translate only (no steps from this file)\n- **Normal**: Step 1 (Analysis) → Translate\n- **Refined**: Step 1 (Analysis) → Step 2 (Draft) → Step 3 (Review) → Step 4 (Revision) → Step 5 (Polish)\n- **Normal → Upgrade**: After normal mode, user can continue with Step 3 → Step 4 → Step 5\n\nAll intermediate results are saved as files in the output directory.\n\n## Step 1: Content Analysis\n\nBefore translating, analyze the source material. Save analysis to `01-analysis.md` in the output directory.\n\n### 1.1 Content Summary\n\n- What is this content about? What is the core argument?\n- Author background, stance, and writing context\n- Purpose and intended audience of the original\n\n### 1.2 Terminology\n\n- List technical terms, proper nouns, brand names, acronyms\n- Cross-reference with loaded glossaries\n- For terms not in glossary, determine standard translations\n- Record in a terminology table\n\n### 1.3 Tone & Style\n\n- Formal or conversational? Humor, metaphor, cultural references?\n- What register is appropriate for the translation given the target audience?\n\n### 1.4 Translation Challenges\n\nIdentify what may cause difficulty in translation:\n\n- **Comprehension gaps**: Terms or references that target readers may not understand — note what explanation is needed\n- **Figurative language**: Metaphors, idioms, expressions that don't translate literally — note intended meaning and target-language approach (interpret / substitute / retain)\n- **Structural challenges**: Long complex sentences, wordplay, puns, or humor that needs creative adaptation\n\n**Save `01-analysis.md`** with:\n```\n## Content Summary\n[Core argument, author, context, purpose]\n\n## Terminology\n[term → translation, ...]\n\n## Tone & Style\n[assessment]\n\n## Translation Challenges\n- [term/passage] → [challenge type] → [suggested approach]\n- ...\n```\n\n## Step 2: Assemble Translation Prompt\n\nMain agent reads `01-analysis.md` and assembles a complete translation prompt using [references/subagent-prompt-template.md](subagent-prompt-template.md). Inline the following from analysis:\n\n- **Target style**: Resolved style preset + source voice assessment from §1.3\n- **Content background**: Summary from §1.1\n- **Glossary**: Merged glossary with analysis-extracted terms from §1.2\n- **Translation challenges**: All challenges from §1.4\n\nSave to `02-prompt.md`. This prompt is used by the subagent (chunked) or by the main agent itself (non-chunked).\n\n## Step 3: Initial Draft\n\nSave to `03-draft.md` in the output directory.\n\nFor chunked content, the subagent produces this draft (merged from chunk translations). For non-chunked content, the main agent produces it directly.\n\nTranslate the full content following `02-prompt.md`. Apply all **Translation principles** from SKILL.md.\n\n## Step 4: Critical Review\n\nThe main agent critically reviews the draft against the source. Save review findings to `04-critique.md`. This step produces **diagnosis only** — no rewriting yet.\n\n### 4.1 Accuracy\n\n- Compare each paragraph against the original\n- Verify facts, numbers, dates, proper nouns\n- Flag content accidentally added, removed, or altered\n- Check terminology consistency with glossary\n\n### 4.2 Native Voice\n\n- Flag sentences that read as \"translated\" rather than \"written\" — unnatural word order, calques, stiff phrasing\n- For CJK targets: check for unnecessary connectives (因此/然而/此外), passive voice abuse (被/由/受到), noun pile-ups, over-nominalization\n- Flag metaphors translated literally that sound unnatural in the target language\n- Check emotional connotations are preserved, not flattened\n- Note where sentence restructuring would improve readability\n\n### 4.3 Notes & Adaptation\n\n- Are translator's notes accurate, concise, and genuinely helpful?\n- Flag missed comprehension challenges that need notes, and over-annotations on obvious terms\n- Were translation strategies from `02-prompt.md` followed?\n- Do cultural references work in the target language?\n\n**Save `04-critique.md`** with:\n```\n## Accuracy\n- [issue]: [location] — [description]\n\n## Native Voice\n- [issue]: [example] → [suggested fix]\n\n## Notes & Adaptation\n- [add/remove/revise]: [term/passage] — [reason]\n\n## Summary\n[Overall assessment: X critical issues, Y improvements]\n```\n\n## Step 5: Revision\n\nApply all findings from `04-critique.md` to produce a revised translation. Save to `05-revision.md`.\n\nRead `03-draft.md` and `04-critique.md`, fix all accuracy issues, rewrite unnatural expressions, adjust notes, and improve flow.\n\n## Step 6: Polish\n\nSave final version to `translation.md`.\n\nFinal pass on `05-revision.md` for publication quality:\n\n- Read the entire translation as a standalone piece — does it flow as native content?\n- Smooth remaining rough transitions\n- Ensure consistent narrative voice and style throughout\n- Final terminology consistency check\n- Verify formatting is preserved correctly\n\n## Subagent Responsibility\n\nEach subagent (one per chunk) is responsible **only** for producing the initial draft of its chunk (Step 3). The main agent assembles the shared prompt (Step 2), spawns all subagents in parallel, then takes over for critical review (Step 4), revision (Step 5), and polish (Step 6).\n\n## Chunked Refined Translation\n\nWhen content exceeds the chunk threshold and uses refined mode:\n\n1. Main agent runs analysis (Step 1) on the **entire** document first → `01-analysis.md`\n2. Main agent assembles translation prompt → `02-prompt.md`\n3. Split into chunks → `chunks/`\n4. Spawn one subagent per chunk in parallel (each reads `02-prompt.md` for shared context) → merge all results into `03-draft.md`\n5. Main agent critically reviews the merged draft → `04-critique.md`\n6. Main agent revises based on critique → `05-revision.md`\n7. Main agent polishes → `translation.md`\n8. Final cross-chunk consistency check: terminology, narrative flow, transitions at chunk boundaries\n\nFile v1.117.2:references/subagent-prompt-template.md\n\n# Subagent Translation Prompt Template\n\nTwo parts:\n1. **`02-prompt.md`** — Shared context (saved to output directory). Contains background, glossary, challenges, and principles. No task-specific instructions.\n2. **Subagent spawn prompt** — Task instructions passed when spawning each subagent. One subagent per chunk (or per source file if non-chunked).\n\nThe main agent reads `01-analysis.md` (if exists), inlines all relevant context into `02-prompt.md`, then spawns subagents in parallel with task instructions referencing that file.\n\nReplace `{placeholders}` with actual values. Omit sections marked \"if analysis exists\" for quick mode.\n\n---\n\n## Part 1: `02-prompt.md` (shared context, saved as file)\n\n```markdown\nYou are a professional translator. Your task is to translate markdown content from {source_lang} to {target_lang}.\n\n## Target Audience & Style\n\n**Audience**: {audience description}\n\n**Target style**: {style description — e.g., \"storytelling: engaging narrative flow, smooth transitions, vivid phrasing\" or custom style from user}\n\n**Source voice** (from analysis, if exists): {Brief description of the original author's voice — formal/conversational, humor, register, sentence rhythm.}\n\n## Content Background\n\n{Inlined from 01-analysis.md if analysis exists: content summary, core argument, author background, context.}\n\n## Glossary\n\nApply these term translations consistently. First occurrence: include original in parentheses.\n\n{Merged glossary — one per line: English → Translation}\n\n## Translation Challenges\n\n{Inlined from 01-analysis.md §1.4 if analysis exists. Comprehension gaps, figurative language, structural challenges with suggested approaches:}\n\n- **{term/passage}**: {challenge type} → {suggested approach}\n\n## Translation Principles\n\nRewrite the content into natural, engaging {target_lang} — not merely translate it. Every sentence should read as if a skilled native writer composed it from scratch.\n\n- **Accuracy first**: Facts, data, and logic must match the original exactly\n- **Natural flow**: Use idiomatic {target_lang} word order. Break long source sentences into shorter, natural ones. Interpret metaphors and idioms by intended meaning, not word-for-word\n- **Terminology**: Use glossary translations consistently. Annotate with original in parentheses on first occurrence of specialized terms\n- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)\n- **Proactive interpretation**: For jargon or concepts the target audience may lack context for, add concise explanations in **bold parentheses** `（**解释**）`. Keep annotations few — only where genuinely needed\n```\n\n---\n\n## Part 2: Subagent spawn prompt (passed as Agent tool prompt)\n\n### Chunked mode (one subagent per chunk, all spawned in parallel)\n\n```\nRead the translation instructions from: {output_dir}/02-prompt.md\n\nYou are translating chunk {NN} of {total_chunks}.\nContext: {brief description of what this chunk covers and where it sits in the overall argument}\n\nTranslate this chunk:\n1. Read `{output_dir}/chunks/chunk-{NN}.md`\n2. Translate following the instructions in 02-prompt.md\n3. Save translation to `{output_dir}/chunks/chunk-{NN}-draft.md`\n```\n\n### Non-chunked mode\n\n```\nRead the translation instructions from: {output_dir}/02-prompt.md\n\nTranslate the source file and save the result:\n1. Read `{source_file_path}`\n2. Save translation to `{output_path}`\n```\n\nFile v1.117.2:references/workflow-mechanics.md\n\n# Workflow Mechanics\n\nDetails for source materialization, output directory creation, and conflict resolution.\n\n## Materialize Source\n\n| Input Type | Action |\n|------------|--------|\n| File | Use as-is (no copy needed) |\n| Inline text | Save to `translate/{slug}.md` |\n| URL | Fetch content, save to `translate/{slug}.md` |\n\n`{slug}`: 2-4 word kebab-case slug derived from content topic.\n\n## Create Output Directory\n\nCreate a subdirectory next to the source file: `{source-dir}/{source-basename}-{target-lang}/`\n\nExamples:\n- `posts/article.md` → `posts/article-zh/`\n- `translate/ai-future.md` → `translate/ai-future-zh/`\n\n## Conflict Resolution\n\nIf the output directory already exists, rename the existing one to `{name}.backup-YYYYMMDD-HHMMSS/` before creating the new one. Never overwrite existing results.\n\nFile v1.117.2:scripts/package.json\n\n{\n  \"name\": \"baoyu-translate-chunk\",\n  \"private\": true,\n  \"dependencies\": {\n    \"markdown-it\": \"14.1.1\"\n  }\n}\n\nFile v1.117.2:skill-card.md\n\n## Description: <br>\nTranslates articles and documents between languages with quick, normal, and refined modes, supporting custom glossaries and terminology consistency through EXTEND.md. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jimliu](https://clawhub.ai/user/jimliu) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users and developers use this skill to translate articles, documents, inline text, URLs, and files between languages while preserving Markdown structure, terminology, tone, and audience fit. It supports quick direct translation, analysis-informed normal translation, and a refined review-and-polish workflow for publication-quality output. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Translated source material and intermediate drafts may be saved on disk. <br>\nMitigation: Use a private workspace for confidential documents and review or delete generated analysis, chunk, draft, and translation files after use. <br>\nRisk: Preference files can persist target language, audience, style, and glossary choices across future translations. <br>\nMitigation: Choose project-local preferences when settings are document-specific, and avoid storing secrets or sensitive glossary entries in shared configuration files. <br>\nRisk: Long documents may be split into chunks, which can leave additional source and draft files in the output directory. <br>\nMitigation: Inspect the final translation for cross-chunk consistency and remove preserved chunk artifacts when the source content is sensitive. <br>\n\n\n## Reference(s): <br>\n- [Project homepage](https://github.com/JimLiu/baoyu-skills#baoyu-translate) <br>\n- [EXTEND.md Schema](references/config/extend-schema.md) <br>\n- [First-Time Setup](references/config/first-time-setup.md) <br>\n- [EN-ZH Glossary](references/glossary-en-zh.md) <br>\n- [Refined Translation Workflow](references/refined-workflow.md) <br>\n- [Subagent Translation Prompt Template](references/subagent-prompt-template.md) <br>\n- [Workflow Mechanics](references/workflow-mechanics.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Files, Shell commands, Configuration instructions, Guidance] <br>\n**Output Format:** [Markdown translations, intermediate Markdown analysis and draft files, configuration files, and concise completion summaries.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May create EXTEND.md preferences, translation output directories, chunk files, analysis files, prompts, drafts, critique, revisions, and final translation.md.] <br>\n\n## Skill Version(s): <br>\n1.117.2 (source: server release metadata; artifact frontmatter lists 1.59.0) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.115.4: 12 files, 21049 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (6040b), references/subagent-prompt-template.md (3442b), references/workflow-mechanics.md (812b), scripts/bun.lock (1456b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), SKILL.md (16018b), _meta.json (136b)\n\nFile v1.115.4:SKILL.md\n\n---\nname: baoyu-translate\ndescription: 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.\nversion: 1.59.0\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-translate\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Translator\n\nThree-mode translation skill: **quick** for direct translation, **normal** for analysis-informed translation, **refined** for full publication-quality workflow with review and polish.\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts in `scripts/` subdirectory. `{baseDir}` = 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 `{baseDir}` and `${BUN_X}` with actual values.\n\n| Script | Purpose |\n|--------|---------|\n| `scripts/main.ts` | CLI entry point. Default action splits markdown into chunks; also supports explicit `chunk` subcommand |\n| `scripts/chunk.ts` | Markdown chunking implementation used by `main.ts` and kept compatible for direct invocation |\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-translate/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-translate/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply. On first use in session, briefly remind: \"Using preferences from [path]. You can edit EXTEND.md to customize glossary, audience, etc.\" |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently use defaults |\n\n**EXTEND.md supports**: default target language, default mode, target audience, custom glossaries (inline or file path), translation style, chunk settings.\n\nSchema: [references/config/extend-schema.md](references/config/extend-schema.md).\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST** run the first-time setup before ANY translation. This is a **BLOCKING** operation.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\nUse `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.\n\n## Defaults\n\nAll configurable values in one place. EXTEND.md overrides these; CLI flags override EXTEND.md.\n\n| Setting | Default | EXTEND.md key | CLI flag | Description |\n|---------|---------|---------------|----------|-------------|\n| Target language | `zh-CN` | `target_language` | `--to` | Translation target language |\n| Mode | `normal` | `default_mode` | `--mode` | Translation mode |\n| Audience | `general` | `audience` | `--audience` | Target reader profile |\n| Style | `storytelling` | `style` | `--style` | Translation style preference |\n| Chunk threshold | `4000` | `chunk_threshold` | — | Word count to trigger chunked translation |\n| Chunk max words | `5000` | `chunk_max_words` | — | Max words per chunk |\n\n## Modes\n\n| Mode | Flag | Steps | When to Use |\n|------|------|-------|-------------|\n| Quick | `--mode quick` | Translate | Short texts, informal content, quick tasks |\n| Normal | `--mode normal` (default) | Analyze → Translate | Articles, blog posts, general content |\n| Refined | `--mode refined` | Analyze → Translate → Review → Polish | Publication-quality, important documents |\n\n**Default mode**: Normal (can be overridden in EXTEND.md `default_mode` setting).\n\n**Style presets** — control the voice and tone of the translation (independent of audience):\n\n| Value | Description | Effect |\n|-------|-------------|--------|\n| `storytelling` | Engaging narrative flow (default) | Draws readers in, smooth transitions, vivid phrasing |\n| `formal` | Professional, structured | Neutral tone, clear organization, no colloquialisms |\n| `technical` | Precise, documentation-style | Concise, terminology-heavy, minimal embellishment |\n| `literal` | Close to original structure | Minimal restructuring, preserves source sentence patterns |\n| `academic` | Scholarly, rigorous | Formal register, complex clauses OK, citation-aware |\n| `business` | Concise, results-focused | Action-oriented, executive-friendly, bullet-point mindset |\n| `humorous` | Preserves and adapts humor | Witty, playful, recreates comedic effect in target language |\n| `conversational` | Casual, spoken-like | Friendly, approachable, as if explaining to a friend |\n| `elegant` | Literary, polished prose | Aesthetically refined, rhythmic, carefully crafted word choices |\n\nCustom style descriptions are also accepted, e.g., `--style \"poetic and lyrical\"`.\n\n**Auto-detection**:\n- \"快翻\", \"quick\", \"直接翻译\" → quick mode\n- \"精翻\", \"refined\", \"publication quality\", \"proofread\" → refined mode\n- Otherwise → default mode (normal)\n\n**Upgrade prompt**: After normal mode completes, display:\n> Translation saved. To further review and polish, reply \"继续润色\" or \"refine\".\n\nIf user responds, continue with review → polish steps (same as refined mode Steps 4-6 in refined-workflow.md) on the existing output.\n\n**Audience presets**:\n\n| Value | Description | Effect |\n|-------|-------------|--------|\n| `general` | General readers (default) | Plain language, more translator's notes for jargon |\n| `technical` | Developers / engineers | Less annotation on common tech terms |\n| `academic` | Researchers / scholars | Formal register, precise terminology |\n| `business` | Business professionals | Business-friendly tone, explain tech concepts |\n\nCustom audience descriptions are also accepted, e.g., `--audience \"AI感兴趣的普通读者\"`.\n\n## Workflow\n\n### Step 1: Load Preferences\n\n1.1 Check EXTEND.md (see Preferences section above)\n\n1.2 Load built-in glossary for the language pair if available:\n- EN→ZH: [references/glossary-en-zh.md](references/glossary-en-zh.md)\n\n1.3 Merge glossaries: EXTEND.md `glossary` (inline) + EXTEND.md `glossary_files` (external files, paths relative to EXTEND.md location) + built-in glossary + `--glossary` file (CLI overrides all)\n\n### Step 2: Materialize Source & Create Output Directory\n\nMaterialize 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.\n\nFull details: [references/workflow-mechanics.md](references/workflow-mechanics.md)\n\n**Output directory contents** (all intermediate and final files go here):\n\n| File | Mode | Description |\n|------|------|-------------|\n| `translation.md` | All | Final translation (always this name) |\n| `01-analysis.md` | Normal, Refined | Content analysis (domain, tone, terminology) |\n| `02-prompt.md` | Normal, Refined | Assembled translation prompt |\n| `03-draft.md` | Refined | Initial draft before review |\n| `04-critique.md` | Refined | Critical review findings (diagnosis only) |\n| `05-revision.md` | Refined | Revised translation based on critique |\n| `chunks/` | Chunked | Source chunks + translated chunks |\n\n### Step 3: Assess Content Length\n\nQuick 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.\n\nFor normal and refined modes:\n\n| Content | Action |\n|---------|--------|\n| < chunk threshold | Translate as single unit |\n| >= chunk threshold | Chunk translation (see Step 3.1) |\n\n**3.1 Long Content Preparation** (normal/refined modes, >= chunk threshold only)\n\nBefore translating chunks:\n\n1. **Extract terminology**: Scan entire document for proper nouns, technical terms, recurring phrases\n2. **Build session glossary**: Merge extracted terms with loaded glossaries, establish consistent translations\n3. **Split into chunks**: Use `${BUN_X} {baseDir}/scripts/main.ts <file> [--max-words <chunk_max_words>] [--output-dir <output-dir>]`\n   - Parses markdown blocks (headings, paragraphs, lists, code blocks, tables, etc.)\n   - Splits at markdown block boundaries to preserve structure\n   - If a single block exceeds the threshold, falls back to line splitting, then word splitting\n4. **Assemble translation prompt**:\n   - Main agent reads `01-analysis.md` (if exists) and assembles shared context using Part 1 of [references/subagent-prompt-template.md](references/subagent-prompt-template.md) — inlining: target style, content background, merged glossary, and translation challenges\n   - Save as `02-prompt.md` in the output directory (shared context only, no task instructions)\n5. **Draft translation via subagents** (if Agent tool available):\n   - Spawn one subagent **per chunk**, all in parallel (Part 2 of the template)\n   - Each subagent reads `02-prompt.md` for shared context, receives chunk position info (chunk N of M + brief context of where it sits in the argument), translates its chunk, saves to `chunks/chunk-NN-draft.md`\n   - Consistency is guaranteed by the shared `02-prompt.md` (glossary, figurative language mapping, comprehension challenges, source voice, and translation challenges from analysis)\n   - If no chunks (content under threshold): spawn one subagent for the entire source file\n   - If Agent tool is unavailable, translate chunks sequentially inline using `02-prompt.md`\n6. **Merge**: Once all subagents complete, combine translated chunks in order. If `chunks/frontmatter.md` exists, prepend it. Save as `03-draft.md` (refined) or `translation.md` (normal)\n7. All intermediate files (source chunks + translated chunks) are preserved in `chunks/`\n\n**After chunked draft is merged**, return control to main agent for critical review, revision, and polish (Step 4).\n\n### Step 4: Translate & Refine\n\n**Translation principles** (apply to all modes):\n\n- **Rewrite, not translate**: Rewrite content into natural, engaging target language as if a skilled native writer composed it from scratch. Quality test: \"Does this read like it was originally written in the target language?\"\n- **Accuracy first**: Facts, data, and logic must match the original exactly\n- **Natural flow**: Use idiomatic target language word order. Break long source sentences into shorter, natural ones. Interpret metaphors and idioms by intended meaning, not word-for-word\n- **Terminology**: Use standard translations consistently. First occurrence of specialized terms: annotate with original in parentheses\n- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)\n- **Proactive interpretation**: For jargon or concepts the target audience may lack context for, add concise explanations in **bold parentheses** `（**解释**）`. Keep annotations few — only where genuinely needed for comprehension\n- **Frontmatter**: If source has YAML frontmatter, rename source-metadata fields with `source` prefix (camelCase: `url`→`sourceUrl`, `title`→`sourceTitle`, etc.), add translated values as new top-level fields (skip `title` if body has H1), keep other fields as-is\n\n#### Quick Mode\n\nTranslate directly → save to `translation.md`. Apply all translation principles above.\n\n#### Normal Mode\n\n1. **Analyze** → `01-analysis.md` (domain, tone, terminology, translation challenges)\n2. **Assemble prompt** → `02-prompt.md` (translation instructions with context, glossary, challenges)\n3. **Translate** (following `02-prompt.md`) → `translation.md`\n\nAfter completion, prompt user: \"Translation saved. To further review and polish, reply **继续润色** or **refine**.\"\n\nIf 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`.\n\n#### Refined Mode\n\nFull workflow for publication quality. See [references/refined-workflow.md](references/refined-workflow.md) for detailed guidelines per step.\n\nThe 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.\n\nSteps and saved files (all in output directory):\n1. **Analyze** → `01-analysis.md` (domain, tone, terminology, translation challenges)\n2. **Assemble prompt** → `02-prompt.md` (translation instructions with inlined context)\n3. **Draft** → `03-draft.md` (initial translation with translator's notes; from subagent if chunked)\n4. **Critical review** → `04-critique.md` (diagnosis only: accuracy, Europeanized language, strategy execution, expression issues)\n5. **Revision** → `05-revision.md` (apply all critique findings to produce revised translation)\n6. **Polish** → `translation.md` (final publication-quality translation)\n\nEach step reads the previous step's file and builds on it.\n\n### Step 5: Output\n\nFinal translation is always at `translation.md` in the output directory.\n\nAfter the final translation is written, do a lightweight image-language pass:\n\n1. Collect image references from the translated article\n2. Identify likely text-heavy images such as covers, screenshots, diagrams, charts, frameworks, and infographics\n3. If any image likely contains a main text language that does not match the translated article language, proactively remind the user\n4. The reminder must be a list only. Do not automatically localize those images unless the user asks\n\nReminder format (use whatever image syntax the article already uses — standard markdown or wikilink):\n```text\nPossible image localization needed:\n- ![example cover](attachments/example-cover.png): likely still contains source-language text while the article is now in target language\n- ![example diagram](attachments/example-diagram.png): likely text-heavy framework graphic, check whether labels need translation\n```\n\nDisplay summary:\n```\n**Translation complete** ({mode} mode)\n\nSource: {source-path}\nLanguages: {from} → {to}\nOutput dir: {output-dir}/\nFinal: {output-dir}/translation.md\nGlossary terms applied: {count}\n```\n\nIf mismatched image-language candidates were found, append a short note after the summary telling the user that some embedded images may still need image-text localization, followed by the candidate list.\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.115.4:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-translate\",\n  \"version\": \"1.115.4\",\n  \"publishedAt\": 1778543400440\n}\n\nFile v1.115.4:references/config/extend-schema.md\n\n# EXTEND.md Schema for baoyu-translate\n\n## Format\n\nEXTEND.md uses YAML format:\n\n```yaml\n# Default target language (ISO code or common name)\ntarget_language: zh-CN\n\n# Default translation mode\ndefault_mode: normal  # quick | normal | refined\n\n# Target audience (affects annotation depth and register)\naudience: general  # general | technical | academic | business | or custom string\n\n# Translation style preference\nstyle: storytelling  # storytelling | formal | technical | literal | academic | business | humorous | conversational | elegant | or custom string\n\n# Word count threshold to trigger chunked translation\nchunk_threshold: 4000\n\n# Max words per chunk\nchunk_max_words: 5000\n\n# Custom glossary (merged with built-in glossary)\n# CLI --glossary flag overrides these\n# Supports inline entries and/or file paths\nglossary:\n  - from: \"Reinforcement Learning\"\n    to: \"强化学习\"\n  - from: \"Transformer\"\n    to: \"Transformer\"\n    note: \"Keep English\"\n\n# Load glossary from external file(s)\n# Supports absolute path or relative to EXTEND.md location\n# File format: markdown table with | from | to | note | columns,\n# or YAML list of {from, to, note} entries\nglossary_files:\n  - ./my-glossary.md\n  - /path/to/shared-glossary.yaml\n\n# Language-pair specific glossaries\nglossaries:\n  en-zh:\n    - from: \"AI Agent\"\n      to: \"AI 智能体\"\n  ja-zh:\n    - from: \"人工知能\"\n      to: \"人工智能\"\n```\n\n## Fields\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| `target_language` | string | `zh-CN` | Default target language code |\n| `default_mode` | string | `normal` | Default translation mode (`quick` / `normal` / `refined`) |\n| `audience` | string | `general` | Target reader profile (`general` / `technical` / `academic` / `business` / custom) |\n| `style` | string | `storytelling` | Translation style (`storytelling` / `formal` / `technical` / `literal` / `academic` / `business` / `humorous` / `conversational` / `elegant` / custom) |\n| `chunk_threshold` | number | `4000` | Word count threshold to trigger chunked translation |\n| `chunk_max_words` | number | `5000` | Max words per chunk |\n| `glossary` | array | `[]` | Universal glossary entries (inline) |\n| `glossary_files` | array | `[]` | External glossary file paths (absolute or relative to EXTEND.md) |\n| `glossaries` | object | `{}` | Language-pair specific glossary entries |\n\n## Glossary Entry\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `from` | yes | Source term |\n| `to` | yes | Target translation |\n| `note` | no | Usage note (e.g., \"Keep English\", \"Only in tech context\") |\n\n## Glossary File Format\n\nExternal glossary files (`glossary_files`) support two formats:\n\n**Markdown table** (`.md`):\n```markdown\n| from | to | note |\n|------|----|------|\n| Reinforcement Learning | 强化学习 | |\n| Transformer | Transformer | Keep English |\n```\n\n**YAML list** (`.yaml` / `.yml`):\n```yaml\n- from: \"Reinforcement Learning\"\n  to: \"强化学习\"\n- from: \"Transformer\"\n  to: \"Transformer\"\n  note: \"Keep English\"\n```\n\nPaths can be absolute or relative to the EXTEND.md file location.\n\n## Priority\n\n1. CLI `--glossary` file entries\n2. EXTEND.md `glossaries[pair]` entries\n3. EXTEND.md `glossary` entries (inline)\n4. EXTEND.md `glossary_files` entries (in listed order, later files override earlier)\n5. Built-in glossary (e.g., `references/glossary-en-zh.md`)\n\nLater entries override earlier ones for the same source term.\n\nFile v1.115.4:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-translate preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY translation. Do NOT:\n- Start translating content\n- Ask about files or output paths\n- Proceed to any workflow steps\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue translation\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Target Language\n\n```yaml\nheader: \"Target Language\"\nquestion: \"Default target language?\"\noptions:\n  - label: \"简体中文 zh-CN (Recommended)\"\n    description: \"Translate to Simplified Chinese\"\n  - label: \"繁體中文 zh-TW\"\n    description: \"Translate to Traditional Chinese\"\n  - label: \"English en\"\n    description: \"Translate to English\"\n  - label: \"日本語 ja\"\n    description: \"Translate to Japanese\"\n```\n\nNote: User may type a custom language code.\n\n### Question 2: Translation Mode\n\n```yaml\nheader: \"Mode\"\nquestion: \"Default translation mode?\"\noptions:\n  - label: \"Normal (Recommended)\"\n    description: \"Analyze content first, then translate\"\n  - label: \"Quick\"\n    description: \"Direct translation, no analysis\"\n  - label: \"Refined\"\n    description: \"Full workflow: analyze → translate → review → polish\"\n```\n\n### Question 3: Target Audience\n\n```yaml\nheader: \"Audience\"\nquestion: \"Default target audience?\"\noptions:\n  - label: \"General readers (Recommended)\"\n    description: \"Plain language, more translator's notes for jargon\"\n  - label: \"Technical\"\n    description: \"Developers/engineers, less annotation on tech terms\"\n  - label: \"Academic\"\n    description: \"Formal register, precise terminology\"\n  - label: \"Business\"\n    description: \"Business-friendly tone, explain tech concepts\"\n```\n\nNote: User may type a custom audience description.\n\n### Question 4: Translation Style\n\n```yaml\nheader: \"Style\"\nquestion: \"Translation style?\"\noptions:\n  - label: \"Storytelling (Recommended)\"\n    description: \"Engaging narrative flow, smooth transitions\"\n  - label: \"Formal\"\n    description: \"Professional, structured, neutral tone\"\n  - label: \"Technical\"\n    description: \"Precise, documentation-style, concise\"\n  - label: \"Literal\"\n    description: \"Close to original structure\"\n  - label: \"Academic\"\n    description: \"Scholarly, rigorous, formal register\"\n  - label: \"Business\"\n    description: \"Concise, results-focused, action-oriented\"\n  - label: \"Humorous\"\n    description: \"Preserves humor, witty, playful\"\n  - label: \"Conversational\"\n    description: \"Casual, friendly, spoken-like\"\n  - label: \"Elegant\"\n    description: \"Literary, polished, aesthetically refined\"\n```\n\nNote: User may type a custom style description.\n\n### Question 5: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"$HOME/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-translate/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md with selected values\n3. Confirm: \"Preferences saved to [path]\"\n4. Mention: \"You can add custom glossary terms to EXTEND.md anytime. See the `glossary` section in the file for the format.\"\n5. Continue with translation using saved preferences\n\n## EXTEND.md Template\n\n```yaml\ntarget_language: [zh-CN/zh-TW/en/ja/...]\ndefault_mode: [quick/normal/refined]\naudience: [general/technical/academic/business/custom]\nstyle: [storytelling/formal/technical/literal/academic/business/humorous/conversational/elegant]\n\n# Custom glossary (optional) — add your own term translations here\n# glossary:\n#   - from: \"Term\"\n#     to: \"翻译\"\n#   - from: \"Another Term\"\n#     to: \"另一个翻译\"\n#     note: \"Usage context\"\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.115.4:references/glossary-en-zh.md\n\n# English → Chinese Glossary\n\nTerms where standard translation is non-obvious or easily mistranslated. Common terms with straightforward translations (e.g., Machine Learning → 机器学习) are omitted — the model already knows these.\n\n| English | Chinese | Notes |\n|---------|---------|-------|\n| AI Agent | AI 智能体 | |\n| Vibe Coding | 凭感觉编程 | |\n| the Bitter Lesson | 苦涩的教训 | Rich Sutton's essay |\n| Context Engineering | 上下文工程 | |\n| AI Wrapper | AI 套壳 | |\n| RLHF | 基于人类反馈的强化学习 | |\n| Hallucination | 幻觉 | AI-specific meaning |\n| Alignment | 对齐 | AI safety context |\n| Guardrails | 护栏 | AI safety context |\n| Agentic | 智能体化的 | |\n| Grounding | 基础化/落地 | Context-dependent |\n| Embedding | 嵌入/向量化 | Context-dependent |\n| Moat | 护城河 | Business context |\n| Flywheel | 飞轮效应 | |\n| Boilerplate | 样板代码 | |\n\nFile v1.115.4:references/refined-workflow.md\n\n# Translation Workflow Details\n\nThis file provides detailed guidelines for each workflow step. Steps are shared across modes:\n\n- **Quick**: Translate only (no steps from this file)\n- **Normal**: Step 1 (Analysis) → Translate\n- **Refined**: Step 1 (Analysis) → Step 2 (Draft) → Step 3 (Review) → Step 4 (Revision) → Step 5 (Polish)\n- **Normal → Upgrade**: After normal mode, user can continue with Step 3 → Step 4 → Step 5\n\nAll intermediate results are saved as files in the output directory.\n\n## Step 1: Content Analysis\n\nBefore translating, analyze the source material. Save analysis to `01-analysis.md` in the output directory.\n\n### 1.1 Content Summary\n\n- What is this content about? What is the core argument?\n- Author background, stance, and writing context\n- Purpose and intended audience of the original\n\n### 1.2 Terminology\n\n- List technical terms, proper nouns, brand names, acronyms\n- Cross-reference with loaded glossaries\n- For terms not in glossary, determine standard translations\n- Record in a terminology table\n\n### 1.3 Tone & Style\n\n- Formal or conversational? Humor, metaphor, cultural references?\n- What register is appropriate for the translation given the target audience?\n\n### 1.4 Translation Challenges\n\nIdentify what may cause difficulty in translation:\n\n- **Comprehension gaps**: Terms or references that target readers may not understand — note what explanation is needed\n- **Figurative language**: Metaphors, idioms, expressions that don't translate literally — note intended meaning and target-language approach (interpret / substitute / retain)\n- **Structural challenges**: Long complex sentences, wordplay, puns, or humor that needs creative adaptation\n\n**Save `01-analysis.md`** with:\n```\n## Content Summary\n[Core argument, author, context, purpose]\n\n## Terminology\n[term → translation, ...]\n\n## Tone & Style\n[assessment]\n\n## Translation Challenges\n- [term/passage] → [challenge type] → [suggested approach]\n- ...\n```\n\n## Step 2: Assemble Translation Prompt\n\nMain agent reads `01-analysis.md` and assembles a complete translation prompt using [references/subagent-prompt-template.md](subagent-prompt-template.md). Inline the following from analysis:\n\n- **Target style**: Resolved style preset + source voice assessment from §1.3\n- **Content background**: Summary from §1.1\n- **Glossary**: Merged glossary with analysis-extracted terms from §1.2\n- **Translation challenges**: All challenges from §1.4\n\nSave to `02-prompt.md`. This prompt is used by the subagent (chunked) or by the main agent itself (non-chunked).\n\n## Step 3: Initial Draft\n\nSave to `03-draft.md` in the output directory.\n\nFor chunked content, the subagent produces this draft (merged from chunk translations). For non-chunked content, the main agent produces it directly.\n\nTranslate the full content following `02-prompt.md`. Apply all **Translation principles** from SKILL.md.\n\n## Step 4: Critical Review\n\nThe main agent critically reviews the draft against the source. Save review findings to `04-critique.md`. This step produces **diagnosis only** — no rewriting yet.\n\n### 4.1 Accuracy\n\n- Compare each paragraph against the original\n- Verify facts, numbers, dates, proper nouns\n- Flag content accidentally added, removed, or altered\n- Check terminology consistency with glossary\n\n### 4.2 Native Voice\n\n- Flag sentences that read as \"translated\" rather than \"written\" — unnatural word order, calques, stiff phrasing\n- For CJK targets: check for unnecessary connectives (因此/然而/此外), passive voice abuse (被/由/受到), noun pile-ups, over-nominalization\n- Flag metaphors translated literally that sound unnatural in the target language\n- Check emotional connotations are preserved, not flattened\n- Note where sentence restructuring would improve readability\n\n### 4.3 Notes & Adaptation\n\n- Are translator's notes accurate, concise, and genuinely helpful?\n- Flag missed comprehension challenges that need notes, and over-annotations on obvious terms\n- Were translation strategies from `02-prompt.md` followed?\n- Do cultural references work in the target language?\n\n**Save `04-critique.md`** with:\n```\n## Accuracy\n- [issue]: [location] — [description]\n\n## Native Voice\n- [issue]: [example] → [suggested fix]\n\n## Notes & Adaptation\n- [add/remove/revise]: [term/passage] — [reason]\n\n## Summary\n[Overall assessment: X critical issues, Y improvements]\n```\n\n## Step 5: Revision\n\nApply all findings from `04-critique.md` to produce a revised translation. Save to `05-revision.md`.\n\nRead `03-draft.md` and `04-critique.md`, fix all accuracy issues, rewrite unnatural expressions, adjust notes, and improve flow.\n\n## Step 6: Polish\n\nSave final version to `translation.md`.\n\nFinal pass on `05-revision.md` for publication quality:\n\n- Read the entire translation as a standalone piece — does it flow as native content?\n- Smooth remaining rough transitions\n- Ensure consistent narrative voice and style throughout\n- Final terminology consistency check\n- Verify formatting is preserved correctly\n\n## Subagent Responsibility\n\nEach subagent (one per chunk) is responsible **only** for producing the initial draft of its chunk (Step 3). The main agent assembles the shared prompt (Step 2), spawns all subagents in parallel, then takes over for critical review (Step 4), revision (Step 5), and polish (Step 6).\n\n## Chunked Refined Translation\n\nWhen content exceeds the chunk threshold and uses refined mode:\n\n1. Main agent runs analysis (Step 1) on the **entire** document first → `01-analysis.md`\n2. Main agent assembles translation prompt → `02-prompt.md`\n3. Split into chunks → `chunks/`\n4. Spawn one subagent per chunk in parallel (each reads `02-prompt.md` for shared context) → merge all results into `03-draft.md`\n5. Main agent critically reviews the merged draft → `04-critique.md`\n6. Main agent revises based on critique → `05-revision.md`\n7. Main agent polishes → `translation.md`\n8. Final cross-chunk consistency check: terminology, narrative flow, transitions at chunk boundaries\n\nFile v1.115.4:references/subagent-prompt-template.md\n\n# Subagent Translation Prompt Template\n\nTwo parts:\n1. **`02-prompt.md`** — Shared context (saved to output directory). Contains background, glossary, challenges, and principles. No task-specific instructions.\n2. **Subagent spawn prompt** — Task instructions passed when spawning each subagent. One subagent per chunk (or per source file if non-chunked).\n\nThe main agent reads `01-analysis.md` (if exists), inlines all relevant context into `02-prompt.md`, then spawns subagents in parallel with task instructions referencing that file.\n\nReplace `{placeholders}` with actual values. Omit sections marked \"if analysis exists\" for quick mode.\n\n---\n\n## Part 1: `02-prompt.md` (shared context, saved as file)\n\n```markdown\nYou are a professional translator. Your task is to translate markdown content from {source_lang} to {target_lang}.\n\n## Target Audience & Style\n\n**Audience**: {audience description}\n\n**Target style**: {style description — e.g., \"storytelling: engaging narrative flow, smooth transitions, vivid phrasing\" or custom style from user}\n\n**Source voice** (from analysis, if exists): {Brief description of the original author's voice — formal/conversational, humor, register, sentence rhythm.}\n\n## Content Background\n\n{Inlined from 01-analysis.md if analysis exists: content summary, core argument, author background, context.}\n\n## Glossary\n\nApply these term translations consistently. First occurrence: include original in parentheses.\n\n{Merged glossary — one per line: English → Translation}\n\n## Translation Challenges\n\n{Inlined from 01-analysis.md §1.4 if analysis exists. Comprehension gaps, figurative language, structural challenges with suggested approaches:}\n\n- **{term/passage}**: {challenge type} → {suggested approach}\n\n## Translation Principles\n\nRewrite the content into natural, engaging {target_lang} — not merely translate it. Every sentence should read as if a skilled native writer composed it from scratch.\n\n- **Accuracy first**: Facts, data, and logic must match the original exactly\n- **Natural flow**: Use idiomatic {target_lang} word order. Break long source sentences into shorter, natural ones. Interpret metaphors and idioms by intended meaning, not word-for-word\n- **Terminology**: Use glossary translations consistently. Annotate with original in parentheses on first occurrence of specialized terms\n- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)\n- **Proactive interpretation**: For jargon or concepts the target audience may lack context for, add concise explanations in **bold parentheses** `（**解释**）`. Keep annotations few — only where genuinely needed\n```\n\n---\n\n## Part 2: Subagent spawn prompt (passed as Agent tool prompt)\n\n### Chunked mode (one subagent per chunk, all spawned in parallel)\n\n```\nRead the translation instructions from: {output_dir}/02-prompt.md\n\nYou are translating chunk {NN} of {total_chunks}.\nContext: {brief description of what this chunk covers and where it sits in the overall argument}\n\nTranslate this chunk:\n1. Read `{output_dir}/chunks/chunk-{NN}.md`\n2. Translate following the instructions in 02-prompt.md\n3. Save translation to `{output_dir}/chunks/chunk-{NN}-draft.md`\n```\n\n### Non-chunked mode\n\n```\nRead the translation instructions from: {output_dir}/02-prompt.md\n\nTranslate the source file and save the result:\n1. Read `{source_file_path}`\n2. Save translation to `{output_path}`\n```\n\nFile v1.115.4:references/workflow-mechanics.md\n\n# Workflow Mechanics\n\nDetails for source materialization, output directory creation, and conflict resolution.\n\n## Materialize Source\n\n| Input Type | Action |\n|------------|--------|\n| File | Use as-is (no copy needed) |\n| Inline text | Save to `translate/{slug}.md` |\n| URL | Fetch content, save to `translate/{slug}.md` |\n\n`{slug}`: 2-4 word kebab-case slug derived from content topic.\n\n## Create Output Directory\n\nCreate a subdirectory next to the source file: `{source-dir}/{source-basename}-{target-lang}/`\n\nExamples:\n- `posts/article.md` → `posts/article-zh/`\n- `translate/ai-future.md` → `translate/ai-future-zh/`\n\n## Conflict Resolution\n\nIf the output directory already exists, rename the existing one to `{name}.backup-YYYYMMDD-HHMMSS/` before creating the new one. Never overwrite existing results.\n\nFile v1.115.4:scripts/package.json\n\n{\n  \"name\": \"baoyu-translate-chunk\",\n  \"private\": true,\n  \"dependencies\": {\n    \"markdown-it\": \"14.1.1\"\n  }\n}\n\nArchive v1.103.2: 12 files, 21049 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (6040b), references/subagent-prompt-template.md (3442b), references/workflow-mechanics.md (812b), scripts/bun.lock (1456b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), SKILL.md (16018b), _meta.json (136b)\n\nFile v1.103.2:SKILL.md\n\n---\nname: baoyu-translate\ndescription: 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.\nversion: 1.59.0\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-translate\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Translator\n\nThree-mode translation skill: **quick** for direct translation, **normal** for analysis-informed translation, **refined** for full publication-quality workflow with review and polish.\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts in `scripts/` subdirectory. `{baseDir}` = 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 `{baseDir}` and `${BUN_X}` with actual values.\n\n| Script | Purpose |\n|--------|---------|\n| `scripts/main.ts` | CLI entry point. Default action splits markdown into chunks; also supports explicit `chunk` subcommand |\n| `scripts/chunk.ts` | Markdown chunking implementation used by `main.ts` and kept compatible for direct invocation |\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-translate/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-translate/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply. On first use in session, briefly remind: \"Using preferences from [path]. You can edit EXTEND.md to customize glossary, audience, etc.\" |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently use defaults |\n\n**EXTEND.md supports**: default target language, default mode, target audience, custom glossaries (inline or file path), translation style, chunk settings.\n\nSchema: [references/config/extend-schema.md](references/config/extend-schema.md).\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST** run the first-time setup before ANY translation. This is a **BLOCKING** operation.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\nUse `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.\n\n## Defaults\n\nAll configurable values in one place. EXTEND.md overrides these; CLI flags override EXTEND.md.\n\n| Setting | Default | EXTEND.md key | CLI flag | Description |\n|---------|---------|---------------|----------|-------------|\n| Target language | `zh-CN` | `target_language` | `--to` | Translation target language |\n| Mode | `normal` | `default_mode` | `--mode` | Translation mode |\n| Audience | `general` | `audience` | `--audience` | Target reader profile |\n| Style | `storytelling` | `style` | `--style` | Translation style preference |\n| Chunk threshold | `4000` | `chunk_threshold` | — | Word count to trigger chunked translation |\n| Chunk max words | `5000` | `chunk_max_words` | — | Max words per chunk |\n\n## Modes\n\n| Mode | Flag | Steps | When to Use |\n|------|------|-------|-------------|\n| Quick | `--mode quick` | Translate | Short texts, informal content, quick tasks |\n| Normal | `--mode normal` (default) | Analyze → Translate | Articles, blog posts, general content |\n| Refined | `--mode refined` | Analyze → Translate → Review → Polish | Publication-quality, important documents |\n\n**Default mode**: Normal (can be overridden in EXTEND.md `default_mode` setting).\n\n**Style presets** — control the voice and tone of the translation (independent of audience):\n\n| Value | Description | Effect |\n|-------|-------------|--------|\n| `storytelling` | Engaging narrative flow (default) | Draws readers in, smooth transitions, vivid phrasing |\n| `formal` | Professional, structured | Neutral tone, clear organization, no colloquialisms |\n| `technical` | Precise, documentation-style | Concise, terminology-heavy, minimal embellishment |\n| `literal` | Close to original structure | Minimal restructuring, preserves source sentence patterns |\n| `academic` | Scholarly, rigorous | Formal register, complex clauses OK, citation-aware |\n| `business` | Concise, results-focused | Action-oriented, executive-friendly, bullet-point mindset |\n| `humorous` | Preserves and adapts humor | Witty, playful, recreates comedic effect in target language |\n| `conversational` | Casual, spoken-like | Friendly, approachable, as if explaining to a friend |\n| `elegant` | Literary, polished prose | Aesthetically refined, rhythmic, carefully crafted word choices |\n\nCustom style descriptions are also accepted, e.g., `--style \"poetic and lyrical\"`.\n\n**Auto-detection**:\n- \"快翻\", \"quick\", \"直接翻译\" → quick mode\n- \"精翻\", \"refined\", \"publication quality\", \"proofread\" → refined mode\n- Otherwise → default mode (normal)\n\n**Upgrade prompt**: After normal mode completes, display:\n> Translation saved. To further review and polish, reply \"继续润色\" or \"refine\".\n\nIf user responds, continue with review → polish steps (same as refined mode Steps 4-6 in refined-workflow.md) on the existing output.\n\n**Audience presets**:\n\n| Value | Description | Effect |\n|-------|-------------|--------|\n| `general` | General readers (default) | Plain language, more translator's notes for jargon |\n| `technical` | Developers / engineers | Less annotation on common tech terms |\n| `academic` | Researchers / scholars | Formal register, precise terminology |\n| `business` | Business professionals | Business-friendly tone, explain tech concepts |\n\nCustom audience descriptions are also accepted, e.g., `--audience \"AI感兴趣的普通读者\"`.\n\n## Workflow\n\n### Step 1: Load Preferences\n\n1.1 Check EXTEND.md (see Preferences section above)\n\n1.2 Load built-in glossary for the language pair if available:\n- EN→ZH: [references/glossary-en-zh.md](references/glossary-en-zh.md)\n\n1.3 Merge glossaries: EXTEND.md `glossary` (inline) + EXTEND.md `glossary_files` (external files, paths relative to EXTEND.md location) + built-in glossary + `--glossary` file (CLI overrides all)\n\n### Step 2: Materialize Source & Create Output Directory\n\nMaterialize 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.\n\nFull details: [references/workflow-mechanics.md](references/workflow-mechanics.md)\n\n**Output directory contents** (all intermediate and final files go here):\n\n| File | Mode | Description |\n|------|------|-------------|\n| `translation.md` | All | Final translation (always this name) |\n| `01-analysis.md` | Normal, Refined | Content analysis (domain, tone, terminology) |\n| `02-prompt.md` | Normal, Refined | Assembled translation prompt |\n| `03-draft.md` | Refined | Initial draft before review |\n| `04-critique.md` | Refined | Critical review findings (diagnosis only) |\n| `05-revision.md` | Refined | Revised translation based on critique |\n| `chunks/` | Chunked | Source chunks + translated chunks |\n\n### Step 3: Assess Content Length\n\nQuick 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.\n\nFor normal and refined modes:\n\n| Content | Action |\n|---------|--------|\n| < chunk threshold | Translate as single unit |\n| >= chunk threshold | Chunk translation (see Step 3.1) |\n\n**3.1 Long Content Preparation** (normal/refined modes, >= chunk threshold only)\n\nBefore translating chunks:\n\n1. **Extract terminology**: Scan entire document for proper nouns, technical terms, recurring phrases\n2. **Build session glossary**: Merge extracted terms with loaded glossaries, establish consistent translations\n3. **Split into chunks**: Use `${BUN_X} {baseDir}/scripts/main.ts <file> [--max-words <chunk_max_words>] [--output-dir <output-dir>]`\n   - Parses markdown blocks (headings, paragraphs, lists, code blocks, tables, etc.)\n   - Splits at markdown block boundaries to preserve structure\n   - If a single block exceeds the threshold, falls back to line splitting, then word splitting\n4. **Assemble translation prompt**:\n   - Main agent reads `01-analysis.md` (if exists) and assembles shared context using Part 1 of [references/subagent-prompt-template.md](references/subagent-prompt-template.md) — inlining: target style, content background, merged glossary, and translation challenges\n   - Save as `02-prompt.md` in the output directory (shared context only, no task instructions)\n5. **Draft translation via subagents** (if Agent tool available):\n   - Spawn one subagent **per chunk**, all in parallel (Part 2 of the template)\n   - Each subagent reads `02-prompt.md` for shared context, receives chunk position info (chunk N of M + brief context of where it sits in the argument), translates its chunk, saves to `chunks/chunk-NN-draft.md`\n   - Consistency is guaranteed by the shared `02-prompt.md` (glossary, figurative language mapping, comprehension challenges, source voice, and translation challenges from analysis)\n   - If no chunks (content under threshold): spawn one subagent for the entire source file\n   - If Agent tool is unavailable, translate chunks sequentially inline using `02-prompt.md`\n6. **Merge**: Once all subagents complete, combine translated chunks in order. If `chunks/frontmatter.md` exists, prepend it. Save as `03-draft.md` (refined) or `translation.md` (normal)\n7. All intermediate files (source chunks + translated chunks) are preserved in `chunks/`\n\n**After chunked draft is merged**, return control to main agent for critical review, revision, and polish (Step 4).\n\n### Step 4: Translate & Refine\n\n**Translation principles** (apply to all modes):\n\n- **Rewrite, not translate**: Rewrite content into natural, engaging target language as if a skilled native writer composed it from scratch. Quality test: \"Does this read like it was originally written in the target language?\"\n- **Accuracy first**: Facts, data, and logic must match the original exactly\n- **Natural flow**: Use idiomatic target language word order. Break long source sentences into shorter, natural ones. Interpret metaphors and idioms by intended meaning, not word-for-word\n- **Terminology**: Use standard translations consistently. First occurrence of specialized terms: annotate with original in parentheses\n- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)\n- **Proactive interpretation**: For jargon or concepts the target audience may lack context for, add concise explanations in **bold parentheses** `（**解释**）`. Keep annotations few — only where genuinely needed for comprehension\n- **Frontmatter**: If source has YAML frontmatter, rename source-metadata fields with `source` prefix (camelCase: `url`→`sourceUrl`, `title`→`sourceTitle`, etc.), add translated values as new top-level fields (skip `title` if body has H1), keep other fields as-is\n\n#### Quick Mode\n\nTranslate directly → save to `translation.md`. Apply all translation principles above.\n\n#### Normal Mode\n\n1. **Analyze** → `01-analysis.md` (domain, tone, terminology, translation challenges)\n2. **Assemble prompt** → `02-prompt.md` (translation instructions with context, glossary, challenges)\n3. **Translate** (following `02-prompt.md`) → `translation.md`\n\nAfter completion, prompt user: \"Translation saved. To further review and polish, reply **继续润色** or **refine**.\"\n\nIf 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`.\n\n#### Refined Mode\n\nFull workflow for publication quality. See [references/refined-workflow.md](references/refined-workflow.md) for detailed guidelines per step.\n\nThe 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.\n\nSteps and saved files (all in output directory):\n1. **Analyze** → `01-analysis.md` (domain, tone, terminology, translation challenges)\n2. **Assemble prompt** → `02-prompt.md` (translation instructions with inlined context)\n3. **Draft** → `03-draft.md` (initial translation with translator's notes; from subagent if chunked)\n4. **Critical review** → `04-critique.md` (diagnosis only: accuracy, Europeanized language, strategy execution, expression issues)\n5. **Revision** → `05-revision.md` (apply all critique findings to produce revised translation)\n6. **Polish** → `translation.md` (final publication-quality translation)\n\nEach step reads the previous step's file and builds on it.\n\n### Step 5: Output\n\nFinal translation is always at `translation.md` in the output directory.\n\nAfter the final translation is written, do a lightweight image-language pass:\n\n1. Collect image references from the translated article\n2. Identify likely text-heavy images such as covers, screenshots, diagrams, charts, frameworks, and infographics\n3. If any image likely contains a main text language that does not match the translated article language, proactively remind the user\n4. The reminder must be a list only. Do not automatically localize those images unless the user asks\n\nReminder format (use whatever image syntax the article already uses — standard markdown or wikilink):\n```text\nPossible image localization needed:\n- ![example cover](attachments/example-cover.png): likely still contains source-language text while the article is now in target language\n- ![example diagram](attachments/example-diagram.png): likely text-heavy framework graphic, check whether labels need translation\n```\n\nDisplay summary:\n```\n**Translation complete** ({mode} mode)\n\nSource: {source-path}\nLanguages: {from} → {to}\nOutput dir: {output-dir}/\nFinal: {output-dir}/translation.md\nGlossary terms applied: {count}\n```\n\nIf mismatched image-language candidates were found, append a short note after the summary telling the user that some embedded images may still need image-text localization, followed by the candidate list.\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.103.2:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-translate\",\n  \"version\": \"1.103.2\",\n  \"publishedAt\": 1776809043692\n}\n\nFile v1.103.2:references/config/extend-schema.md\n\n# EXTEND.md Schema for baoyu-translate\n\n## Format\n\nEXTEND.md uses YAML format:\n\n```yaml\n# Default target language (ISO code or common name)\ntarget_language: zh-CN\n\n# Default translation mode\ndefault_mode: normal  # quick | normal | refined\n\n# Target audience (affects annotation depth and register)\naudience: general  # general | technical | academic | business | or custom string\n\n# Translation style preference\nstyle: storytelling  # storytelling | formal | technical | literal | academic | business | humorous | conversational | elegant | or custom string\n\n# Word count threshold to trigger chunked translation\nchunk_threshold: 4000\n\n# Max words per chunk\nchunk_max_words: 5000\n\n# Custom glossary (merged with built-in glossary)\n# CLI --glossary flag overrides these\n# Supports inline entries and/or file paths\nglossary:\n  - from: \"Reinforcement Learning\"\n    to: \"强化学习\"\n  - from: \"Transformer\"\n    to: \"Transformer\"\n    note: \"Keep English\"\n\n# Load glossary from external file(s)\n# Supports absolute path or relative to EXTEND.md location\n# File format: markdown table with | from | to | note | columns,\n# or YAML list of {from, to, note} entries\nglossary_files:\n  - ./my-glossary.md\n  - /path/to/shared-glossary.yaml\n\n# Language-pair specific glossaries\nglossaries:\n  en-zh:\n    - from: \"AI Agent\"\n      to: \"AI 智能体\"\n  ja-zh:\n    - from: \"人工知能\"\n      to: \"人工智能\"\n```\n\n## Fields\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| `target_language` | string | `zh-CN` | Default target language code |\n| `default_mode` | string | `normal` | Default translation mode (`quick` / `normal` / `refined`) |\n| `audience` | string | `general` | Target reader profile (`general` / `technical` / `academic` / `business` / custom) |\n| `style` | string | `storytelling` | Translation style (`storytelling` / `formal` / `technical` / `literal` / `academic` / `business` / `humorous` / `conversational` / `elegant` / custom) |\n| `chunk_threshold` | number | `4000` | Word count threshold to trigger chunked translation |\n| `chunk_max_words` | number | `5000` | Max words per chunk |\n| `glossary` | array | `[]` | Universal glossary entries (inline) |\n| `glossary_files` | array | `[]` | External glossary file paths (absolute or relative to EXTEND.md) |\n| `glossaries` | object | `{}` | Language-pair specific glossary entries |\n\n## Glossary Entry\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `from` | yes | Source term |\n| `to` | yes | Target translation |\n| `note` | no | Usage note (e.g., \"Keep English\", \"Only in tech context\") |\n\n## Glossary File Format\n\nExternal glossary files (`glossary_files`) support two formats:\n\n**Markdown table** (`.md`):\n```markdown\n| from | to | note |\n|------|----|------|\n| Reinforcement Learning | 强化学习 | |\n| Transformer | Transformer | Keep English |\n```\n\n**YAML list** (`.yaml` / `.yml`):\n```yaml\n- from: \"Reinforcement Learning\"\n  to: \"强化学习\"\n- from: \"Transformer\"\n  to: \"Transformer\"\n  note: \"Keep English\"\n```\n\nPaths can be absolute or relative to the EXTEND.md file location.\n\n## Priority\n\n1. CLI `--glossary` file entries\n2. EXTEND.md `glossaries[pair]` entries\n3. EXTEND.md `glossary` entries (inline)\n4. EXTEND.md `glossary_files` entries (in listed order, later files override earlier)\n5. Built-in glossary (e.g., `references/glossary-en-zh.md`)\n\nLater entries override earlier ones for the same source term.\n\nFile v1.103.2:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-translate preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY translation. Do NOT:\n- Start translating content\n- Ask about files or output paths\n- Proceed to any workflow steps\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue translation\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Target Language\n\n```yaml\nheader: \"Target Language\"\nquestion: \"Default target language?\"\noptions:\n  - label: \"简体中文 zh-CN (Recommended)\"\n    description: \"Translate to Simplified Chinese\"\n  - label: \"繁體中文 zh-TW\"\n    description: \"Translate to Traditional Chinese\"\n  - label: \"English en\"\n    description: \"Translate to English\"\n  - label: \"日本語 ja\"\n    description: \"Translate to Japanese\"\n```\n\nNote: User may type a custom language code.\n\n### Question 2: Translation Mode\n\n```yaml\nheader: \"Mode\"\nquestion: \"Default translation mode?\"\noptions:\n  - label: \"Normal (Recommended)\"\n    description: \"Analyze content first, then translate\"\n  - label: \"Quick\"\n    description: \"Direct translation, no analysis\"\n  - label: \"Refined\"\n    description: \"Full workflow: analyze → translate → review → polish\"\n```\n\n### Question 3: Target Audience\n\n```yaml\nheader: \"Audience\"\nquestion: \"Default target audience?\"\noptions:\n  - label: \"General readers (Recommended)\"\n    description: \"Plain language, more translator's notes for jargon\"\n  - label: \"Technical\"\n    description: \"Developers/engineers, less annotation on tech terms\"\n  - label: \"Academic\"\n    description: \"Formal register, precise terminology\"\n  - label: \"Business\"\n    description: \"Business-friendly tone, explain tech concepts\"\n```\n\nNote: User may type a custom audience description.\n\n### Question 4: Translation Style\n\n```yaml\nheader: \"Style\"\nquestion: \"Translation style?\"\noptions:\n  - label: \"Storytelling (Recommended)\"\n    description: \"Engaging narrative flow, smooth transitions\"\n  - label: \"Formal\"\n    description: \"Professional, structured, neutral tone\"\n  - label: \"Technical\"\n    description: \"Precise, documentation-style, concise\"\n  - label: \"Literal\"\n    description: \"Close to original structure\"\n  - label: \"Academic\"\n    description: \"Scholarly, rigorous, formal register\"\n  - label: \"Business\"\n    description: \"Concise, results-focused, action-oriented\"\n  - label: \"Humorous\"\n    description: \"Preserves humor, witty, playful\"\n  - label: \"Conversational\"\n    description: \"Casual, friendly, spoken-like\"\n  - label: \"Elegant\"\n    description: \"Literary, polished, aesthetically refined\"\n```\n\nNote: User may type a custom style description.\n\n### Question 5: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"$HOME/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-translate/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md with selected values\n3. Confirm: \"Preferences saved to [path]\"\n4. Mention: \"You can add custom glossary terms to EXTEND.md anytime. See the `glossary` section in the file for the format.\"\n5. Continue with translation using saved preferences\n\n## EXTEND.md Template\n\n```yaml\ntarget_language: [zh-CN/zh-TW/en/ja/...]\ndefault_mode: [quick/normal/refined]\naudience: [general/technical/academic/business/custom]\nstyle: [storytelling/formal/technical/literal/academic/business/humorous/conversational/elegant]\n\n# Custom glossary (optional) — add your own term translations here\n# glossary:\n#   - from: \"Term\"\n#     to: \"翻译\"\n#   - from: \"Another Term\"\n#     to: \"另一个翻译\"\n#     note: \"Usage context\"\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.103.2:references/glossary-en-zh.md\n\n# English → Chinese Glossary\n\nTerms where standard translation is non-obvious or easily mistranslated. Common terms with straightforward translations (e.g., Machine Learning → 机器学习) are omitted — the model already knows these.\n\n| English | Chinese | Notes |\n|---------|---------|-------|\n| AI Agent | AI 智能体 | |\n| Vibe Coding | 凭感觉编程 | |\n| the Bitter Lesson | 苦涩的教训 | Rich Sutton's essay |\n| Context Engineering | 上下文工程 | |\n| AI Wrapper | AI 套壳 | |\n| RLHF | 基于人类反馈的强化学习 | |\n| Hallucination | 幻觉 | AI-specific meaning |\n| Alignment | 对齐 | AI safety context |\n| Guardrails | 护栏 | AI safety context |\n| Agentic | 智能体化的 | |\n| Grounding | 基础化/落地 | Context-dependent |\n| Embedding | 嵌入/向量化 | Context-dependent |\n| Moat | 护城河 | Business context |\n| Flywheel | 飞轮效应 | |\n| Boilerplate | 样板代码 | |\n\nFile v1.103.2:references/refined-workflow.md\n\n# Translation Workflow Details\n\nThis file provides detailed guidelines for each workflow step. Steps are shared across modes:\n\n- **Quick**: Translate only (no steps from this file)\n- **Normal**: Step 1 (Analysis) → Translate\n- **Refined**: Step 1 (Analysis) → Step 2 (Draft) → Step 3 (Review) → Step 4 (Revision) → Step 5 (Polish)\n- **Normal → Upgrade**: After normal mode, user can continue with Step 3 → Step 4 → Step 5\n\nAll intermediate results are saved as files in the output directory.\n\n## Step 1: Content Analysis\n\nBefore translating, analyze the source material. Save analysis to `01-analysis.md` in the output directory.\n\n### 1.1 Content Summary\n\n- What is this content about? What is the core argument?\n- Author background, stance, and writing context\n- Purpose and intended audience of the original\n\n### 1.2 Terminology\n\n- List technical terms, proper nouns, brand names, acronyms\n- Cross-reference with loaded glossaries\n- For terms not in glossary, determine standard translations\n- Record in a terminology table\n\n### 1.3 Tone & Style\n\n- Formal or conversational? Humor, metaphor, cultural references?\n- What register is appropriate for the translation given the target audience?\n\n### 1.4 Translation Challenges\n\nIdentify what may cause difficulty in translation:\n\n- **Comprehension gaps**: Terms or references that target readers may not understand — note what explanation is needed\n- **Figurative language**: Metaphors, idioms, expressions that don't translate literally — note intended meaning and target-language approach (interpret / substitute / retain)\n- **Structural challenges**: Long complex sentences, wordplay, puns, or humor that needs creative adaptation\n\n**Save `01-analysis.md`** with:\n```\n## Content Summary\n[Core argument, author, context, purpose]\n\n## Terminology\n[term → translation, ...]\n\n## Tone & Style\n[assessment]\n\n## Translation Challenges\n- [term/passage] → [challenge type] → [suggested approach]\n- ...\n```\n\n## Step 2: Assemble Translation Prompt\n\nMain agent reads `01-analysis.md` and assembles a complete translation prompt using [references/subagent-prompt-template.md](subagent-prompt-template.md). Inline the following from analysis:\n\n- **Target style**: Resolved style preset + source voice assessment from §1.3\n- **Content background**: Summary from §1.1\n- **Glossary**: Merged glossary with analysis-extracted terms from §1.2\n- **Translation challenges**: All challenges from §1.4\n\nSave to `02-prompt.md`. This prompt is used by the subagent (chunked) or by the main agent itself (non-chunked).\n\n## Step 3: Initial Draft\n\nSave to `03-draft.md` in the output directory.\n\nFor chunked content, the subagent produces this draft (merged from chunk translations). For non-chunked content, the main agent produces it directly.\n\nTranslate the full content following `02-prompt.md`. Apply all **Translation principles** from SKILL.md.\n\n## Step 4: Critical Review\n\nThe main agent critically reviews the draft against the source. Save review findings to `04-critique.md`. This step produces **diagnosis only** — no rewriting yet.\n\n### 4.1 Accuracy\n\n- Compare each paragraph against the original\n- Verify facts, numbers, dates, proper nouns\n- Flag content accidentally added, removed, or altered\n- Check terminology consistency with glossary\n\n### 4.2 Native Voice\n\n- Flag sentences that read as \"translated\" rather than \"written\" — unnatural word order, calques, stiff phrasing\n- For CJK targets: check for unnecessary connectives (因此/然而/此外), passive voice abuse (被/由/受到), noun pile-ups, over-nominalization\n- Flag metaphors translated literally that sound unnatural in the target language\n- Check emotional connotations are preserved, not flattened\n- Note where sentence restructuring would improve readability\n\n### 4.3 Notes & Adaptation\n\n- Are translator's notes accurate, concise, and genuinely helpful?\n- Flag missed comprehension challenges that need notes, and over-annotations on obvious terms\n- Were translation strategies from `02-prompt.md` followed?\n- Do cultural references work in the target language?\n\n**Save `04-critique.md`** with:\n```\n## Accuracy\n- [issue]: [location] — [description]\n\n## Native Voice\n- [issue]: [example] → [suggested fix]\n\n## Notes & Adaptation\n- [add/remove/revise]: [term/passage] — [reason]\n\n## Summary\n[Overall assessment: X critical issues, Y improvements]\n```\n\n## Step 5: Revision\n\nApply all findings from `04-critique.md` to produce a revised translation. Save to `05-revision.md`.\n\nRead `03-draft.md` and `04-critique.md`, fix all accuracy issues, rewrite unnatural expressions, adjust notes, and improve flow.\n\n## Step 6: Polish\n\nSave final version to `translation.md`.\n\nFinal pass on `05-revision.md` for publication quality:\n\n- Read the entire translation as a standalone piece — does it flow as native content?\n- Smooth remaining rough transitions\n- Ensure consistent narrative voice and style throughout\n- Final terminology consistency check\n- Verify formatting is preserved correctly\n\n## Subagent Responsibility\n\nEach subagent (one per chunk) is responsible *\n\nArchive v1.103.1: 12 files, 21065 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (6040b), references/subagent-prompt-template.md (3442b), references/workflow-mechanics.md (812b), scripts/bun.lock (1456b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), SKILL.md (16341b), _meta.json (136b)\n\nArchive v1.103.0: 12 files, 21066 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (6040b), references/subagent-prompt-template.md (3442b), references/workflow-mechanics.md (812b), scripts/bun.lock (1456b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), SKILL.md (16341b), _meta.json (136b)\n\nArchive v1.76.4: 11 files, 20098 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (6040b), references/subagent-prompt-template.md (3442b), references/workflow-mechanics.md (812b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), SKILL.md (16341b), _meta.json (135b)\n\nArchive v1.76.3: 11 files, 25082 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (14065b), references/subagent-prompt-template.md (6613b), references/workflow-mechanics.md (812b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), SKILL.md (18752b), _meta.json (135b)\n\nArchive v1.76.2: 11 files, 23857 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (13311b), references/subagent-prompt-template.md (4385b), references/workflow-mechanics.md (812b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), SKILL.md (18551b), _meta.json (135b)\n\nArchive v1.76.1: 12 files, 24825 bytes\n\nFiles: references/config/extend-schema.md (3449b), references/config/first-time-setup.md (4505b), references/glossary-en-zh.md (927b), references/refined-workflow.md (13311b), references/subagent-prompt-template.md (4385b), references/workflow-mechanics.md (812b), scripts/bun.lock (1456b), scripts/chunk.ts (8368b), scripts/main.ts (1410b), scripts/package.json (110b), SKILL.md (18551b), _meta.json (135b)","readmeExcerpt":"Skill: Baoyu Translate Owner: jimliu Summary: This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\", \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\",... Tags: latest:1.117.3 Version history: v1.117.3 | 2026-06-13T05:01:28.863Z | auto - Updated description in SKILL.md for improved clarity and brevity. - Removed the file skill-card.md. - No changes to functional cod","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"Possible image localization needed:\n- ![example cover](attachments/example-cover.png): likely still contains source-language text while the article is now in target language\n- ![example diagram](attachments/example-diagram.png): likely text-heavy framework graphic, check whether labels need translation"},{"language":"text","snippet":"**Translation complete** ({mode} mode)\n\nSource: {source-path}\nLanguages: {from} → {to}\nOutput dir: {output-dir}/\nFinal: {output-dir}/translation.md\nGlossary terms applied: {count}"},{"language":"yaml","snippet":"# Default target language (ISO code or common name)\ntarget_language: zh-CN\n\n# Default translation mode\ndefault_mode: normal  # quick | normal | refined\n\n# Target audience (affects annotation depth and register)\naudience: general  # general | technical | academic | business | or custom string\n\n# Translation style preference\nstyle: storytelling  # storytelling | formal | technical | literal | academic | business | humorous | conversational | elegant | or custom string\n\n# Word count threshold to trigger chunked translation\nchunk_threshold: 4000\n\n# Max words per chunk\nchunk_max_words: 5000\n\n# Custom glossary (merged with built-in glossary)\n# CLI --glossary flag overrides these\n# Supports inline entries and/or file paths\nglossary:\n  - from: \"Reinforcement Learning\"\n    to: \"强化学习\"\n  - from: \"Transformer\"\n    to: \"Transformer\"\n    note: \"Keep English\"\n\n# Load glossary from external file(s)\n# Supports absolute path or relative to EXTEND.md location\n# File format: markdown table with | from | to | note | columns,\n# or YAML list of {from, to, note} entries\nglossary_files:\n  - ./my-glossary.md\n  - /path/to/shared-glossary.yaml\n\n# Language-pair specific glossaries\nglossaries:\n  en-zh:\n    - from: \"AI Agent\"\n      to: \"AI 智能体\"\n  ja-zh:\n    - from: \"人工知能\"\n      to: \"人工智能\""},{"language":"markdown","snippet":"| from | to | note |\n|------|----|------|\n| Reinforcement Learning | 强化学习 | |\n| Transformer | Transformer | Keep English |"},{"language":"yaml","snippet":"- from: \"Reinforcement Learning\"\n  to: \"强化学习\"\n- from: \"Transformer\"\n  to: \"Transformer\"\n  note: \"Keep English\""},{"language":"text","snippet":"No EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue translation"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: baoyu-translate\ndescription: >-\n  This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\",\n  \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\", \"convert to Chinese\",\n  \"localize\", \"本地化\", \"refined translation\", \"精细翻译\", \"proofread translation\", \"快速翻译\", \"快翻\",\n  \"这篇文章翻译一下\", or provides a URL/file with translation intent. Supports three modes\n  (quick/normal/refined) with custom glossary support.\nversion: 1.117.3\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-translate\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Translator\n\nThree-mode translation skill: **quick** for direct translation, **normal** for analysis-informed translation, **refined** for full publication-quality workflow with review and polish.\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts in `scripts/` subdirectory. `{baseDir}` = 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 `{baseDir}` and `${BUN_X}` with actual values.\n\n| Script | Purpose |\n|--------|---------|\n| `scripts/main.ts` | CLI entry point. Default action splits markdown into chunks; also supports explicit `chunk` subcommand |\n| `scripts/chunk.ts` | Markdown chunking implementation used by `main.ts` and kept compatible for direct invocation |\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-translate/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-translate/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-translate/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply. On first use in session, briefly remind: \"Using preferences from [path]. You can edit EXTEND.md to customize glossary, audience, etc.\" |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently use defaults |\n\n**EXTEND.md supports**: default target language, default mode, target audience, custom glossaries (inline or file path), translation style, chunk settings.\n\nSchema: [references/config/extend-schema.md](references/config/ext"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-translate\",\n  \"version\": \"1.117.3\",\n  \"publishedAt\": 1781326888863\n}"},{"path":"references/config/extend-schema.md","content":"# EXTEND.md Schema for baoyu-translate\n\n## Format\n\nEXTEND.md uses YAML format:\n\n```yaml\n# Default target language (ISO code or common name)\ntarget_language: zh-CN\n\n# Default translation mode\ndefault_mode: normal  # quick | normal | refined\n\n# Target audience (affects annotation depth and register)\naudience: general  # general | technical | academic | business | or custom string\n\n# Translation style preference\nstyle: storytelling  # storytelling | formal | technical | literal | academic | business | humorous | conversational | elegant | or custom string\n\n# Word count threshold to trigger chunked translation\nchunk_threshold: 4000\n\n# Max words per chunk\nchunk_max_words: 5000\n\n# Custom glossary (merged with built-in glossary)\n# CLI --glossary flag overrides these\n# Supports inline entries and/or file paths\nglossary:\n  - from: \"Reinforcement Learning\"\n    to: \"强化学习\"\n  - from: \"Transformer\"\n    to: \"Transformer\"\n    note: \"Keep English\"\n\n# Load glossary from external file(s)\n# Supports absolute path or relative to EXTEND.md location\n# File format: markdown table with | from | to | note | columns,\n# or YAML list of {from, to, note} entries\nglossary_files:\n  - ./my-glossary.md\n  - /path/to/shared-glossary.yaml\n\n# Language-pair specific glossaries\nglossaries:\n  en-zh:\n    - from: \"AI Agent\"\n      to: \"AI 智能体\"\n  ja-zh:\n    - from: \"人工知能\"\n      to: \"人工智能\"\n```\n\n## Fields\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| `target_language` | string | `zh-CN` | Default target language code |\n| `default_mode` | string | `normal` | Default translation mode (`quick` / `normal` / `refined`) |\n| `audience` | string | `general` | Target reader profile (`general` / `technical` / `academic` / `business` / custom) |\n| `style` | string | `storytelling` | Translation style (`storytelling` / `formal` / `technical` / `literal` / `academic` / `business` / `humorous` / `conversational` / `elegant` / custom) |\n| `chunk_threshold` | number | `4000` | Word count threshold to trigger chunked translation |\n| `chunk_max_words` | number | `5000` | Max words per chunk |\n| `glossary` | array | `[]` | Universal glossary entries (inline) |\n| `glossary_files` | array | `[]` | External glossary file paths (absolute or relative to EXTEND.md) |\n| `glossaries` | object | `{}` | Language-pair specific glossary entries |\n\n## Glossary Entry\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `from` | yes | Source term |\n| `to` | yes | Target translation |\n| `note` | no | Usage note (e.g., \"Keep English\", \"Only in tech context\") |\n\n## Glossary File Format\n\nExternal glossary files (`glossary_files`) support two formats:\n\n**Markdown table** (`.md`):\n```markdown\n| from | to | note |\n|------|----|------|\n| Reinforcement Learning | 强化学习 | |\n| Transformer | Transformer | Keep English |\n```\n\n**YAML list** (`.yaml` / `.yml`):\n```yaml\n- from: \"Reinforcement Learning\"\n  to: \"强化学习\"\n- from: \"Transformer\"\n  to: \"Transformer\"\n  note: \"Keep English\"\n```\n\n"},{"path":"references/config/first-time-setup.md","content":"---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-translate preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY translation. Do NOT:\n- Start translating content\n- Ask about files or output paths\n- Proceed to any workflow steps\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue translation\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Target Language\n\n```yaml\nheader: \"Target Language\"\nquestion: \"Default target language?\"\noptions:\n  - label: \"简体中文 zh-CN (Recommended)\"\n    description: \"Translate to Simplified Chinese\"\n  - label: \"繁體中文 zh-TW\"\n    description: \"Translate to Traditional Chinese\"\n  - label: \"English en\"\n    description: \"Translate to English\"\n  - label: \"日本語 ja\"\n    description: \"Translate to Japanese\"\n```\n\nNote: User may type a custom language code.\n\n### Question 2: Translation Mode\n\n```yaml\nheader: \"Mode\"\nquestion: \"Default translation mode?\"\noptions:\n  - label: \"Normal (Recommended)\"\n    description: \"Analyze content first, then translate\"\n  - label: \"Quick\"\n    description: \"Direct translation, no analysis\"\n  - label: \"Refined\"\n    description: \"Full workflow: analyze → translate → review → polish\"\n```\n\n### Question 3: Target Audience\n\n```yaml\nheader: \"Audience\"\nquestion: \"Default target audience?\"\noptions:\n  - label: \"General readers (Recommended)\"\n    description: \"Plain language, more translator's notes for jargon\"\n  - label: \"Technical\"\n    description: \"Developers/engineers, less annotation on tech terms\"\n  - label: \"Academic\"\n    description: \"Formal register, precise terminology\"\n  - label: \"Business\"\n    description: \"Business-friendly tone, explain tech concepts\"\n```\n\nNote: User may type a custom audience description.\n\n### Question 4: Translation Style\n\n```yaml\nheader: \"Style\"\nquestion: \"Translation style?\"\noptions:\n  - label: \"Storytelling (Recommended)\"\n    description: \"Engaging narrative flow, smooth transitions\"\n  - label: \"Formal\"\n    description: \"Professional, structured, neutral tone\"\n  - label: \"Technical\"\n    description: \"Precise, documentation-style, concise\"\n  - label: \"Literal\"\n    description: \"Close to original structure\"\n  - label: \"Academic\"\n    description: \"Scholarly, rigorous, formal register\"\n  - label: \"Business\"\n    description: \"Concise, results-focused, action-oriented\"\n  - label: \"Humorous\"\n    description: \"Preserves humor, witty, playful\"\n  - label: \"Conversational\"\n    description: \"Casual, friendly, spoken-like\"\n  - label: \"Elegant\"\n    de"},{"path":"references/glossary-en-zh.md","content":"# English → Chinese Glossary\n\nTerms where standard translation is non-obvious or easily mistranslated. Common terms with straightforward translations (e.g., Machine Learning → 机器学习) are omitted — the model already knows these.\n\n| English | Chinese | Notes |\n|---------|---------|-------|\n| AI Agent | AI 智能体 | |\n| Vibe Coding | 凭感觉编程 | |\n| the Bitter Lesson | 苦涩的教训 | Rich Sutton's essay |\n| Context Engineering | 上下文工程 | |\n| AI Wrapper | AI 套壳 | |\n| RLHF | 基于人类反馈的强化学习 | |\n| Hallucination | 幻觉 | AI-specific meaning |\n| Alignment | 对齐 | AI safety context |\n| Guardrails | 护栏 | AI safety context |\n| Agentic | 智能体化的 | |\n| Grounding | 基础化/落地 | Context-dependent |\n| Embedding | 嵌入/向量化 | Context-dependent |\n| Moat | 护城河 | Business context |\n| Flywheel | 飞轮效应 | |\n| Boilerplate | 样板代码 | |"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\", \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\",... Skill: Baoyu Translate Owner: jimliu Summary: This skill should be used when the user asks to \"translate\", \"翻译\", \"精翻\", \"translate article\", \"translate to Chinese\", \"translate to English\", \"改成中文\", \"改成英文\",... Tags: latest:1.117.3 Version history: v1.117.3 | 2026-06-13T05:01:28.863Z | auto - Updated description in SKILL.md for improved clarity and brevity. - Removed the file skill-card.md. - No changes to functional cod","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1565,"uniquenessScore":47,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T04:35:13.724Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T04:35:13.724Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T20:33:05.729Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}