claude-command-converter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClaude Command Converter
Claude命令转换器
Convert Claude Code commands to standard Agent Skills format for portability across AI coding assistants.
将Claude Code命令转换为标准Agent Skills格式,以便在不同AI编码助手之间实现可移植性。
When to Use
适用场景
- Migrating existing files to
.claude/commands/*.mdformat.skills/*/SKILL.md - Creating portable skills from Claude Code-specific commands.
- Standardizing command definitions for use with Claude Code, Codex CLI, GitHub Copilot, and other runtimes.
- 将现有的文件迁移至
.claude/commands/*.md格式。skills/*/SKILL.md - 从Claude Code专属命令创建可移植技能。
- 标准化命令定义,以便在Claude Code、Codex CLI、GitHub Copilot及其他运行时中使用。
Inputs
输入项
- Source command file path (e.g., ).
.claude/commands/my-command.md - Optional: target skill name (defaults to command filename without extension).
If input is missing, ask for the source command file path.
- 源命令文件路径(例如:)。
.claude/commands/my-command.md - 可选:目标技能名称(默认值为不带扩展名的命令文件名)。
若输入缺失,请询问源命令文件路径。
Format Differences
格式差异
Claude Code Command Format
Claude Code命令格式
Location:
.claude/commands/<command-name>.mdyaml
---
description: Short description of the command
handoffs:
- label: Next Action
agent: other.command
prompt: Trigger prompt
send: true
---存储位置:
.claude/commands/<command-name>.mdyaml
---
description: Short description of the command
handoffs:
- label: Next Action
agent: other.command
prompt: Trigger prompt
send: true
---User Input
User Input
```text
$ARGUMENTS
```
[Command instructions...]
undefined```text
$ARGUMENTS
```
[Command instructions...]
undefinedStandard Agent Skill Format
标准Agent Skill格式
Location:
skills/<skill-name>/SKILL.mdyaml
---
name: skill-name
description: Complete description including what the skill does and when to use it.
---存储位置:
skills/<skill-name>/SKILL.mdyaml
---
name: skill-name
description: Complete description including what the skill does and when to use it.
---Skill Title
Skill Title
When to Use
When to Use
- Scenario 1
- Scenario 2
- Scenario 1
- Scenario 2
Inputs
Inputs
- Required input 1
- Optional input 2
- Required input 1
- Optional input 2
Workflow
Workflow
- Step 1
- Step 2 ...
- Step 1
- Step 2 ...
Outputs
Outputs
- Output file 1
- Output file 2
undefined- Output file 1
- Output file 2
undefinedConversion Workflow
转换流程
-
Read the source command from.
.claude/commands/ -
Extract metadata:
- from YAML frontmatter.
description - for related skills/next steps.
handoffs - handling for inputs.
$ARGUMENTS
-
Determine skill name:
- Convert →
command.name.md(replace dots with hyphens).command-name - Use kebab-case for multi-word names.
- Convert
-
Create skill directory:
skills/<skill-name>/ -
Transform content to SKILL.md format:
- Frontmatter: Keep and
nameonly.description - Enhance description: Expand to include when to use the skill.
- Convert : Document as Inputs section.
$ARGUMENTS - Structure workflow: Extract steps into numbered Workflow section.
- Add "When to Use": Derive from command context and description.
- Add "Outputs": List generated files/artifacts.
- Convert handoffs: Add "Next Steps" section referencing related skills.
- Frontmatter: Keep
-
Remove runtime-specific content:
- Remove section with
## User Inputblock.$ARGUMENTS - Remove from frontmatter (move to prose).
handoffs - Remove references (use skill names instead).
/command.name
- Remove
-
Validate skill structure:
- Frontmatter has and
nameonly.description - Body has clear sections (When to Use, Inputs, Workflow, Outputs).
- No TODO placeholders remain.
- No runtime-specific variables like .
$ARGUMENTS
- Frontmatter has
-
Report conversion result:
- Source command path.
- Generated skill path.
- Key transformations applied.
- Manual review recommendations.
-
读取源命令:从目录读取源命令文件。
.claude/commands/ -
提取元数据:
- 从YAML前置元数据中提取。
description - 提取信息,用于关联技能/后续步骤。
handoffs - 处理,作为输入项。
$ARGUMENTS
- 从YAML前置元数据中提取
-
确定技能名称:
- 将转换为
command.name.md(将点替换为连字符)。command-name - 多词名称使用短横线分隔式(kebab-case)。
- 将
-
创建技能目录:
skills/<skill-name>/ -
转换内容至SKILL.md格式:
- 前置元数据:仅保留和
name。description - 完善描述:扩展描述内容,包含技能的适用场景。
- 转换:将其记录到“输入项”章节。
$ARGUMENTS - 构建工作流:将步骤提取为编号的“工作流”章节。
- 添加“适用场景”:从命令上下文和描述中推导内容。
- 添加“输出项”:列出生成的文件/产物。
- 转换handoffs:添加“后续步骤”章节,关联相关技能。
- 前置元数据:仅保留
-
移除运行时专属内容:
- 移除包含块的
$ARGUMENTS章节。## User Input - 从前置元数据中移除(移至正文)。
handoffs - 移除引用(改用技能名称)。
/command.name
- 移除包含
-
验证技能结构:
- 前置元数据仅包含和
name。description - 正文包含清晰的章节(适用场景、输入项、工作流、输出项)。
- 无遗留的TODO占位符。
- 无等运行时专属变量。
$ARGUMENTS
- 前置元数据仅包含
-
报告转换结果:
- 源命令路径。
- 生成的技能路径。
- 应用的关键转换操作。
- 人工审核建议。
Transformation Rules
转换规则
| Claude Command | Agent Skill |
|---|---|
| Inputs section describing expected user input |
| Next Steps section with skill references |
| |
| |
| |
Inline | Removed; documented in Inputs |
| Claude命令 | Agent Skill |
|---|---|
| 输入项章节,描述预期的用户输入 |
| 后续步骤章节,包含技能引用 |
| |
| |
前置元数据中的 | |
内嵌的 | 移除;在输入项中记录相关内容 |
Example Conversion
转换示例
Input:
.claude/commands/speckit.specify.mdyaml
---
description: Create feature specification from natural language.
handoffs:
- label: Build Technical Plan
agent: speckit.plan
---输入:
.claude/commands/speckit.specify.mdyaml
---
description: Create feature specification from natural language.
handoffs:
- label: Build Technical Plan
agent: speckit.plan
---User Input
User Input
```text
$ARGUMENTS
```
The text the user typed after ...
/speckit.specify
**Output**: `skills/speckit-specify/SKILL.md`
```yaml
---
name: speckit-specify
description: Create or update a feature specification from a natural language feature description.
---```text
$ARGUMENTS
```
The text the user typed after ...
/speckit.specify
**输出**:`skills/speckit-specify/SKILL.md`
```yaml
---
name: speckit-specify
description: Create or update a feature specification from a natural language feature description.
---Spec Kit Specify Skill
Spec Kit Specify Skill
When to Use
When to Use
- The user wants a new or updated feature spec from a natural language description.
- The user wants a new or updated feature spec from a natural language description.
Inputs
Inputs
- Feature description from the user.
- Repo context with scripts and templates.
.specify/
If the description is missing or unclear, ask a targeted question before continuing.
- Feature description from the user.
- Repo context with scripts and templates.
.specify/
If the description is missing or unclear, ask a targeted question before continuing.
Workflow
Workflow
...
...
Outputs
Outputs
specs/<feature>/spec.mdspecs/<feature>/checklists/requirements.md
specs/<feature>/spec.mdspecs/<feature>/checklists/requirements.md
Next Steps
Next Steps
After generating spec.md:
- Plan technical implementation with speckit-plan.
- Clarify specification requirements with speckit-clarify.
undefinedAfter generating spec.md:
- Plan technical implementation with speckit-plan.
- Clarify specification requirements with speckit-clarify.
undefinedKey Rules
核心规则
- Preserve all workflow logic and instructions.
- Remove runtime-specific constructs (,
$ARGUMENTS,handoffs)./slash-commands - Expand terse descriptions to include usage triggers.
- Use imperative voice in workflow steps.
- Keep skills self-contained and portable.
- Don't add extraneous documentation files (README, CHANGELOG, etc.).
- 保留所有工作流逻辑和指令。
- 移除运行时专属结构(、
$ARGUMENTS、handoffs)。/slash-commands - 扩展简洁描述,包含使用触发条件。
- 工作流步骤使用祈使语气。
- 保持技能独立且可移植。
- 不添加额外的文档文件(README、CHANGELOG等)。
Next Steps
后续步骤
After conversion:
- Review generated SKILL.md for completeness.
- Delete unused example files in ,
scripts/,references/.assets/ - Update AGENTS.md/CLAUDE.md skill inventory if applicable.
- Create symlinks for runtime integration if needed.
转换完成后:
- 审核生成的SKILL.md内容是否完整。
- 删除、
scripts/、references/目录中未使用的示例文件。assets/ - 若适用,更新AGENTS.md/CLAUDE.md技能清单。
- 如有需要,创建符号链接以实现运行时集成。