convert-code
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConvert Code
代码转换
Purpose
用途
Convert code from one language to another
将代码从一种语言转换为另一种语言
Routing
适用场景与限制
- Use when: Use when asked to translate source code from one language to another while preserving behavior.
- Do not use when: Don't use when target language constraints, API semantics, or requirements are unclear.
- Outputs: Converted source plus migration notes and any intentional semantic deviations.
- Success criteria: Core logic and behavior stay equivalent, with idiomatic target-language usage.
- 适用场景:当需要将源代码从一种语言转换为另一种语言且需保留原有行为时使用。
- 不适用场景:当目标语言的限制、API语义或需求不明确时,请勿使用。
- 输出内容:转换后的源代码,以及迁移说明和所有主动做出的语义变更。
- 成功标准:核心逻辑与行为保持一致,且符合目标语言的惯用写法。
Trigger Examples
触发示例
Positive
正向示例
- Use the convert-code skill for this request.
- Help me with convert code.
- Use when asked to translate source code from one language to another while preserving behavior.
- Convert Code: provide an actionable result.
- 针对此请求使用convert-code技能。
- 帮我进行代码转换。
- 当需要将源代码从一种语言转换为另一种语言且需保留原有行为时使用。
- 代码转换:提供可执行的结果。
Negative
负向示例
- Don't use when target language constraints, API semantics, or requirements are unclear.
- Do not use convert-code for unrelated requests.
- This request is outside convert code scope.
- This is conceptual discussion only; no tool workflow is needed.
- 当目标语言的限制、API语义或需求不明确时,请勿使用。
- 请勿将convert-code用于无关请求。
- 此请求超出代码转换的范围。
- 此仅为概念性讨论;无需使用工具工作流。
Parameters
参数
| Name | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | Path to the source file |
| targetLanguage | select | Yes | Target programming language |
| 名称 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| path | 字符串 | 是 | 源文件路径 |
| targetLanguage | 选择项 | 是 | 目标编程语言 |
Runtime Prompt
运行时提示
- Current runtime prompt length: 409 characters.
- Runtime prompt is defined directly in .
../convert-code.json
- 当前运行时提示长度:409字符。
- 运行时提示直接定义在中。
../convert-code.json