claude-command-converter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Claude 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
    .claude/commands/*.md
    files to
    skills/*/SKILL.md
    format.
  • 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>.md
yaml
---
description: Short description of the command
handoffs:
  - label: Next Action
    agent: other.command
    prompt: Trigger prompt
    send: true
---
存储位置:
.claude/commands/<command-name>.md
yaml
---
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...]
undefined

Standard Agent Skill Format

标准Agent Skill格式

Location:
skills/<skill-name>/SKILL.md
yaml
---
name: skill-name
description: Complete description including what the skill does and when to use it.
---
存储位置:
skills/<skill-name>/SKILL.md
yaml
---
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

  1. Step 1
  2. Step 2 ...
  1. Step 1
  2. Step 2 ...

Outputs

Outputs

  • Output file 1
  • Output file 2
undefined
  • Output file 1
  • Output file 2
undefined

Conversion Workflow

转换流程

  1. Read the source command from
    .claude/commands/
    .
  2. Extract metadata:
    • description
      from YAML frontmatter.
    • handoffs
      for related skills/next steps.
    • $ARGUMENTS
      handling for inputs.
  3. Determine skill name:
    • Convert
      command.name.md
      command-name
      (replace dots with hyphens).
    • Use kebab-case for multi-word names.
  4. Create skill directory:
    skills/<skill-name>/
  5. Transform content to SKILL.md format:
    • Frontmatter: Keep
      name
      and
      description
      only.
    • Enhance description: Expand to include when to use the skill.
    • Convert
      $ARGUMENTS
      : Document as Inputs section.
    • 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.
  6. Remove runtime-specific content:
    • Remove
      ## User Input
      section with
      $ARGUMENTS
      block.
    • Remove
      handoffs
      from frontmatter (move to prose).
    • Remove
      /command.name
      references (use skill names instead).
  7. Validate skill structure:
    • Frontmatter has
      name
      and
      description
      only.
    • Body has clear sections (When to Use, Inputs, Workflow, Outputs).
    • No TODO placeholders remain.
    • No runtime-specific variables like
      $ARGUMENTS
      .
  8. Report conversion result:
    • Source command path.
    • Generated skill path.
    • Key transformations applied.
    • Manual review recommendations.
  1. 读取源命令:从
    .claude/commands/
    目录读取源命令文件。
  2. 提取元数据
    • 从YAML前置元数据中提取
      description
    • 提取
      handoffs
      信息,用于关联技能/后续步骤。
    • 处理
      $ARGUMENTS
      ,作为输入项。
  3. 确定技能名称
    • command.name.md
      转换为
      command-name
      (将点替换为连字符)。
    • 多词名称使用短横线分隔式(kebab-case)。
  4. 创建技能目录
    skills/<skill-name>/
  5. 转换内容至SKILL.md格式
    • 前置元数据:仅保留
      name
      description
    • 完善描述:扩展描述内容,包含技能的适用场景。
    • 转换
      $ARGUMENTS
      :将其记录到“输入项”章节。
    • 构建工作流:将步骤提取为编号的“工作流”章节。
    • 添加“适用场景”:从命令上下文和描述中推导内容。
    • 添加“输出项”:列出生成的文件/产物。
    • 转换handoffs:添加“后续步骤”章节,关联相关技能。
  6. 移除运行时专属内容
    • 移除包含
      $ARGUMENTS
      块的
      ## User Input
      章节。
    • 从前置元数据中移除
      handoffs
      (移至正文)。
    • 移除
      /command.name
      引用(改用技能名称)。
  7. 验证技能结构
    • 前置元数据仅包含
      name
      description
    • 正文包含清晰的章节(适用场景、输入项、工作流、输出项)。
    • 无遗留的TODO占位符。
    • $ARGUMENTS
      等运行时专属变量。
  8. 报告转换结果
    • 源命令路径。
    • 生成的技能路径。
    • 应用的关键转换操作。
    • 人工审核建议。

Transformation Rules

转换规则

Claude CommandAgent Skill
$ARGUMENTS
Inputs section describing expected user input
handoffs:
Next Steps section with skill references
/command.name
skill-name
(kebab-case)
agent: foo.bar
foo-bar
skill reference
description:
in frontmatter
description:
expanded with triggers
Inline
## User Input
Removed; documented in Inputs
Claude命令Agent Skill
$ARGUMENTS
输入项章节,描述预期的用户输入
handoffs:
后续步骤章节,包含技能引用
/command.name
skill-name
(短横线分隔式)
agent: foo.bar
foo-bar
技能引用
前置元数据中的
description:
description:
扩展包含触发条件
内嵌的
## User Input
移除;在输入项中记录相关内容

Example Conversion

转换示例

Input:
.claude/commands/speckit.specify.md
yaml
---
description: Create feature specification from natural language.
handoffs:
  - label: Build Technical Plan
    agent: speckit.plan
---
输入
.claude/commands/speckit.specify.md
yaml
---
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
    .specify/
    scripts and templates.
If the description is missing or unclear, ask a targeted question before continuing.
  • Feature description from the user.
  • Repo context with
    .specify/
    scripts and templates.
If the description is missing or unclear, ask a targeted question before continuing.

Workflow

Workflow

...
...

Outputs

Outputs

  • specs/<feature>/spec.md
  • specs/<feature>/checklists/requirements.md
  • specs/<feature>/spec.md
  • specs/<feature>/checklists/requirements.md

Next Steps

Next Steps

After generating spec.md:
  • Plan technical implementation with speckit-plan.
  • Clarify specification requirements with speckit-clarify.
undefined
After generating spec.md:
  • Plan technical implementation with speckit-plan.
  • Clarify specification requirements with speckit-clarify.
undefined

Key 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技能清单。
  • 如有需要,创建符号链接以实现运行时集成。