Docs
Refer friends. Keep the rewards coming!Your friend can unlock up to 10M tokens · earn up to 30% revenue share.
+500K TokensGenerate link

Skill Manifest (Archive)

Archived original-language source from the legacy CrabClaw docs. This page is intentionally not machine-translated.

SKILL.md 是 Crab Claw 的技能定义文件,使用 YAML frontmatter + Markdown 正文格式。

文件位置

路径优先级说明
docs/skills/***/SKILL.md工作区技能
~/.crabclaw/skills/***/SKILL.md用户全局技能
内置 Resources/docs/skills/系统默认技能

Frontmatter 字段

必填字段

字段类型说明
namestring技能标识符(全局唯一)
descriptionstring简短描述,不超过 120 字符

可选字段

字段类型说明
toolsstring[]绑定的能力树工具名称
metadata.crabclaw.tree_idstring能力树节点 ID(如 runtime/bash
metadata.crabclaw.tree_groupstring工具组(如 runtimefsweb
metadata.crabclaw.min_tierstring最低意图层级
metadata.crabclaw.approval_typestring审批类型
metadata.crabclaw.tool_schemaobject组合工具定义

意图层级 (min_tier)

说明
greeting问候/闲聊
question信息查询
task_light轻量任务(只读)
task_write写入任务
task_delete删除任务
task_multimodal多模态复杂任务

审批类型 (approval_type)

说明
none无需审批
plan_confirm计划确认(写入操作)
exec_escalation执行提权(Shell 命令)
data_export数据导出(文件发送)
mount_access挂载访问(工作区外路径)

tool_schema 格式

用于定义组合技能的自动化流水线:

yaml
metadata:
  crabclaw:
    tool_schema:
      input: { JSON Schema }
      output: { JSON Schema }
      steps:
        - action: "步骤描述"
          tool: "工具名称"
          input_map:
            param: "{{variable.path}}"
          output_as: "变量名"
          on_error: "abort|skip|retry"
          approval: "审批类型"
          loop_over: "{{array.path}}"
metadata:
  crabclaw:
    tool_schema:
      input: { JSON Schema }
      output: { JSON Schema }
      steps:
        - action: "步骤描述"
          tool: "工具名称"
          input_map:
            param: "{{variable.path}}"
          output_as: "变量名"
          on_error: "abort|skip|retry"
          approval: "审批类型"
          loop_over: "{{array.path}}"

step 字段

字段必填类型说明
actionstring步骤描述
toolstring能力树工具名称
input_mapobject输入参数映射
output_asstring输出变量名
on_errorstring错误策略(默认 abort
approvalstring步骤级审批覆盖
loop_overstring循环变量路径

变量模板

语法说明
{{input.field}}用户输入字段
{{step_output.field}}前置步骤输出
{{item}}loop_over 循环当前项

完整示例

yaml
---
name: file-summarizer
description: "读取文件并生成摘要"
tools:
  - read_file
  - bash
metadata:
  crabclaw:
    tree_group: operations
    min_tier: task_light
    approval_type: exec_escalation
    tool_schema:
      input:
        type: object
        properties:
          path:
            type: string
            description: "文件路径"
        required: ["path"]
      steps:
        - action: "读取文件"
          tool: read_file
          input_map:
            path: "{{input.path}}"
          output_as: content
        - action: "统计行数"
          tool: bash
          input_map:
            command: "echo '{{content}}' | wc -l"
          output_as: lines
          on_error: skip
---

读取指定文件并生成内容摘要,包含行数统计。
---
name: file-summarizer
description: "读取文件并生成摘要"
tools:
  - read_file
  - bash
metadata:
  crabclaw:
    tree_group: operations
    min_tier: task_light
    approval_type: exec_escalation
    tool_schema:
      input:
        type: object
        properties:
          path:
            type: string
            description: "文件路径"
        required: ["path"]
      steps:
        - action: "读取文件"
          tool: read_file
          input_map:
            path: "{{input.path}}"
          output_as: content
        - action: "统计行数"
          tool: bash
          input_map:
            command: "echo '{{content}}' | wc -l"
          output_as: lines
          on_error: skip
---

读取指定文件并生成内容摘要,包含行数统计。