A comprehensive guide to creating Skills for ClawHub and OpenClaw.
一份完整的 Skill 开发教程,适用于 ClawHub 和 OpenClaw 平台。
A Skill is a reusable prompt template that extends AI capabilities. Every Skill needs a SKILL.md file.
Skill 是一个可复用的提示词模板,用于扩展 AI 能力。每个 Skill 都需要一个 SKILL.md 文件。
markdown
# My Skill Name
Short description of what this skill does.
---
instructions: |
You are a helpful assistant that...
## Your Task
1. Step one
2. Step two
The instructions field defines AI behavior:
yaml
instructions: |
You are an expert at [task].
## Guidelines
- Be concise
- Focus on accuracy
Tips / 提示:
Add automation with bash scripts:
yaml
scripts:
- name: validate
description: Validate input data
command: ./scripts/validate.sh
Security Rules / 安全规则:
set -a (exports all variables) / 禁止使用 set -aDeclare which commands your skill needs:
yaml
allowed_commands:
- curl
- jq
- node
Do / 推荐Don't / 避免Explicit variable exportsset -a or export *Documented API callsHidden external requestsClear script descriptionsVague or missing descriptionsUser-facing outputsSilent background operations
See examples/minimal.md for a starter template.
See examples/with-script.md for automation patterns.
For a complete MCP + Skill implementation example, check out:
IssueSolutionSkill not foundCheck file is named SKILL.md (case-sensitive)Script permission deniedAdd chmod +x to your scriptSecurity scan failedReview scripts for set -a, hardcoded secretsInstructions too longBreak into sections, use bullet points
Q: How do I test my skill locally?
A: Use the ClawHub CLI or import directly in OpenClaw.
Q: Can I use external APIs?
A: Yes, but document them clearly in your skill description.
Q: Where can I get help?
A: Open an issue for discussion and questions:
Created by @CCCpan
Found this helpful? Star the repo or open an issue to share your feedback!