create-claw-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenClaw Skill & Command Generator
OpenClaw技能与命令生成器
Generate well-structured OpenClaw skills or slash commands. Both are SKILL.md files with YAML frontmatter — they share the same structure but differ in how they're triggered and described. OpenClaw uses the AgentSkills spec (pi-coding-agent) with its own frontmatter fields, tool names, and path conventions distinct from Claude Code.
生成结构规范的OpenClaw技能或斜杠命令。二者均为带有YAML前置元数据的SKILL.md文件——它们结构相同,但触发方式和描述方式有所区别。OpenClaw采用AgentSkills规范(pi-coding-agent),拥有独立于Claude Code的前置元数据字段、工具名称和路径约定。
Phase 0: Fetch Current Documentation
阶段0:获取最新文档
Before generating, retrieve the latest OpenClaw skill documentation:
bash
clawdocs get "tools/skills" --no-header -qCapture any frontmatter fields or options not already listed in . If is unavailable, proceed with current references — they are sufficient. If new fields appear, use them and note the update.
{baseDir}/references/frontmatter-options.mdclawdocs生成前,请获取最新的OpenClaw技能文档:
bash
clawdocs get "tools/skills" --no-header -q捕获所有未在中列出的前置元数据字段或选项。若不可用,可基于现有参考文档继续——现有内容已足够。若出现新字段,请使用这些字段并记录更新。
{baseDir}/references/frontmatter-options.mdclawdocsPhase 1: Understand Requirements
阶段1:理解需求
Parse for type hint. Users are often unclear on OpenClaw-specific conventions. Interview to gather:
$ARGUMENTS- Primary objective — What should this skill do?
- Trigger scenarios — When should it activate? What exact phrases would a user say?
- Inputs/outputs — What does it receive and produce?
- Complexity — Simple, standard, or complex workflow?
- Gating needs — Does it require specific binaries, env vars, or config keys? (drives )
metadata.openclaw.requires.* - Execution needs — Sub-agent delegation via ? Command dispatch (bypass model)?
sessions_spawn
Proceed to Phase 2 when at minimum Objective and Trigger Scenarios are established.
解析获取类型提示。用户通常对OpenClaw特定约定不够清晰,请通过沟通收集以下信息:
$ARGUMENTS- 核心目标——该技能应实现什么功能?
- 触发场景——何时激活该技能?用户会使用哪些具体表述?
- 输入/输出——它接收什么内容,产出什么结果?
- 复杂度——简单、标准还是复杂工作流?
- 权限需求——是否需要特定二进制文件、环境变量或配置密钥?(对应字段)
metadata.openclaw.requires.* - 执行需求——是否需要通过委托给子Agent?是否需要命令调度(绕过模型)?
sessions_spawn
至少确定核心目标和触发场景后,再进入阶段2。
Port Mode
移植模式
When the user provides an existing Claude Code skill to port (file path or pasted content), skip the interview and apply this translation sequence:
- Read the source skill and all its supporting files (scripts, references, examples)
- Frontmatter — Remove invalid fields (,
model,context,agent,allowed-tools,hooks). Addlicensewithmetadataif scripts need specific binaries. Seerequiresfor valid fields.{baseDir}/references/frontmatter-options.md - Tool names — Apply the translation table from :
{baseDir}/references/claw-patterns.md→Bash,exec→Read,read→Write,write→Edit,edit/Glob→Grep+exec/find,rg→WebSearch,web_search→WebFetch,web_fetch→Task,sessions_spawn→conversational askingAskUserQuestion - Paths — Replace with
$CLAUDE_PLUGIN_ROOT. Remove{baseDir}injection and bang-backtick references.@file - Scripts/references — Copy as-is if they are platform-neutral Python with no Claude Code SDK dependencies. Update any internal tool name references.
- Proceed directly to Phase 2 Step 7 (Validate) with translated content, then Phase 3 (Deliver).
当用户提供现有Claude Code技能进行移植(文件路径或粘贴内容)时,跳过沟通环节,按以下步骤转换:
- 读取源技能及其所有支持文件(脚本、参考文档、示例)
- 前置元数据——移除无效字段(、
model、context、agent、allowed-tools、hooks)。若脚本需要特定二进制文件,添加包含license的requires字段。有效字段请参考metadata。{baseDir}/references/frontmatter-options.md - 工具名称——按照中的转换表替换:
{baseDir}/references/claw-patterns.md→Bash、exec→Read、read→Write、write→Edit、edit/Glob→Grep+exec/find、rg→WebSearch、web_search→WebFetch、web_fetch→Task、sessions_spawn→对话式询问AskUserQuestion - 路径——将替换为
$CLAUDE_PLUGIN_ROOT。移除{baseDir}注入和反引号命令扩展引用。@file - 脚本/参考文档——若为平台无关且无Claude Code SDK依赖的Python代码,直接复制。更新所有内部工具名称引用。
- 将转换后的内容直接进入阶段2第7步(验证),之后进入阶段3(交付)。
Phase 2: Generate
阶段2:生成
Apply throughout generation: use imperative voice and terse phrasing because every token in a generated skill body costs budget on every invocation. Prefer instruction over example — state the rule with its reasoning so it generalizes to every input.
Initialize directory first (when creating a new skill directory, not editing an existing file):
bash
python3 {baseDir}/scripts/init_claw_skill.py <name> --path <dir> [--resources scripts,references,assets]Exit 0 = directory scaffolded, proceed to Step 1. Exit 1 = naming collision; ask user whether to overwrite or rename.
生成全程需遵循:使用祈使语气和简洁表述,因为生成技能体中的每个token在每次调用时都会消耗预算。优先使用指令而非示例——说明规则及其原理,使其能适用于所有输入。
先初始化目录(创建新技能目录而非编辑现有文件时):
bash
python3 {baseDir}/scripts/init_claw_skill.py <name> --path <dir> [--resources scripts,references,assets]返回码0 = 目录已搭建完成,进入步骤1。返回码1 = 命名冲突;询问用户是否覆盖或重命名。
Step 1 — Choose type
步骤1——选择类型
- Skills: Trigger-rich, third-person description ("This skill should be used when..."); auto-triggered by routing
- Commands: Concise, verb-first description, under 60 chars; user-invoked via menu
/ - Dispatch commands: with
command-dispatch: tool— bypasses model entirely, routes directly to a named tool (rare; for pure pass-through cases)command-tool
- 技能: 触发场景丰富,第三人称描述(“当...时应使用本技能”);由路由自动触发
- 命令: 简洁、动词开头的描述,不超过60字符;用户通过菜单手动调用
/ - 调度命令: 搭配
command-dispatch: tool——完全绕过模型,直接路由到指定工具(罕见;仅用于纯透传场景)command-tool
Step 2 — Write frontmatter
步骤2——编写前置元数据
Read for the full OpenClaw field catalog, description patterns, and the single-line JSON constraint.
{baseDir}/references/frontmatter-options.mdmetadataKey constraint: must be a single-line JSON object on one line. Multi-line YAML mappings under are not valid in OpenClaw.
metadatametadataDescription density rules: Keep descriptions under ~400 characters / ~100 tokens (600 chars / 150 tokens absolute max) — they load every session. Per the OpenClaw cost formula, each skill costs characters in the system prompt; a 10-skill install with verbose descriptions burns significant context on routing metadata alone. Derive trigger phrases from the user's actual words in Phase 1, not paraphrases. See the token budget and trigger derivation principles in .
195 + 97 + field lengths{baseDir}/references/frontmatter-options.mdIntensional over extensional — state the rule with its reasoning rather than listing examples that imply the rule. An intensional rule generalizes to every input the skill will encounter; an extensional list only covers the shapes shown.
阅读获取完整的OpenClaw字段目录、描述模式和单行JSON约束。
{baseDir}/references/frontmatter-options.mdmetadata关键约束:必须是单行JSON对象。OpenClaw不支持下的多行YAML映射。
metadatametadata描述密度规则: 描述内容控制在约400字符/100token以内(绝对上限为600字符/150token)——它们会在每个会话中加载。根据OpenClaw成本公式,每个技能在系统提示中占用字符;若安装10个带有冗长描述的技能,会在路由元数据上消耗大量上下文。从阶段1中用户的实际表述提取触发短语,而非改写。有关token预算和触发短语推导原则,请参考。
195 + 97 + 字段长度{baseDir}/references/frontmatter-options.md优先规则性描述而非枚举性描述——说明规则及其原理,而非列出隐含规则的示例。规则性描述能适用于技能遇到的所有输入;枚举性列表仅覆盖所示场景。
Step 3 — Validate description discoverability
步骤3——验证描述可发现性
Before writing the body, verify the description will route correctly. Mentally generate:
- 3 should-trigger prompts — realistic user messages that should activate this skill. Include at least one naive phrasing from a user who has never heard of the skill.
- 3 should-NOT-trigger prompts — messages in adjacent domains that are close but should not activate. These test whether the description is too broad.
Evaluate: does the description cover all should-trigger prompts? Would it plausibly reject the should-NOT-trigger prompts? If coverage is weak, revise the description — add missing trigger phrases, tighten language to exclude adjacent domains, or add a negative trigger ("Not for X").
This step catches routing misses before the rest of the skill is built. Proceed when description coverage is adequate.
编写技能体之前,先验证描述能否正确路由。在脑中生成:
- 3个应触发提示——能激活该技能的真实用户消息。至少包含一个从未听说过该技能的用户会使用的朴素表述。
- 3个不应触发提示——相近领域但不应激活该技能的消息。用于测试描述是否过于宽泛。
评估:描述是否覆盖所有应触发提示?是否能合理排除不应触发提示?若覆盖不足,修改描述——添加缺失的触发短语、收紧表述以排除相近领域,或添加否定触发条件(“不适用于X”)。
此步骤可在技能构建完成前发现路由遗漏问题。描述覆盖足够后再继续。
Step 4 — Write body
步骤4——编写技能体
Construction rules:
- State objective explicitly in first sentence
- Use imperative voice ("Analyze", "Generate", "Identify") — no first-person ("I will", "I am")
- Context only when necessary for understanding
- XML tags only for complex structured data
- No "When to Use This Skill" section — body loads only after triggering; routing guidance there is never read by the routing decision
- Avoid headers deeper than H3 — deep nesting signals content that belongs in , not
references/SKILL.md - is the path variable for skill-relative file references (substituted before model sees the skill body)
{baseDir}
Both skills and commands follow the same body pattern:
markdown
undefined构建规则:
- 第一句明确说明目标
- 使用祈使语气(“分析”、“生成”、“识别”)——不使用第一人称(“我将”、“我是”)
- 仅在必要时提供上下文
- 仅对复杂结构化数据使用XML标签
- 不包含“何时使用本技能”章节——技能体仅在触发后加载;路由决策不会读取该部分的路由指引
- 避免深度超过H3的标题——深层嵌套表明内容应放在中,而非SKILL.md
references/ - 是技能相对文件引用的路径变量(模型读取技能体前会替换该变量)
{baseDir}
技能和命令遵循相同的技能体格式:
markdown
undefinedName
名称
Brief overview (1-2 sentences).
简要概述(1-2句话)。
Process
流程
- Step one (imperative voice)
- Step two
- Step three
**Dynamic Content:**
| Syntax | Purpose |
|--------|---------|
| `$ARGUMENTS` | All arguments as string |
| `$1`, `$2`, `$3` | Positional arguments |
| `{baseDir}` | Absolute path to skill directory (substituted at load time) |
Note: `@file` injection and bang-backtick command expansion are Claude Code features specific to Claude Code's skill loader implementation — the pi-coding-agent skill loader only supports `{baseDir}` path substitution and does not implement these extensions. Do not use them in generated OpenClaw skills.- 步骤一(祈使语气)
- 步骤二
- 步骤三
**动态内容:**
| 语法 | 用途 |
|--------|---------|
| `$ARGUMENTS` | 所有参数的字符串形式 |
| `$1`, `$2`, `$3` | 位置参数 |
| `{baseDir}` | 技能目录的绝对路径(加载时替换) |
注意:`@file`注入和反引号命令扩展是Claude Code特有的技能加载器功能——pi-coding-agent技能加载器仅支持`{baseDir}`路径替换,不支持这些扩展。生成OpenClaw技能时请勿使用。Step 5 — Script opportunity scan
步骤5——脚本机会扫描
Read and apply the five signal patterns to every workflow step in the skill being generated:
{baseDir}/references/script-patterns.md| Signal | Question | If yes → |
|---|---|---|
| Repeated Generation | Does any step produce the same structure with different params across invocations? | Parameterized script in |
| Unclear Tool Choice | Does any step combine multiple operations in a fragile sequence naturally expressible as one function? | Script the procedure |
| Rigid Contract | Can you write | CLI candidate |
| Dual-Use Potential | Would a user want to run this step from the terminal, outside the skill workflow? | Design as proper CLI from the start |
| Consistency Critical | Must this step produce bit-for-bit identical output for identical inputs? | Script — never LLM generation |
For each identified script candidate:
- Choose the archetype from (init/validate/transform/package/query)
{baseDir}/references/script-patterns.md - Scaffold the script in using the Python template from
scripts/{baseDir}/references/script-patterns.md - Wire it into SKILL.md with: trigger condition, exact invocation using tool, output interpretation
exec
Wiring rule: A script reference must state when to invoke (trigger condition), how to invoke (exact command with flags), and what to do with the result (exit code handling, which output fields matter).
Scripts are invoked via the tool (not ). Reference paths using .
execBash{baseDir}/scripts/script.py阅读,将五种信号模式应用于正在生成的技能的每个工作流步骤:
{baseDir}/references/script-patterns.md| 信号 | 问题 | 如果是 → |
|---|---|---|
| 重复生成 | 是否有步骤在不同调用中生成结构相同但参数不同的内容? | 在 |
| 工具选择模糊 | 是否有步骤将多个操作组合成脆弱的序列,而这些操作可自然表达为单个函数? | 将该过程编写为脚本 |
| 严格约定 | 你现在能否为该步骤编写无歧义的 | 适合作为CLI工具 |
| 双重用途潜力 | 用户是否希望在技能工作流之外,从终端运行该步骤? | 从一开始就设计为标准CLI工具 |
| 一致性关键 | 该步骤是否必须为相同输入生成完全一致的输出? | 编写脚本——绝不使用LLM生成 |
对于每个识别出的脚本候选:
- 从中选择原型(初始化/验证/转换/打包/查询)
{baseDir}/references/script-patterns.md - 使用中的Python模板在
{baseDir}/references/script-patterns.md中搭建脚本scripts/ - 在SKILL.md中关联脚本:触发条件、使用工具的精确调用方式、输出解释
exec
关联规则: 脚本引用必须说明何时调用(触发条件)、如何调用(带参数的精确命令)以及如何处理结果(退出码处理、关注哪些输出字段)。
脚本通过工具调用(而非)。使用引用路径。
execBash{baseDir}/scripts/script.pyStep 6 — Check delegation
步骤6——检查委托机制
Read for delegation patterns, usage, cross-skill reference conventions, and tool group translations (Claude Code → OpenClaw tool name mapping).
{baseDir}/references/claw-patterns.mdsessions_spawnScan for existing resources before finalizing:
Review available OpenClaw skills (check ~/.openclaw/skills/ and workspace/skills/)
For each workflow step, ask: "Do we already have this?"Common delegation patterns:
- To invoke another OpenClaw skill: tell the model to read via the
{baseDir}/../<other-skill>/SKILL.mdtool, or instruct the user to typeread/<other-skill-name> - For background delegation: use (non-blocking; result announced back to chat)
sessions_spawn - Documentation lookups:
exec: clawdocs get "<slug>" --no-header -q
There is no tool in OpenClaw — skills are invoked by the routing model, not programmatically from within another skill.
Skill阅读了解委托模式、用法、跨技能引用约定以及工具组转换(Claude Code → OpenClaw工具名称映射)。
{baseDir}/references/claw-patterns.mdsessions_spawn最终确定前扫描现有资源:
查看可用的OpenClaw技能(检查~/.openclaw/skills/和workspace/skills/)
对每个工作流步骤,询问:“我们是否已有这个功能?”常见委托模式:
- 调用另一个OpenClaw技能:告知模型通过工具读取
read,或指导用户输入{baseDir}/../<other-skill>/SKILL.md/<other-skill-name> - 后台委托:使用(非阻塞;结果会返回至聊天)
sessions_spawn - 文档查询:
exec: clawdocs get "<slug>" --no-header -q
OpenClaw中没有工具——技能由路由模型触发,而非从另一个技能中以编程方式调用。
SkillStep 7 — Validate
步骤7——验证
When generating a new skill directory (not editing an existing single file):
bash
python3 {baseDir}/scripts/validate_claw_skill.py <skill-directory> --output jsonExit 0 = proceed to Phase 3. Exit 1 = parse the array; each entry has , , . Resolve all and items before writing to disk.
errorsfieldmessageseveritycriticalmajor生成新技能目录(而非编辑现有单个文件)时:
bash
python3 {baseDir}/scripts/validate_claw_skill.py <skill-directory> --output json返回码0 = 进入阶段3。返回码1 = 解析数组;每个条目包含、、。写入磁盘前解决所有和问题。
errorsfieldmessageseveritycriticalmajorExplain Your Choices
解释你的选择
When presenting the generated skill/command to the user, briefly explain:
- What you set and why — "Added because the skill calls jq in a subprocess"
metadata.openclaw.requires.bins: [jq] - What you excluded and why — "Left at default (true),
user-invocableomitted (skill routes through model)"command-dispatch - Add more trigger phrases if routing misses expected inputs
向用户展示生成的技能/命令时,简要说明:
- 设置内容及原因——“添加是因为技能在子进程中调用jq”
metadata.openclaw.requires.bins: [jq] - 排除内容及原因——“保留默认值(true),省略
user-invocable(技能通过模型路由)”command-dispatch - 若路由遗漏预期输入,添加更多触发短语
Phase 3: Deliver
阶段3:交付
Output Paths
输出路径
| Type | Location | When active |
|---|---|---|
| Workspace skill | | Next session in that workspace |
| Managed skill | | Shared across all agents on this machine |
Skills are session-snapshotted — changes take effect on the next new session, not the current one.
| 类型 | 位置 | 生效时间 |
|---|---|---|
| 工作区技能 | | 该工作区的下一个会话 |
| 托管技能 | | 本机所有Agent共享 |
技能会进行会话快照——更改会在新会话中生效,当前会话不生效。
Write and Confirm
写入并确认
Before writing:
Writing to: [path]
This will [create new / overwrite existing] file.
Proceed?写入前:
写入路径:[path]
这将[创建新文件 / 覆盖现有文件]。
是否继续?After Creation
创建后
Summarize what was created:
- Name and type
- Path and when it takes effect
- How to invoke/trigger
- Suggested test scenario
总结创建内容:
- 名称和类型
- 路径及生效时间
- 调用/触发方式
- 建议测试场景
Publish to ClawHub
发布到ClawHub
Invoke only when the user explicitly requests distribution:
bash
clawhub publish <skill-directory> --slug <slug> --version X.Y.Z --tags latestExit 0 = published. Exit 1 = validation or auth failure; read stdout for details.
仅当用户明确要求分发时执行:
bash
clawhub publish <skill-directory> --slug <slug> --version X.Y.Z --tags latest返回码0 = 发布成功。返回码1 = 验证或认证失败;查看标准输出获取详情。
Phase 4: Evaluate
阶段4:评估
Score the generated skill/command:
| Dimension | Criteria |
|---|---|
| Clarity (0-10) | Instructions unambiguous, objective clear |
| Precision (0-10) | Appropriate specificity without over-constraint |
| Efficiency (0-10) | Token economy — maximum value per token |
| Completeness (0-10) | Covers requirements without gaps or excess |
| Usability (0-10) | Practical, actionable, appropriate for target use |
Target: 9.0/10.0. If below, refine once addressing the weakest dimension, then deliver.
Re-run after any revisions and verify the validation checklist below before finalizing.
validate_claw_skill.py为生成的技能/命令评分:
| 维度 | 标准 |
|---|---|
| 清晰度(0-10) | 指令明确,目标清晰 |
| 精准度(0-10) | 特异性适当,不过度约束 |
| 效率(0-10) | Token经济性——每token价值最大化 |
| 完整性(0-10) | 覆盖需求,无遗漏或冗余 |
| 易用性(0-10) | 实用、可操作,适合目标场景 |
目标:9.0/10.0。若低于该分数,针对最弱维度优化一次后再交付。
任何修订后重新运行,并在最终确定前验证以下检查清单。
validate_claw_skill.pyDegrees of Freedom
自由度等级
| Level | When to Use | Format |
|---|---|---|
| High freedom | Multiple valid approaches, context-dependent decisions | Text instructions, heuristics |
| Medium freedom | Preferred pattern exists, some variation acceptable | Pseudocode, scripts with parameters |
| Low freedom | Fragile operations, consistency critical, specific sequence required | Exact scripts, few parameters |
| 等级 | 使用场景 | 格式 |
|---|---|---|
| 高自由度 | 多种有效方案,需根据上下文决策 | 文本说明、启发式规则 |
| 中自由度 | 存在首选模式,允许一定变化 | 伪代码、带参数的脚本 |
| 低自由度 | 操作脆弱,一致性关键,需要特定序列 | 精确脚本,参数极少 |
Quality Standards
质量标准
Format Economy:
- Simple task → direct instruction, no sections
- Moderate task → light organization with headers
- Complex task → full semantic structure
Remove ruthlessly: Filler phrases, obvious implications, redundant framing, excessive politeness
格式经济性:
- 简单任务 → 直接指令,无章节
- 中等任务 → 轻量组织,带标题
- 复杂任务 → 完整语义结构
果断移除: 填充语、明显隐含信息、冗余框架、过度礼貌用语
Validation Checklist
验证检查清单
Before finalizing an OpenClaw skill or command:
Structure:
- SKILL.md exists with valid YAML frontmatter
- Frontmatter has and
namefieldsdescription - field (if present) is single-line JSON on one line
metadata - Markdown body is present and substantial
- Referenced files actually exist
Description Quality:
- Uses third person ("This skill should be used when...")
- Includes specific trigger phrases users would say (verbatim)
- Trigger phrases derived from user's actual words, not formalized paraphrases
- Under ~400 chars (~100 tokens); 600 chars (~150 tokens) absolute max
- Negative triggers present if adjacent skills could false-trigger
- Lists concrete scenarios ("create X", "configure Y")
- Not vague or generic
OpenClaw Correctness:
- No Claude Code-only fields: no ,
model,context,agent,allowed-tools,hookslicense - No Claude Code tool names referenced in body: no ,
Bash,WebSearch,WebFetch,Read,Write,Edit,Glob,Grep,Task,Skill,AskUserQuestion,EnterPlanModeExitPlanMode - Uses OpenClaw tool names: ,
exec,read,write,edit,web_search,web_fetchsessions_spawn - Uses for skill-relative paths (not
{baseDir})$CLAUDE_PLUGIN_ROOT - Output path is OpenClaw workspace () or managed (
<workspace>/skills/)~/.openclaw/skills/
Content Quality:
- Body uses imperative/infinitive form, not second person
- Body is focused and lean (1,500–2,000 words ideal, <5k max)
- Detailed content moved to
references/ - Scripts are executable and documented
- Script opportunities identified via five signal patterns
- Script references in SKILL.md include trigger condition, invocation (), output handling
exec - Consistency-critical steps are scripted, not left to LLM re-generation
Progressive Disclosure:
- Core concepts in SKILL.md
- Detailed docs in
references/ - Utilities in
scripts/ - SKILL.md references these resources
- present if skill produces user-adaptable output (see
examples/for a minimal command example){baseDir}/examples/sample-command/SKILL.md
最终确定OpenClaw技能或命令前:
结构:
- 存在带有效YAML前置元数据的SKILL.md
- 前置元数据包含和
name字段description - 字段(若存在)为单行JSON
metadata - 存在实质性Markdown技能体
- 引用的文件实际存在
描述质量:
- 使用第三人称(“当...时应使用本技能”)
- 包含用户会使用的具体触发短语(原文)
- 触发短语来自用户实际表述,而非正式改写
- 约400字符/100token以内;绝对上限600字符/150token
- 若相近技能可能误触发,包含否定触发条件
- 列出具体场景(“创建X”、“配置Y”)
- 不模糊或泛化
OpenClaw正确性:
- 无Claude Code专属字段:无、
model、context、agent、allowed-tools、hookslicense - 技能体中无Claude Code工具名称:无、
Bash、WebSearch、WebFetch、Read、Write、Edit、Glob、Grep、Task、Skill、AskUserQuestion、EnterPlanModeExitPlanMode - 使用OpenClaw工具名称:、
exec、read、write、edit、web_search、web_fetchsessions_spawn - 使用作为技能相对路径(而非
{baseDir})$CLAUDE_PLUGIN_ROOT - 输出路径为OpenClaw工作区()或托管目录(
<workspace>/skills/)~/.openclaw/skills/
内容质量:
- 技能体使用祈使/不定式形式,而非第二人称
- 技能体聚焦且精简(理想1500-2000字,上限5000字)
- 详细内容移至
references/ - 脚本可执行且有文档说明
- 通过五种信号模式识别脚本机会
- SKILL.md中的脚本引用包含触发条件、调用方式()、输出处理
exec - 一致性关键步骤已编写脚本,未依赖LLM重新生成
渐进式披露:
- 核心概念在SKILL.md中
- 详细文档在中
references/ - 工具在中
scripts/ - SKILL.md引用这些资源
- 若技能生成用户可适配的输出,提供(参考
examples/获取最小命令示例){baseDir}/examples/sample-command/SKILL.md
Error Handling
错误处理
| Issue | Action |
|---|---|
| Unclear requirements | Ask clarifying questions before generating |
| Missing context | Request usage examples or target scenarios from user |
| Path issues | Verify target directory exists; let |
| Type unclear | Default to skill (auto-triggered) if user hasn't specified |
| Proceed with current references — they are sufficient |
Execute phases sequentially. Always fetch current documentation first.
| 问题 | 操作 |
|---|---|
| 需求不明确 | 生成前询问澄清问题 |
| 上下文缺失 | 请求用户提供使用示例或目标场景 |
| 路径问题 | 验证目标目录是否存在;让 |
| 类型不明确 | 若用户未指定,默认选择技能(自动触发) |
| 基于现有参考文档继续——现有内容已足够 |
按顺序执行各阶段。始终先获取最新文档。