Clawhub Skill Creator
Complete guide for creating skills compatible with clawhub registry and optimized for AI agent usage.
Language Rule
Skill description must be in English, unless context requires otherwise (examples, comments, etc. may use other languages when appropriate).
- -
description in frontmatter: English only - SKILL.md body: English preferred
- Examples, code comments: Any language as needed
- References: Any language as appropriate for domain
Quick Start
Create New Skill
CODEBLOCK0
Skill Creation Workflow
Phase 1: Understand Requirements
Before writing any code, clarify:
- 1. What problem does this skill solve?
- Concrete use cases (2-3 examples)
- Target queries that should trigger skill
- 2. Who will use this skill?
- AI agents (primary audience for clawhub)
- Expected context (tools available, environment)
- 3. What resources are needed?
- References for detailed docs?
- Assets for templates?
- Scripts for automation?
Output: Clear understanding of skill scope and triggers.
Phase 2: Plan Structure
Choose pattern based on complexity:
| Complexity | Structure | When to Use |
|---|
| Simple | SKILL.md only | <100 lines, single purpose |
| Medium |
+ references/ | 100-300 lines, some details |
| Complex | + references/ + assets/ | >300 lines, multi-domain |
Decide on resources:
- - Which references needed? (docs, examples, patterns)
- Which assets needed? (templates, configs)
- Which scripts needed? (validation, packaging)
Output: Directory structure and resource list.
Phase 3: Initialize Structure
CODEBLOCK1
Required files for clawhub:
CODEBLOCK2
Phase 4: Write SKILL.md
Frontmatter (YAML)
CODEBLOCK3
Critical rules:
- -
name must match directory name - INLINECODE2 is ONLY trigger mechanism — include all "when to use" here
- INLINECODE3 must be in English
- Only
name and description are required in frontmatter
Body Structure
CODEBLOCK4 bash
command --option
**Windows CMD:**
cmd
command --option
**PowerShell:**
powershell
command --option
CODEBLOCK7
Writing guidelines:
- - Imperative voice ("Open file", not "You should open file")
- Concrete examples over abstract explanations
- Platform-aware commands
- Navigation to references
- English preferred for body text
Phase 5: Create _meta.json
CODEBLOCK8
Fields explained:
- -
name: Must match directory and SKILL.md frontmatter - INLINECODE7 : Semver (X.Y.Z), check registry before setting
- INLINECODE8 : For registry listing, must be in English
- INLINECODE9 : Environment variables needed
- INLINECODE10 : Credentials needed
- INLINECODE11 : Include "latest" for discoverability
Phase 6: Add LICENSE.txt
Choose license (MIT recommended):
CODEBLOCK9
Phase 7: Write References (if needed)
Create files in references/:
CODEBLOCK10
Guidelines:
- - One topic per file
- <5K words per file
- Link from SKILL.md with clear context
- No deeply nested references
- Language: English preferred, domain-specific allowed
Phase 8: Validate Locally
CODEBLOCK11
Validation checklist:
- - [ ] Directory name matches
name in frontmatter and meta.json - [ ]
description in English, includes "Use when:" triggers - [ ] SKILL.md < 300 lines
- [ ] meta.json valid JSON
- [ ] No extraneous files (README, CHANGELOG)
- [ ] References exist and linked
- [ ] Token estimate < 10K
Phase 9: Test with Agent
Trigger test:
- - Does skill activate for intended queries?
- Does description correctly trigger skill?
Workflow test:
- - Can agent follow steps without clarification?
- Are commands clear and executable?
Resource test:
- - Are references loaded at appropriate time?
- Is navigation clear?
Edge case test:
- - How does skill handle errors?
- Are platform differences handled?
Phase 10: Iterate (if needed)
If tests reveal issues:
- 1. Identify problem
- Trigger not working? → Fix description
- Workflow unclear? → Rewrite steps
- Missing info? → Add reference
- 2. Update files
- SKILL.md, _meta.json, or references
- 3. Re-validate and re-test
- Go back to Phase 8
- 4. Repeat until satisfied
Iterate cycle: Phase 8 → Phase 9 → Phase 10 (loop) → Phase 11
Phase 11: Check Version
Before publishing, verify current registry version:
CODEBLOCK12
Update _meta.json with correct version:
CODEBLOCK13
Phase 12: Package
CODEBLOCK14
Package contains:
- - All skill files
- Validated structure
- Ready for distribution
Phase 13: Publish
CODEBLOCK15
After publish:
- - Skill available in registry
- Others can install via INLINECODE15
Required Files for Clawhub
SKILL.md
Instructions and metadata:
- - YAML frontmatter (name, description in English)
- Markdown body (workflow, examples)
- Navigation to references
_meta.json
Registry metadata:
CODEBLOCK16
LICENSE.txt
License file (MIT, Apache-2.0, etc.)
Resources
- -
references/skill-structure.md - Directory structure patterns - INLINECODE17 - Designing for AI vs humans
- INLINECODE18 - Minimizing context usage
- INLINECODE19 - Platform-aware scripts
- INLINECODE20 - Pre-publish checks
- INLINECODE21 - Semver best practices
Key Principles
1. Agent-First Design
Skills used by AI agents, not humans:
- - ❌ No interactive prompts
- ❌ No platform-specific scripts (use knowledge instead)
- ✅ Command templates for all platforms
- ✅ Clear navigation to references
2. Progressive Disclosure
CODEBLOCK17
3. Token Budget
| Component | Target | Max |
|---|
| Metadata | 50 words | 100 words |
| SKILL.md |
200 lines | 300 lines |
| References | 3K words | 5K words |
| Total | 5K tokens | 10K tokens |
4. Cross-Platform Awareness
Instead of script:
## Commands
**Linux/Mac:**
bash
command --option
**Windows CMD:**
cmd
command --option
**PowerShell:**
powershell
command --option
CODEBLOCK21
Agent chooses appropriate variant based on detected platform.
5. English Language for Descriptions
Required in English:
- -
description in SKILL.md frontmatter - INLINECODE23 in _meta.json
- Main workflow instructions
May use other languages:
- - Code examples
- Comments
- Domain-specific references
- User-facing examples
Scripts
- -
scripts/init-skill.sh - Initialize new skill structure - INLINECODE25 - Package skill for distribution
- INLINECODE26 - Validate skill structure
Anti-Patterns
❌ Don't:
- - Put "When to use" only in body (must be in description)
- Use non-English description in frontmatter
- Duplicate info between SKILL.md and references
- Create README.md, CHANGELOG.md (clutter)
- Use platform-specific scripts (sh/bat)
- Write passive voice ("You should")
- Include generic background theory
- Skip validation before publish
- Forget to bump version
- Publish without testing
✅ Do:
- - Write description in English
- Start with concrete examples
- Move details to references/
- Use imperative voice ("Do X")
- Challenge every sentence's value
- Test with real agent queries
- Validate before publish
- Follow semver strictly
- Iterate based on test results
Clawhub 技能创建器
创建与 clawhub 注册表兼容并针对 AI 代理使用进行优化的技能的完整指南。
语言规则
技能描述必须使用英文,除非上下文另有要求(示例、注释等可在适当时使用其他语言)。
- - 前置元数据中的 description:仅限英文
- SKILL.md 正文:首选英文
- 示例、代码注释:根据需要可使用任何语言
- 参考资料:根据领域需要可使用任何语言
快速入门
创建新技能
bash
运行初始化器
./scripts/init-skill.sh my-skill
或手动创建结构
mkdir -p my-skill/{references,scripts,assets}
touch my-skill/SKILL.md my-skill/_meta.json my-skill/LICENSE.txt
技能创建工作流
阶段 1:理解需求
在编写任何代码之前,明确以下内容:
- 1. 此技能解决什么问题?
- 具体用例(2-3 个示例)
- 应触发技能的目标查询
- 2. 谁将使用此技能?
- AI 代理(clawhub 的主要受众)
- 预期上下文(可用工具、环境)
- 3. 需要哪些资源?
- 详细文档的参考资料?
- 模板的资产?
- 自动化的脚本?
输出: 清晰理解技能范围和触发条件。
阶段 2:规划结构
根据复杂度选择模式:
| 复杂度 | 结构 | 使用时机 |
|---|
| 简单 | 仅 SKILL.md | <100 行,单一用途 |
| 中等 |
+ references/ | 100-300 行,包含一些细节 |
| 复杂 | + references/ + assets/ | >300 行,多领域 |
决定资源:
- - 需要哪些参考资料?(文档、示例、模式)
- 需要哪些资产?(模板、配置)
- 需要哪些脚本?(验证、打包)
输出: 目录结构和资源列表。
阶段 3:初始化结构
bash
创建目录
mkdir -p my-skill/{references,scripts,assets}
创建必需文件
touch my-skill/SKILL.md
touch my-skill/_meta.json
touch my-skill/LICENSE.txt
clawhub 的必需文件:
my-skill/
├── SKILL.md # 指令和元数据(必需)
├── _meta.json # 注册表元数据(必需)
├── LICENSE.txt # 许可证文件(必需)
├── references/ # 可选:详细文档
├── scripts/ # 可选:自动化脚本
└── assets/ # 可选:模板、资源
阶段 4:编写 SKILL.md
前置元数据(YAML)
yaml
name: skill-name
description: 功能描述。使用时机:(1) 触发条件-1,(2) 触发条件-2,(3) 触发条件-3。
关键规则:
- - name 必须与目录名称匹配
- description 仅是触发机制——在此包含所有使用时机
- description 必须使用英文
- 前置元数据中仅 name 和 description 为必需
正文结构
markdown
技能标题
简要目的(1-2 句)。
快速入门
Linux/Mac:
bash
command --option
Windows CMD:
cmd
command --option
PowerShell:
powershell
command --option
使用时机
- - 情况 1:执行什么操作
- 情况 2:执行什么操作
- 情况 3:执行什么操作
工作流
- 1. 步骤一:描述
- 步骤二:描述
- 步骤三:描述
资源
- - references/advanced.md - 复杂情况
- references/examples.md - 使用示例
- assets/template.txt - 起始模板
编写指南:
- - 祈使语气(打开文件,而非您应该打开文件)
- 具体示例优于抽象解释
- 平台感知命令
- 导航至参考资料
- 正文首选英文
阶段 5:创建 _meta.json
json
{
name: skill-name,
version: 1.0.0,
description: 注册表列表的简短描述,
requires: {
env: [ENVVAR1, ENVVAR2],
credentials: [credential_name]
},
tags: [tag1, tag2, latest]
}
字段说明:
- - name:必须与目录和 SKILL.md 前置元数据匹配
- version:语义化版本(X.Y.Z),设置前检查注册表
- description:用于注册表列表,必须使用英文
- requires.env:所需环境变量
- requires.credentials:所需凭据
- tags:包含latest以提高可发现性
阶段 6:添加 LICENSE.txt
选择许可证(推荐 MIT):
MIT License
Copyright (c) 2025 [作者]
特此授予许可...
阶段 7:编写参考资料(如需要)
在 references/ 中创建文件:
markdown
参考标题
此处为详细文档。
章节
内容...
指南:
- - 每个文件一个主题
- 每个文件 <5K 字
- 从 SKILL.md 链接并附清晰上下文
- 无深层嵌套的参考资料
- 语言:首选英文,允许领域特定语言
阶段 8:本地验证
bash
检查结构
./scripts/validate.sh my-skill
或手动检查:
- SKILL.md 存在且包含前置元数据
- _meta.json 为有效 JSON
- LICENSE.txt 存在
- 无 README.md、CHANGELOG.md
- 行数 < 300
- 参考资料正确链接
验证清单:
- - [ ] 目录名称与前置元数据和 meta.json 中的 name 匹配
- [ ] description 为英文,包含使用时机:触发条件
- [ ] SKILL.md < 300 行
- [ ] meta.json 为有效 JSON
- [ ] 无多余文件(README、CHANGELOG)
- [ ] 参考资料存在并已链接
- [ ] Token 估算 < 10K
阶段 9:使用代理测试
触发测试:
- - 技能是否对预期查询激活?
- 描述是否正确触发技能?
工作流测试:
- - 代理能否无需澄清即可遵循步骤?
- 命令是否清晰且可执行?
资源测试:
边缘情况测试:
阶段 10:迭代(如需要)
如果测试发现问题:
- 1. 识别问题
- 触发不工作?→ 修复描述
- 工作流不清晰?→ 重写步骤
- 缺少信息?→ 添加参考资料
- 2. 更新文件
- SKILL.md、_meta.json 或参考资料
- 3. 重新验证和测试
- 返回阶段 8
- 4. 重复直至满意
迭代周期: 阶段 8 → 阶段 9 → 阶段 10(循环)→ 阶段 11
阶段 11:检查版本
发布前,验证当前注册表版本:
bash
检查当前注册表版本
clawhub inspect skill-name --json | grep version
确保新版本遵循语义化版本:
1.0.0 → 1.0.1(补丁:错误修复)
1.0.0 → 1.1.0(次要:新功能)
1.0.0 → 2.0.0(主要:破坏性变更)
绝不降级!(1.1.0 → 1.0.2 是错误的)
使用正确版本更新 _meta.json:
json
{
version: 1.0.1
}
阶段 12:打包
bash
创建 .skill 包用于分发
./scripts/package-skill.sh my-skill ./dist
输出:dist/my-skill.skill
打包前验证结构
包包含:
阶段 13:发布
bash
cd my-skill
发布到 clawhub
clawhub publish . --version 1.0.1 --changelog 变更描述
验证发布
clawhub inspect skill-name
发布