Guided workflow for creating, validating, deploying, and evolving OpenClaw skills. Use when asked to 'create a skill', 'build a SKILL.md', 'develop an agent skill', 'validate skill', 'deploy skill', 'evolve skill', 'improve skill from usage data', 'analyze session logs for skill performance', 'upgrade skills based on usage', 'list skills', 'show installed skills', 'what skills are available', or any skill lifecycle task. Covers: requirements, scaffolding, frontmatter, deployment, session verification, data-driven evolution, and skill inventory.
From openclaw-devnpx claudepluginhub arctrany/openclaw-devThis skill uses the workspace's default tool permissions.
agents/openai.yamlexamples/behavioral-protocol.mdexamples/self-improvement.mdexamples/tool-integration.mdexamples/user-command.mdreferences/advanced-patterns.mdreferences/evolution-advanced-techniques.mdreferences/evolution-analysis-scripts.mdreferences/evolution.mdreferences/frontmatter-reference.mdreferences/list-skills-runbook.mdreferences/quick-reference.mdreferences/real-world-examples.mdreferences/troubleshooting-guide.mdscripts/deploy-skill.shscripts/validate-skill.shscripts/verify-skill-loaded.shSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Follow this process for every OpenClaw skill development task. No shortcuts.
⛔ 铁律: 不可破坏 Memory
- 绝对不能删除、覆盖、截断
memory/目录下的任何文件和MEMORY.md- 只允许 append 操作,不允许 rewrite 或 truncate
- 部署 skill 时
rsync --delete必须排除memory/- 迁移 workspace 时必须完整保留
memory/和MEMORY.md⛔ 铁律: 遇到问题先跑
openclaw doctor
- Skill 不加载、Gateway 不启动、部署失败 — 先运行
openclaw doctor- doctor 会自动检测并修复常见问题,输出结果后再决定下一步
OpenClaw skills are modular capability packages defined by a SKILL.md file. They are loaded into an agent's system prompt to extend its capabilities.
<agent-workspace>/skills/<skill-name>/SKILL.md~/.openclaw/skills/<skill-name>/SKILL.md<openclaw-install>/skills/<skill-name>/SKILL.mdHigher precedence overrides lower. Workspace skills are per-agent (configured via openclaw.json → agents.list[].workspace).
| File | Purpose |
|---|---|
~/.openclaw/openclaw.json | Main config. Agent definitions, workspace paths, models |
<workspace>/skills/*/SKILL.md | Skill definitions |
<workspace>/SOUL.md | Agent personality |
<workspace>/TOOLS.md | Tool usage guidance |
<workspace>/AGENTS.md | Workflow and delegation rules |
<workspace>/MEMORY.md | Persistent memory index |
<workspace>/memory/*.md | Memory entries |
Before writing any code, gather these:
openclaw.json → agents.list)agents.list[].workspace)metadata.clawdbot.always: true) or on-demand (user-invocable / model-triggered)?requires.bins), env vars (requires.env), or config (requires.config)?jq '.agents.list[] | {id, workspace, model}' ~/.openclaw/openclaw.json
skill-name/
├── SKILL.md # Required — YAML frontmatter + markdown instructions
├── scripts/ # Optional — executable code
├── references/ # Optional — docs loaded on-demand
└── assets/ # Optional — files used in output
---
name: skill-name
description: What this skill does and WHEN to use it. This is the primary trigger — be specific and comprehensive.
metadata: {"clawdbot":{"always":false,"emoji":"🔧","requires":{"bins":["jq"]}}}
user-invocable: true
---
# Skill Title
Instructions for the agent...
| Field | Required | Description |
|---|---|---|
name | Yes | Lowercase kebab-case, matches directory name |
description | Yes | Primary trigger mechanism. Include WHAT it does AND WHEN to use it. The body is only loaded after triggering. |
metadata | No | JSON string with OpenClaw-specific config (see below) |
user-invocable | No | true = user can trigger via /skill-name command |
metadata.clawdbot)| Key | Type | Description |
|---|---|---|
always | boolean | Auto-inject into every session's system prompt |
emoji | string | Display emoji for the skill |
skillKey | string | Config key in openclaw.json → skills.entries |
primaryEnv | string | Primary env var (for API key gating) |
os | string[] | OS filter: ["darwin"], ["linux"], etc. |
requires.bins | string[] | ALL listed binaries must exist |
requires.anyBins | string[] | At least ONE listed binary must exist |
requires.env | string[] | Required environment variables |
requires.config | string[] | Required config paths in openclaw.json |
install | array | Auto-install specs (brew/node/go/uv/download) |
Context window is a public good — skills share the prompt with everything else. Keep SKILL.md under 500 lines. Challenge every paragraph: "Does the agent really need this?"
Description is the trigger — the body only loads AFTER triggering. All "when to use" info goes in description, not the body.
Progressive disclosure — Level 1: metadata (~100 words, always loaded). Level 2: SKILL.md body (<5k words, loaded on trigger). Level 3: references/ (unlimited, loaded on demand).
Imperative voice — write instructions in imperative form ("Run X", "Check Y"), not descriptive ("This skill runs X").
No extraneous files — no README.md, CHANGELOG.md, INSTALLATION_GUIDE.md. Only SKILL.md and functional resources.
Zero hardcoding (Organization Iron Law #1) — skills must be portable. Never embed environment-specific values:
| Forbidden | Compliant alternative |
|---|---|
/Users/xxx/, /Volumes/EXT/ | $HOME, task-param $OUTPUT_FILE |
user@gmail.com | $GOOGLE_DRIVE_ACCOUNT from openclaw.env |
127.0.0.1:8045 | read from openclaw.json → models.providers |
sk-abc123... (API keys) | read from secrets/ dir, never in SKILL.md |
model-name-v3 (literal) | resolve via model-routing-governor slot |
PYTHONPATH=/abs/path | $OPENCLAW_PYTHONPATH from openclaw.env |
SSOT for runtime values: ~/.openclaw/openclaw.env (env vars) and ~/.openclaw/openclaw.json (config). Skills read from these; they never redefine them.
WORKSPACE=$(jq -r '.agents.list[] | select(.id=="<agent-id>") | .workspace' ~/.openclaw/openclaw.json)
WORKSPACE=$(eval echo "$WORKSPACE") # expand ~
mkdir -p "$WORKSPACE/skills/<skill-name>"
Follow the format above. Key checks:
name matches directory name exactlydescription is comprehensive (includes triggers/contexts)metadata is valid JSON (use echo '...' | jq . to verify)references/ filesscripts/ — executable code that would be rewritten each timereferences/ — docs the agent reads on demand (keep SKILL.md lean)assets/ — templates, images, files used in outputRun these checks before considering the skill ready:
SKILL_DIR="$WORKSPACE/skills/<skill-name>"
# 1. SKILL.md exists
test -f "$SKILL_DIR/SKILL.md" && echo "OK: SKILL.md exists" || echo "FAIL: Missing SKILL.md"
# 2. Frontmatter has required fields
head -20 "$SKILL_DIR/SKILL.md" | grep -q "^name:" && echo "OK: has name" || echo "FAIL: missing name"
head -20 "$SKILL_DIR/SKILL.md" | grep -q "^description:" && echo "OK: has description" || echo "FAIL: missing description"
# 3. Name matches directory
DIRNAME=$(basename "$SKILL_DIR")
SKILLNAME=$(head -20 "$SKILL_DIR/SKILL.md" | grep "^name:" | sed 's/name: *//')
[ "$DIRNAME" = "$SKILLNAME" ] && echo "OK: name matches dir" || echo "FAIL: name '$SKILLNAME' != dir '$DIRNAME'"
# 4. Metadata JSON is valid (if present)
META=$(head -20 "$SKILL_DIR/SKILL.md" | grep "^metadata:" | sed 's/metadata: *//')
if [ -n "$META" ]; then
echo "$META" | jq . > /dev/null 2>&1 && echo "OK: valid metadata JSON" || echo "FAIL: invalid metadata JSON"
fi
# 5. Line count check
LINES=$(wc -l < "$SKILL_DIR/SKILL.md")
[ "$LINES" -le 500 ] && echo "OK: $LINES lines (under 500)" || echo "WARN: $LINES lines (over 500, consider splitting)"
# 6. Hardcoding compliance check (Organization Iron Law #1)
echo "--- Hardcoding scan ---"
VIOLATIONS=$(grep -nE '/Users/[^$]|/Volumes/EXT|[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}|127\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+|sk-[a-f0-9]{20,}|PYTHONPATH=/' "$SKILL_DIR/SKILL.md" 2>/dev/null)
if [ -z "$VIOLATIONS" ]; then
echo "OK: no hardcoded paths/credentials/IPs found"
else
echo "FAIL: hardcoded values detected — replace with env vars or task params:"
echo "$VIOLATIONS"
fi
# Check required binaries exist
META=$(head -20 "$SKILL_DIR/SKILL.md" | grep "^metadata:" | sed 's/metadata: *//')
if [ -n "$META" ]; then
for bin in $(echo "$META" | jq -r '.clawdbot.requires.bins[]? // empty'); do
which "$bin" > /dev/null 2>&1 && echo "OK: $bin found" || echo "FAIL: $bin not found"
done
fi
The skill is already in the workspace directory. No copy needed. But the agent needs a new session to pick it up.
# Only needed if openclaw.json was modified (e.g., workspace path changed)
pkill -TERM openclaw-gateway
sleep 3
# Gateway should auto-restart via launchd/systemd. If not:
# openclaw-gateway &
Send /new to the agent via its messaging platform (Telegram, Discord, etc.). This creates a fresh session that re-resolves skills from the workspace.
# Check session snapshot includes the new skill
AGENT_ID="<agent-id>"
cat ~/.openclaw/agents/$AGENT_ID/sessions/sessions.json | python3 -c "
import sys, json
data = json.load(sys.stdin)
session = data.get('agent:${AGENT_ID}:main', {})
prompt = session.get('skillsSnapshot', {}).get('prompt', '')
skill = '<skill-name>'
if skill in prompt:
print(f'FOUND: {skill} loaded in session')
else:
print(f'NOT FOUND: {skill} — check workspace path and gateway')
"
# Check the latest session log for skill awareness
LATEST=$(ls -t ~/.openclaw/agents/$AGENT_ID/sessions/*.jsonl | head -1)
tail -5 "$LATEST" | python3 -c "
import sys, json
for line in sys.stdin:
try:
obj = json.loads(line.strip())
role = obj.get('message', {}).get('role', '')
if role == 'assistant':
content = obj.get('message', {}).get('content', '')
if isinstance(content, list):
for c in content:
if c.get('type') == 'text':
print(c['text'][:300])
elif isinstance(content, str):
print(content[:300])
except: pass
"
| Pitfall | Symptom | Fix |
|---|---|---|
| Skill in wrong directory | Not loaded in session | Verify agent's workspace in openclaw.json, put skill in <workspace>/skills/ |
| Skill in shared workspace | Affects all agents | Use per-agent workspace via agents.list[].workspace |
| Gateway not restarted | Old session, old skills | pkill -TERM openclaw-gateway, wait for auto-restart |
| Session not refreshed | Skills in config but not in prompt | Send /new to agent to create fresh session |
metadata not valid JSON | Skill loads but flags ignored | Test with echo '<metadata>' | jq . |
| Description too vague | Skill never triggers | Include specific trigger phrases and contexts |
| Body too long | Context bloat | Move details to references/ files, keep body < 500 lines |
always: true on optional skill | Wastes context every session | Only use always for core behavioral skills |
| No dependency check | Skill fails at runtime | Use requires.bins / requires.anyBins in metadata |
| Memory files not preserved | Agent loses history during migration | Always copy memory/ and MEMORY.md when migrating workspaces |
| Hardcoded paths/emails/keys | Skill breaks on different machine or account | Use $HOME, $GOOGLE_DRIVE_ACCOUNT, $OPENCLAW_PYTHONPATH from openclaw.env; read model names from openclaw.json |
| API key in SKILL.md plaintext | Credential leak (CRITICAL) | Read from secrets/ dir via task param; never write into skill files |
| Lab path in production skill | Couples production to dev environment | Production skills (~/.openclaw/workspace-*/) must not reference /Volumes/EXT/openclaw-god/ or similar lab paths |
Skills that define HOW the agent works. Examples: task execution protocol, communication standards.
always: true — always in system promptuser-invocable — not triggered manuallySkills that teach the agent to use a specific tool. Examples: coding-agent, oracle, email.
always: false — loaded only when relevantdescription with trigger phrasesSkills triggered by user via slash command. Examples: /insights, /deploy.
user-invocable: trueSkills that analyze and optimize the agent. Examples: self-evolve, session analytics.
always: true (for heartbeat mode) and user-invocable: true (for deep mode)~/.openclaw/agents/<id>/sessions/*.jsonlmemory/ directoryThis skill now includes comprehensive supporting resources for progressive disclosure:
scripts/)Validation and deployment utilities (all support local and remote agents):
scripts/validate-skill.sh - Validate skill structure and metadata
# Local validation
./scripts/validate-skill.sh /path/to/skill-name
# Validate in agent workspace
./scripts/validate-skill.sh -a momiji skill-name
# Validate on remote agent
./scripts/validate-skill.sh -r user@remote-host -a momiji skill-name
scripts/deploy-skill.sh - Deploy skill to local or remote agent
# Deploy locally
./scripts/deploy-skill.sh ./my-skill momiji
# Deploy to remote agent (rsync)
./scripts/deploy-skill.sh -r user@remote-host ./my-skill momiji
# Deploy to remote agent (git)
./scripts/deploy-skill.sh -m git -r user@remote-host my-skill momiji
scripts/verify-skill-loaded.sh - Verify skill loaded in agent session
# Verify local agent
./scripts/verify-skill-loaded.sh -a momiji skill-name
# Verify remote agent
./scripts/verify-skill-loaded.sh -r user@remote-host -a momiji skill-name
Key features:
references/)Detailed guides for progressive disclosure (load when needed):
references/advanced-patterns.md - Advanced skill development patterns
references/troubleshooting-guide.md - Common issues and solutions
references/real-world-examples.md - Production skill examples
examples/)Complete, copy-paste skill templates:
examples/behavioral-protocol.md - Category A: Always-on behavioral skill
examples/tool-integration.md - Category B: Tool integration skill
examples/user-command.md - Category C: User-invocable command
examples/self-improvement.md - Category D: Self-improvement skill
For comprehensive quick reference including:
Read: references/quick-reference.md
For detailed patterns and techniques, consult the reference files and examples above.
需要查看当前已安装的所有 skill(workspace 级 + managed 级 + bundled 级)时,读取 references/list-skills-runbook.md。