API翻译
- 作者仓库星标 17,110
- 作者更新于 实时读取
- 作者仓库 ZLMediaKit
- 领域
- 文档
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @ZLMediaKit · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: Project General Translation & Terminology Guidelines
description: Definitive guidelines, contextual awareness strategies, standard terminology, and comment format…
category: 文档
runtime: 无特殊运行时
---
# Project General Translation & Terminology Guidelines 输出预览
## PART A: 任务判断
- 适用问题:PRD、RFC、README、项目说明或知识库整理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Phase 1: Contextual Anchoring (MANDATORY BEFORE TRANSLATION) / Phase 2: Structural Translation & Anti-Pattern Detection / 🚫 Rule 1: The "Action-Result" Paradigm”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于PRD、RFC、README、项目说明或知识库整理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Phase 1: Contextual Anchoring (MANDATORY BEFORE TRANSLATION) / Phase 2: Structural Translation & Anti-Pattern Detection / 🚫 Rule 1: The "Action-Result" Paradigm”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/index` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Phase 1: Contextual Anchoring (MANDATORY BEFORE TRANSLATION) / Phase 2: Structural Translation & Anti-Pattern Detection / 🚫 Rule 1: The "Action-Result" Paradigm”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: Project General Translation & Terminology Guidelines
description: Definitive guidelines, contextual awareness strategies, standard terminology, and comment format…
category: 文档
source: ZLMediaKit/ZLMediaKit
---
# Project General Translation & Terminology Guidelines
## 什么时候使用
- 把项目文档方向的常用动作沉淀成 Agent 可调用的技能 适合处理README、PRD、RFC、教程和知识库文档,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的…
- 面向PRD、RFC、README、项目说明或知识库整理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Phase 1: Contextual Anchoring (MANDATORY BEFORE TRANSLATION) / Phase 2: Structural Translation & Anti-Pattern Detection / 🚫 Rule 1: The "Action-Result" Paradigm」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "Project General Translation & Terminology Guidelines" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Phase 1: Contextual Anchoring (MANDATORY BEFORE TRANSLATION) / Phase 2: Structural Translation & Anti-Pattern Detection / 🚫 Rule 1: The "Action-Result" Paradigm
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} 🤖 Systemic Translation & Terminology Instructions for AI Agents
This document is the absolute source of truth and Standard Operating Procedure (SOP) for translating Chinese comments, configurations, and documentation into English within this repository.
ATTENTION AI AGENTS: You are NOT merely translating words; you are executing a systematic algorithm to localize complex streaming media and networking concepts. Do not rely solely on "passive reading" or "translation memory." You MUST follow the rigid workflow outlined below.
Phase 1: Contextual Anchoring (MANDATORY BEFORE TRANSLATION)
Before translating any block of text, you must explicitly anchor yourself to the specific technical domain. Literal translation of Chinese industry slang (黑话) is strictly prohibited.
- Identify the Domain: Look at the module or configuration section (e.g.,
[rtp_proxy],[http],[general],[hls]). - Setup the Mental Lexicon:
- If
[api]/[http]: Anchor to standard REST API and Web server concepts (e.g.,Requests/Responses,CORS,Forwarded IPs). - If
Network I/O / [general]: Anchor to socket programming and OS-level terms (e.g.,Write coalescing,Buffers,File handles). - If
Media Streaming (RTSP/RTMP/RTC): Anchor to multimedia transport concepts (e.g.,GOP,Payload,B-frames,Jitter,Visual artifacts).
- If
- Verification-Driven Translation: If you encounter a Chinese term that sounds colloquial or metaphoric (e.g., “花屏” - flowered screen, “秒开” - open in seconds, “溯源” - trace back to origin), DO NOT guess or translate literally. Ask yourself: "How do top-tier English open-source projects (FFmpeg, WebRTC, Nginx) refer to this specific technical phenomenon?"
Phase 2: Structural Translation & Anti-Pattern Detection
LLMs naturally tend to follow the grammatical structure of the source text. Chinese technical writing often uses sprawling sentences and explanatory fillers. You must actively break these patterns.
🚫 Rule 1: The "Action-Result" Paradigm
- Trigger: When the Chinese text says "设置为0关闭此特性" (Setting this to 0 disables this feature) or "打开此选项会导致..." (Turning this on causes...).
- Execution: Force your output to use the exact structure:
Setting this to [Value] disables [Feature] and allows [Consequence].Do NOT translate explanatory filler like "This mechanism's logic dictates that...".
🚫 Rule 2: Sub-clause Elimination (No "Chinglish")
- Trigger: Long noun clusters or overly personified system descriptions (e.g., "服务器会认为这个流是断开的" - The server will think this stream is disconnected).
- Execution: Use direct, objective voice:
The stream is considered disconnected.orThe system drops the stream.
🚫 Rule 3: Clarifying Ambiguous Actions
- Trigger: The word
忽略(Ignore/Skip) vs.丢弃/放弃(Abandon/Drop). - Execution: Use
IgnoreorSkipfor non-critical timeouts (e.g., waiting for a track to be ready). ReserveAbandon,DroporDisconnectonly for fatal errors or closed sockets.
🚫 Rule 4: Zero Information Loss & Causal Reconstruction
- Trigger: When condensing text for native flow, or translating complex caveats (e.g., parenthetical conditions, "而不是" / instead of, side-effects).
- Execution: You may reorganise syntax to sound professional, but you MUST NOT drop crucial qualifiers, modifiers, or side effects. If a Chinese config says "instead of returning X via hook", the English translation must explicitly mention "returning X". Information completeness supersedes structural brevity.
🚫 Rule 5: The Golden Balance (Zero Info Loss vs. Native Phrasing)
- The Core Conflict: You must achieve Zero Information Loss WITHOUT resorting to Chinglish or literal word-for-word translation.
- What "Information" Means: "Retaining information" means capturing 100% of the technical causality, side-effects, prerequisites, and system boundaries present in the Chinese text.
- What "Information" DOES NOT Mean: It does NOT mean preserving the Chinese grammatical structure, literal phrasing, or colloquialisms (啰嗦句子和字面用词).
- Execution (The Top-Down Conceptual Approach):
- Contextual Override: Never translate a noun literally if the surrounding constraints (e.g., units like "seconds", prefixes, or the specific protocol) dictate a domain term. For example, if a setting is measured in "seconds", the Chinese word "大小" (size) MUST logically translate to
DurationorInterval, NEVERSize. - Conceptual Compression: When faced with a sprawling, explanatory Chinese sentence, distill the technical payload and express it using concise, standard industry jargon.
- Anti-pattern (Literal/Chinglish):
After disabling the traditional authentication mode, you must first call the API to log in. Upon success, a cookie will be set, and all APIs can be accessed without restriction as long as the cookie is valid. - Pro-pattern (Native/Jargon):
When disabled, users must first call /index/api/login. Upon success, a cookie auth token is set for subsequent requests.(Using "subsequent requests" efficiently compresses the lengthy Chinese explanation).
- Anti-pattern (Literal/Chinglish):
- Technical Abstraction: Recognize standard operations (e.g., "拉流再推流"). Do not translate the physical actions (
pulling and then pushing); translate the abstract technical process (re-publishingorre-encoding).
- Contextual Override: Never translate a noun literally if the surrounding constraints (e.g., units like "seconds", prefixes, or the specific protocol) dictate a domain term. For example, if a setting is measured in "seconds", the Chinese word "大小" (size) MUST logically translate to
🚫 Rule 6: Anti-Summarization (Strict Boolean & Causality Preservation)
- Trigger: When applying Conceptual Compression (Rule 5) to a text block containing conditionals or explanations.
- The Core Conflict: Compression reduces word count by using jargon. Summarization drops critical logic. Summarization is strictly forbidden.
- Execution (The Boolean Mapping Rule):
- Treat Chinese comments like code blocks. Extract all
IF/THEN/ELSEbranches, prerequisites, and root causes before translating. - If the original text states a "success" path and a "failure" path, the English translation MUST explicitly state both paths. You cannot compress them into a single vague outcome.
- If the original text states why a feature exists (the exact cause or defect being prevented), the English translation MUST explicitly state that exact cause. You cannot compress it into generic "to improve performance" or "to prevent errors."
- Perform a Reverse Mapping Check: After writing the English sentence, ask yourself—"If I reverse-compile this English back to Chinese, would any
IFconditions or edge-case explanations be missing?" If yes, rewrite it completely to restore the dropped logic.
- Treat Chinese comments like code blocks. Extract all
Phase 3: The Hardcoded Terminology Dictionary
CRITICAL: When translating, if you encounter these Chinese concepts, you MUST use the exact, first provided English term. Do not mix or alternate synonyms.
Network & Architecture
- 源站 ->
Origin server - 溯源 (拉流) ->
Origin pull - 推流代理 / 拉流代理 ->
Publishing proxies/Pulling proxies - 按需拉流 ->
On-demand stream pulling - 集群 ->
Cluster - 推流断开后的超时等待 ->
Grace period for publisher reconnection
Video & Playback Experience
- 秒开 / 极速秒开 ->
Instant playback (zero-delay startup)(e.g., 级联秒开 ->Instant playback for cascaded streams) - 花屏 ->
Visual artifacts (glitches)(NEVER use "Screen tearing", which is a hardware V-sync issue) - 卡顿 ->
Playback stuttering
System I/O & HTTP
- 合并写 ->
Write coalescing(NEVER use "Merged write") - 请求和回复 ->
Requests and Responses(Avoid "Replies") - 在代理后方获取真实IP ->
Extract the real client IP when behind a proxy (e.g., via X-Forwarded-For)
General Technical Terms
- 切片 ->
Segment(e.g., HLS segment) - 封装 / 打包 ->
Packaging - 负载 ->
Payload - 鉴权 ->
Authentication - 处理 / 应对 (故障) ->
HandleorAddress
Phase 4: Strict Formatting Rules (CRITICAL)
When translating comments inside code files (.cpp, .h) or configs (.ini), apply these hard constraints:
- Bilingual Retention: Unless explicitly instructed to delete Chinese, ALWAYS retain the original Chinese comments.
- Bottom Placement: Place the English translation immediately below the Chinese line or block.
- Block Uniformity: Do NOT translate line-by-line (
ZH-EN-ZH-EN). If a Chinese comment is a 3-line block, output it as a 3-line Chinese block followed by a 3-line English block.
/*
* 这里是第一行中文描述。
* 这里是第二行中文补充。
*/
/*
* This is the English translation of the first line.
* This is the English translation of the second line.
*/
Phase 5: The Post-Translation Verification Workflow (DO NOT SKIP)
If you are asked to review or update translations in a long file, you cannot rely solely on passive reading. You MUST execute this workflow:
- Active Scan (Regex/Search): Before reading the document, use file search tools to actively scan for known anti-patterns in the current English text (e.g., search for
Screen tearing,Merged write,Replies,Source station). Fix them immediately. - Format Review: Scan for
ZH-EN-ZH-ENinterleaving and fix it to block format. - Blind English Review: After translating, hide the Chinese text from your mental context. Read only your English output constraint: Does this sound like a snippet from the official Nginx or WebRTC manuals? Is it concise (CBD: Clarity, Brevity, Directness)? If it sounds like a literal word-for-word translation, rewrite it natively.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核