Skill Creator
Build, refine, and publish OpenClaw skills. Supports six modes.
Modes at a Glance
| Mode | When to Use | Output |
|---|
| Create | New skill from scratch | INLINECODE0 + resources |
| Eval |
Measure skill quality | Run report + pass/fail |
|
Improve | Iterate an existing skill | New version with changelog |
|
Benchmark | Compare two skill versions | Winner + delta analysis |
|
Analyze | Extract reusable patterns |
patterns.md report |
|
Synthesize | Build skill from patterns | Scaffolded
SKILL.md |
Mode 1: Create
Build a skill from scratch in 6 steps.
Step 1 — Understand
Clarify before writing a single line:
- - What does this skill do that no existing skill does?
- Who triggers it and when? (the
description field drives triggering) - What CLI tools, APIs, or files does it need?
- What's the output format?
Run scripts/analyze_patterns.py --query "<skill concept>" to see if relevant patterns already exist.
Step 2 — Plan
Write a one-paragraph spec covering: trigger conditions, happy path, error cases, output format. Confirm with user if uncertain.
Step 3 — Init
Scripts are bundled in scripts/ — no external path needed:
CODEBLOCK0
Or locate the skill dir and use relative path:
CODEBLOCK1
This creates:
CODEBLOCK2
Step 4 — Write SKILL.md
Frontmatter rules:
CODEBLOCK3
Body structure:
CODEBLOCK4
Progressive disclosure rules:
- - Frontmatter: always loaded (~100 words) — make it count
- Body: loaded on trigger (<500 lines) — stay under limit
- Bundled resources: loaded on demand — put verbosity here
Step 5 — Package
# package_skill.py is bundled in this skill's scripts/ directory:
SKILL_SCRIPTS="$(dirname "$(find ~/.openclaw/workspace/skills/skill-creator ~/.nvm -name "package_skill.py" 2>/dev/null | head -1)")"
python3 "$SKILL_SCRIPTS/package_skill.py" ~/.openclaw/workspace/skills/<skill-name>
Validates structure, outputs
<skill-name>.skill zip.
Step 6 — Iterate
Run evals (Mode 2) → identify failures → update SKILL.md → re-package → repeat.
Mode 2: Eval
Measure skill quality against defined expectations.
Setup
Create
evals/evals.json:
CODEBLOCK6
Eval Run
For each eval case:
- 1. Execute the prompt using current skill
- Grade against
assertions (pass/fail per assertion) - Log result to INLINECODE9
Run Report Format
{
"skill": "skill-creator",
"version": "1.0.0",
"timestamp": "2026-02-22T03:00:00Z",
"pass_rate": 0.85,
"cases": [
{ "id": "basic-create", "passed": true, "assertions_passed": 3, "assertions_total": 3 }
]
}
Mode 3: Improve
Iterate on an existing skill using eval feedback.
Improvement Loop
CODEBLOCK8
history.json
Track all versions at
evals/history.json:
[
{
"version": "1.0.0",
"parent": null,
"expectation_pass_rate": 0.70,
"is_current_best": false,
"notes": "Initial version"
},
{
"version": "1.1.0",
"parent": "1.0.0",
"expectation_pass_rate": 0.85,
"is_current_best": true,
"notes": "Improved trigger description, added Synthesize mode"
}
]
Mode 4: Benchmark
Blind A/B comparison of two skill versions.
Process
- 1. Run identical eval suite against version A and version B
- Collect raw outputs without labels
- Compare blind (no version labels) → pick winner per case
- Reveal versions, compute delta
- Recommend: keep A, adopt B, or cherry-pick specific cases
Benchmark Output
Version A: 1.0.0 pass_rate=0.70
Version B: 1.1.0 pass_rate=0.85
Delta: +0.15 (B wins)
Regressions: 0
Recommendation: Adopt B
Mode 5: Analyze Patterns
Scan installed skills to extract reusable building blocks.
CODEBLOCK11
What it extracts:
- - Trigger phrases — common description keywords that activate skills
- Tool patterns — CLI tools, APIs, Docker patterns used across skills
- Output formats — JSON schemas, markdown templates, log formats
- Structural patterns — how skills organize commands/recipes
- Error handling patterns — retry logic, circuit breakers, fallbacks
See references/patterns.md for the current extracted pattern library.
Mode 6: Synthesize from Patterns
Build a new skill scaffold by combining patterns from the library.
Usage
When asked to create a skill in a domain that resembles existing skills:
- 1. Run
Analyze Patterns first - Query
references/patterns.md for relevant patterns - Compose a SKILL.md that combines:
- Best trigger phrases from similar skills
- Relevant tool/API patterns
- Appropriate output format
- Error handling from most robust similar skill
Example
"Create a skill for Twitter scraping":
- - Pull trigger phrases from INLINECODE14
- Pull CDP/browser patterns from INLINECODE15
- Pull output format (JSON array) from INLINECODE16
- Synthesize into INLINECODE17
Skill Anatomy Quick Reference
CODEBLOCK12
_meta.json template:
{
"ownerId": "",
"slug": "skill-name",
"version": "1.0.0",
"publishedAt": null
}
Publishing to OpenClaw Community
Registry: clawhub.com — use the clawhub CLI (already installed).
CODEBLOCK14
- 1. Ensure
_meta.json has correct slug and INLINECODE21 - Run full eval suite — pass rate must be ≥ 0.80
- INLINECODE22 (one-time browser auth)
- INLINECODE23
- Verify at clawhub.com/skills/
Quality bar for publishing:
- - [ ] Description triggers correctly (test with 3+ natural phrasings)
- [ ] At least 3 concrete command examples with real output
- [ ] Error cases documented
- [ ] Eval pass rate ≥ 0.80
- [ ]
_meta.json complete
技能创建器
构建、优化并发布OpenClaw技能。支持六种模式。
模式概览
| 模式 | 使用场景 | 输出 |
|---|
| 创建 | 从零开始创建新技能 | <名称>/SKILL.md + 资源文件 |
| 评估 |
衡量技能质量 | 运行报告 + 通过/失败 |
|
改进 | 迭代现有技能 | 带变更日志的新版本 |
|
基准测试 | 比较两个技能版本 | 胜出者 + 差异分析 |
|
分析 | 提取可复用模式 | patterns.md 报告 |
|
综合 | 从模式构建技能 | 骨架化的 SKILL.md |
模式1:创建
通过6个步骤从零开始构建技能。
步骤1 — 理解
在编写任何代码前明确以下问题:
- - 该技能能完成哪些现有技能无法完成的任务?
- 谁在何时触发它?(description 字段驱动触发)
- 它需要哪些CLI工具、API或文件?
- 输出格式是什么?
运行 scripts/analyze_patterns.py --query <技能概念> 查看是否已存在相关模式。
步骤2 — 规划
编写一段规格说明,涵盖:触发条件、正常流程、错误情况、输出格式。如有疑问,与用户确认。
步骤3 — 初始化
脚本打包在 scripts/ 目录中 — 无需外部路径:
bash
从工作区技能目录执行:
python3 $(openclaw skills info skill-creator --json 2>/dev/null | python3 -c import json,sys; print(json.load(sys.stdin).get(path,)))/scripts/init_skill.py \
<技能名称> \
--path ~/.openclaw/workspace/skills/ \
--resources scripts,references \
--examples
或定位技能目录并使用相对路径:
bash
SKILLDIR=$(dirname $(find ~/.openclaw/workspace/skills ~/.nvm -name initskill.py 2>/dev/null | head -1))
python3 $SKILLDIR/initskill.py <技能名称> --path ~/.openclaw/workspace/skills/ --resources scripts,references
这将创建:
<技能名称>/
SKILL.md # 编辑此文件
scripts/ # 辅助脚本
references/ # 参考文档、速查表
_meta.json # 发布时自动填充
步骤4 — 编写SKILL.md
前置元数据规则:
yaml
name: my-skill-name # 小写-连字符格式,最多64个字符
description: 一句话:描述功能及使用时机。包含触发短语。
正文结构:
markdown
技能标题
简要一句话说明。
快速开始
[最常见的用法 — 最多3-5行]
命令/配方
[带实际输出的具体示例]
参考
[完整选项表、边界情况、高级用法]
渐进式信息揭示规则:
- - 前置元数据:始终加载(约100词)— 确保内容精炼
- 正文:触发时加载(少于500行)— 保持在限制内
- 打包资源:按需加载 — 将详细内容放在此处
步骤5 — 打包
bash
package_skill.py 打包在此技能的 scripts/ 目录中:
SKILL
SCRIPTS=$(dirname $(find ~/.openclaw/workspace/skills/skill-creator ~/.nvm -name packageskill.py 2>/dev/null | head -1))
python3 $SKILL
SCRIPTS/packageskill.py ~/.openclaw/workspace/skills/<技能名称>
验证结构,输出 <技能名称>.skill zip文件。
步骤6 — 迭代
运行评估(模式2)→ 识别失败项 → 更新SKILL.md → 重新打包 → 重复。
模式2:评估
根据定义的预期衡量技能质量。
设置
创建 evals/evals.json:
json
[
{
id: basic-create,
prompt: 创建一个发送Slack消息的技能,
expected_output: 包含slack-notifier名称和可用命令的SKILL.md,
assertions: [
包含带有名称和描述的前置元数据,
包含至少一个bash命令示例,
描述中包含触发短语
]
}
]
评估运行
对每个评估案例:
- 1. 使用当前技能执行提示
- 根据assertions评分(每个断言通过/失败)
- 将结果记录到 evals/runs/<时间戳>.json
运行报告格式
json
{
skill: skill-creator,
version: 1.0.0,
timestamp: 2026-02-22T03:00:00Z,
pass_rate: 0.85,
cases: [
{ id: basic-create, passed: true, assertions
passed: 3, assertionstotal: 3 }
]
}
模式3:改进
使用评估反馈迭代现有技能。
改进循环
- 1. 运行评估 → 识别失败的断言
- 读取当前SKILL.md
- 起草针对失败项的修改
- 编写新版本(在_meta.json中递增语义版本号)
- 重新运行评估 → 确认通过率提升
- 更新history.json
history.json
在 evals/history.json 中追踪所有版本:
json
[
{
version: 1.0.0,
parent: null,
expectation
passrate: 0.70,
is
currentbest: false,
notes: 初始版本
},
{
version: 1.1.0,
parent: 1.0.0,
expectation
passrate: 0.85,
is
currentbest: true,
notes: 改进了触发描述,添加了综合模式
}
]
模式4:基准测试
两个技能版本的盲测A/B比较。
流程
- 1. 对版本A和版本B运行相同的评估套件
- 收集不带标签的原始输出
- 盲测比较(无版本标签)→ 每个案例选出胜出者
- 揭示版本,计算差异
- 建议:保留A、采用B或精选特定案例
基准测试输出
版本A: 1.0.0 pass_rate=0.70
版本B: 1.1.0 pass_rate=0.85
差异: +0.15 (B胜出)
回归: 0
建议: 采用B
模式5:分析模式
扫描已安装的技能以提取可复用的构建块。
bash
python3 ~/.openclaw/workspace/skills/skill-creator/scripts/analyze_patterns.py \
--scan-dirs ~/.openclaw/workspace/skills/,~/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/skills/ \
--output ~/.openclaw/workspace/skills/skill-creator/references/patterns.md
提取的内容:
- - 触发短语 — 激活技能的常见描述关键词
- 工具模式 — 跨技能使用的CLI工具、API、Docker模式
- 输出格式 — JSON模式、Markdown模板、日志格式
- 结构模式 — 技能如何组织命令/配方
- 错误处理模式 — 重试逻辑、断路器、回退方案
参见 references/patterns.md 获取当前提取的模式库。
模式6:从模式综合
通过组合模式库中的模式构建新的技能骨架。
用法
当被要求在与现有技能相似的领域创建技能时:
- 1. 首先运行分析模式
- 查询 references/patterns.md 获取相关模式
- 组合成一个SKILL.md,包含:
- 来自类似技能的最佳触发短语
- 相关的工具/API模式
- 适当的输出格式
- 来自最健壮类似技能的错误处理
示例
创建一个用于Twitter抓取的技能:
- - 从 reddit-scraper 提取触发短语
- 从 fast-browser-use 提取CDP/浏览器模式
- 从 crypto-market-data 提取输出格式(JSON数组)
- 综合成 twitter-scraper/SKILL.md
技能结构快速参考
<技能名称>/
SKILL.md # 必需:前置元数据 + 正文
scripts/ # 辅助Python/bash脚本
references/