clawhub-skill-creator
Scaffold and publish ClawhHub-ready OpenClaw skills. Follow every rule below. Do not skip sections. Do not invent conventions not listed here.
Ask the user for the skill name and purpose if not already provided, then generate the files.
Structure
Generate two files only — no README.md, no CHANGELOG.md, no auxiliary docs:
CODEBLOCK0
Understanding the ClawhHub Scanner
The scanner is the gatekeeper between publishing and availability. Know how it works before writing a single line:
1. The description summary is the ONLY thing the scanner trusts at the registry level.
_meta.json fields (requiredConfigPaths, primaryCredential, requires) are stored but NOT surfaced in the registry API. The scanner cannot read them. Everything the scanner needs to verify must be in the description — and in the FIRST ~160 characters, because that is where the registry truncates the summary.
2. The scanner is iterative — it reveals one layer at a time.
Each fix exposes the next issue. It will not give you all problems at once. Expect multiple publish cycles. This is by design — it is a progressive trust gate.
3. The scanner cannot verify nested content.
A worker script embedded inside a here-string inside a code block will be marked as truncated and unverifiable. All content the scanner needs to read must be flat and standalone.
4. The scanner is semantic, not keyword-based.
It understands the difference between what is logged vs transmitted, always:true vs always:false, handle vs userId, and required vs optional credentials. It catches logical inconsistencies, not just missing keywords.
5. The scanner is conservative by default.
It blocks and warns rather than approves. Every publish triggers a new scan. Do not publish until the checklist passes — each rejected version counts against the skill's history.
Known OpenClaw Parser Gotchas (learned from real failures)
These will silently break skill detection — no error, skill just disappears from openclaw skills list:
- - Missing closing
--- in frontmatter: If the frontmatter block is not closed with ---, OpenClaw silently fails to parse the skill entirely. Always verify the closing delimiter exists.
- -
openclaw in metadata.openclaw.requires.bins: OpenClaw does not recognize itself as a bin to check and silently hides the skill. Never put openclaw in bins. Use anyBins: ["powershell","pwsh"] for OS gating — the openclaw runtime is implied.
- - Skills in
~/.openclaw/skills/ not auto-detected: OpenClaw scans <workspace>/skills/ by default. For skills in ~/.openclaw/skills/, add skills.load.extraDirs: ["~/.openclaw/skills"] to openclaw.json. Also add skills.entries.<name>.enabled: true for each skill.
- -
clawhub install path: By default installs into ./skills (cwd) or <workspace>/skills. Always pass --workdir explicitly or install directly to ~/.openclaw/skills/ and add extraDirs.
- - Encoding: Always write SKILL.md with
[System.Text.UTF8Encoding]::new($false) (no BOM). BOM or encoding artifacts in frontmatter break the YAML parser silently.
ClawhHub Scanner Criteria
Address all five explicitly — in the description first, then in the body.
1. Purpose & Capability
- - State exactly what APIs/services are called (e.g. "graph.facebook.com only")
- State what the skill does NOT do ("no data forwarded to third parties")
- If background process: state exactly what is READ, what is TRANSMITTED, what is LOGGED
- If long-lived tokens: state rotation guidance + immediate rotation if host is compromised
- If setup-only secrets (e.g. APP_SECRET): state "delete afterward" explicitly
2. Instruction Scope
- - Required binaries and credentials at the START of the description (fits in ~160-char summary)
- Required CLIs declared in BOTH places:
-
metadata.openclaw.requires.anyBins in SKILL.md frontmatter (OpenClaw load-time gating)
-
_meta.json requires.anyBinaries (registry metadata)
- - SKILL.md body and _meta.json must match — no features in one but not the other
- OS restriction in description if PowerShell-specific
- Least-privilege note: state "grant token minimal permissions only"
3. Install Mechanism
- - No external script downloads at runtime — all worker code inline in SKILL.md
- Worker scripts extracted from SKILL.md at runtime, not constructed from string literals
4. Credentials
- - All credential requirements named in the description (file path + field names)
- Distinguish required vs optional fields (e.g. APP_SECRET: setup only, delete afterward)
- No token literals in any script — credentials always read fresh from disk at runtime
- All runtime files permission-restricted (icacls/chmod 600): config, worker, log, pid, state
- Worker stored in ~/.config/[skill]/worker.ps1 — never in system temp
- Logs contain metadata only — no secrets, no message content
- Long-lived tokens: include rotation guidance and immediate-rotation-if-compromised note
5. Persistence & Privilege
- -
always:true is forbidden in community skills — high blast radius, scanner flags it - Background processes opt-in only — never autonomous
- Declare in _meta.json persistence: type, code, optional:true, description
- Description must state: what is read, transmitted, logged, and to where
- Worker content must be fully readable by scanner — own dedicated section, plain code block
- Pid file cleaned up on stop
File Specifications
SKILL.md Frontmatter
CODEBLOCK1
Rules:
- - Description is a QUOTED single-line string
- Lead with a value hook — describe what the skill does in plain, action-focused language (e.g. "Facebook Page manager: post, schedule, reply & get insights"). This is what users searching ClawhHub will read first. Do NOT start with "AI". Do NOT start with "Requires:".
- Technical requirements follow the hook — after the value hook, include: INLINECODE26
- Keep the combined hook + requirements within ~160 characters so both appear in the registry summary
- NEVER put
openclaw in bins or anyBins — it silently hides the skill - Do NOT use
always:true — scanner flags it as high blast radius - Do NOT add any other frontmatter fields (no runtime, clawdbot, credentials blocks)
- Frontmatter MUST end with a closing
--- line — verify it exists before publishing
Good description example:
CODEBLOCK2
Bad description example (do not do this):
"Requires: powershell/pwsh. Reads ~/.config/fb-page/credentials.json (FB_PAGE_TOKEN, FB_PAGE_ID). Interact with any Facebook Page feature via the Meta Graph API..."
The bad example leads with dry technical info — users scanning ClawhHub skip it.
_meta.json
CRITICAL: ownerId must be your ClawhHub internal userId — NOT your handle.
Get it: clawhub inspect <one-of-your-skills> --json
Look for owner.userId (e.g. "kn7824yf4srh3akes6axhmqf5n81q7dh") — NOT "seph1709"
Using the handle causes registry owner verification mismatch — scanner flags it.
CODEBLOCK4
Remove persistence if no background process.
Remove primaryCredential / requiredConfigPaths if no secrets.
Do NOT include openclaw in requires.binaries — it silently gates the skill against itself.
SKILL.md Content Structure
Follow this exact order:
STEP 1 — Load Credentials
CODEBLOCK5
If missing, show full setup flow:
- 1. Detect available resources (e.g.
openclaw channels list) - Ask user to choose and provide required values
- Save config file
- Immediately restrict permissions on ALL files in config dir:
CODEBLOCK6
Include note: never commit any file in ~/.config/[skill]/ to version control.
For setup-only secrets (e.g. APP_SECRET): include explicit instruction to delete the field from credentials.json after the one-time token exchange is complete.
STEP 2 — Core Functionality
- - Table of supported actions (method, endpoint, params)
- Reusable call patterns per request type
- All code inline — no external script downloads
- Wrap all API calls in try/catch
STEP 3 — Error Handling
- - try/catch on every API call
- Error code table with exact fixes
- Tell user exactly what to do for each error
WORKER SCRIPT (if background process)
This section is MANDATORY if the skill has a background process.
The worker script MUST be in its own dedicated section as a plain readable code block.
Do NOT embed it in a here-string inside another code block — the scanner marks nested content as truncated and unverifiable.
Start the section with explicit disclosure:
CODEBLOCK7
Then the full worker as a plain code block with line-by-line comments on every sensitive operation.
The Start procedure must write the worker by extracting it from SKILL.md — not constructing it from string literals:
CODEBLOCK8 powershell\r?\n(.*?)``').Groups[1].Value
Set-Content "$HOME/.config/[skill]/worker.ps1" -Value $workerContent -Encoding UTF8
CODEBLOCK9
> OPTIONAL - never start without explicit user request.
>
> WHAT IS READ: [credential fields] from [file path].
> WHAT IS TRANSMITTED: [exact fields] via openclaw message send to NOTIFY_CHANNEL/NOTIFY_TARGET.
> [Field X] goes to channel destination only — never written to disk.
> WHAT IS LOGGED: [fields only] — no [sensitive content], no tokens.
> WORKER SCRIPT: exact content shown in WORKER SCRIPT section above.
> AUTONOMOUS START: never. Only starts when the user explicitly requests it.
CODEBLOCK10 powershell
# Set GitHub repo About description and homepage URL (run after every push)
gh repo edit seph1709/[skill-name]
--description "OpenClaw skill: [one-line purpose]"
--homepage "https://clawhub.ai/seph1709/[skill-name]"
`
This resolves the "no homepage / opaque owner" scanner flag — the GitHub repo is the audit trail, and the ClawhHub URL links back to the published registry record.
Note: clawhub edit --homepage does not exist as a CLI command. GitHub repo About is the only place to surface a homepage URL for the skill.
---
## Security Rules (non-negotiable)
- NEVER hardcode user IDs, channel IDs, tokens, or personal identifiers
- All secrets in user-owned config files — never in scripts
- Worker reads credentials fresh from disk at runtime
- Worker stored in ~/.config/[skill]/worker.ps1 — never in system temp
- icacls/chmod 600 on ALL runtime files immediately after creation
- Logs: metadata only — no secrets, no message content, no full bodies
- Long-lived tokens: rotation guidance required; immediate rotation if host compromised
- Setup-only secrets (e.g. APP_SECRET): include instructions to delete after use
- Background processes opt-in and declared in _meta.json persistence
- always:true forbidden — use metadata.openclaw.requires or openclaw.json entries instead
- ownerId must be registry userId, not handle
- Least privilege: explicitly state "grant token minimal permissions only" in description
---
## Validation Checklist (before publishing to ClawhHub)
### DESCRIPTION / SUMMARY (scanner reads only ~160 chars — hook + requirements must fit)
- [ ] Starts with a plain-English value hook (what it does, action-focused, no "AI" prefix)
- [ ] Hook is followed by: "Requires: [binaries]. Reads [credentials file] ([fields])."
- [ ] Hook + requirements combined fit within ~160 chars (registry summary truncation point)
- [ ] Required binaries in first ~160 chars
- [ ] Credentials file path and field names in first ~160 chars
- [ ] APIs/services called named explicitly (e.g. "graph.facebook.com only")
- [ ] "No data forwarded to third parties; all calls go to [domain] only" stated
- [ ] Background: TRANSMITTED / LOGGED breakdown in description
- [ ] Setup-only secrets: "delete afterward" stated
- [ ] Long-lived tokens: rotation + immediate-rotation-if-compromised stated
- [ ] Least privilege: "grant token minimal permissions only" stated
### FRONTMATTER (parser gotchas — all silent failures)
- [ ] Closing --- exists after the metadata line
- [ ] name and description only (plus metadata line) — no other frontmatter fields
- [ ] metadata.openclaw.requires uses anyBins — NOT bins: ["openclaw"]
- [ ] No openclaw anywhere in bins or anyBins
- [ ] No always:true
- [ ] File written with UTF-8 no-BOM encoding
### _meta.json
- [ ] ownerId is registry userId (not handle) — verify via clawhub inspect --json
- [ ] requiredConfigPaths lists all credential files
- [ ] primaryCredential.fields lists all fields; required/optional split
- [ ] Notes: read-fresh-from-disk, delete-after-use fields, rotation guidance
- [ ] persistence block present if background process (with full read/transmit/log description)
- [ ] requires.anyBinaries declared (NOT binaries: ["openclaw"])
- [ ] No install field unless real install step exists
### WORKER SCRIPT (if background process)
- [ ] Worker in own dedicated ## WORKER SCRIPT section — NOT nested in here-string
- [ ] Section starts with explicit: external contacts, outbound data, logs disclosure
- [ ] Every sensitive line has a comment
- [ ] Start procedure extracts worker from SKILL.md — not constructed from string literals
- [ ] No token literals anywhere in worker
- [ ] Logs write metadata only (verified line by line in worker)
### CREDENTIALS
- [ ] No token literals in any script
- [ ] Worker reads from disk at runtime
- [ ] icacls/chmod 600 on all files: config, worker, log, pid, state
- [ ] Setup-only secrets have delete-after-use instructions
- [ ] Rotation guidance for long-lived tokens
- [ ] Never commit config dir to version control
### PERSISTENCE & PRIVILEGE
- [ ] Listener opt-in — requires explicit user request
- [ ] Agent Rules: confirm destination trusted before starting
- [ ] Agent Rules: inform user of full content being forwarded
- [ ] Agent Rules: worker content fixed — do not modify at runtime
- [ ] Pid file cleaned up on stop
### GENERAL
- [ ] No README.md or auxiliary docs
- [ ] No hardcoded personal IDs, tokens, channel names
- [ ] No .git folder in skill dir before uploading
- [ ] SKILL.md and _meta.json are consistent — no features in one missing from the other
### POST-PUBLISH
- [ ] GitHub repo About description set (gh repo edit --description "...")
- [ ] GitHub repo homepage set to ClawhHub URL (gh repo edit --homepage "https://clawhub.ai/...")
- [ ] openclaw skills list confirms skill is ✓ ready (not missing, not absent)
- [ ] clawhub inspect [slug]` summary starts with value hook and shows credentials path
clawhub-skill-creator
脚手架化并发布符合ClawhHub标准的OpenClaw技能。遵循以下所有规则。不要跳过任何部分。不要发明此处未列出的约定。
如果尚未提供,请向用户询问技能名称和用途,然后生成文件。
结构
仅生成两个文件 — 不生成README.md、CHANGELOG.md或任何辅助文档:
[技能名称]/
├── SKILL.md (必需)
└── _meta.json (必需)
理解ClawhHub扫描器
扫描器是发布与可用性之间的守门人。在编写任何代码之前,了解其工作原理:
1. 描述摘要是扫描器在注册表层面唯一信任的内容。
_meta.json字段(requiredConfigPaths、primaryCredential、requires)会被存储,但不会在注册表API中展示。扫描器无法读取它们。扫描器需要验证的所有内容都必须放在描述中 — 并且在前约160个字符内,因为这是注册表截断摘要的位置。
2. 扫描器是迭代式的 — 一次只揭示一层问题。
每次修复都会暴露下一个问题。它不会一次性给出所有问题。预计会有多个发布周期。这是有意设计的 — 它是一个渐进式的信任门控。
3. 扫描器无法验证嵌套内容。
嵌入在代码块内的here-string中的工作脚本将被标记为截断且不可验证。扫描器需要读取的所有内容必须是扁平且独立的。
4. 扫描器是基于语义的,而非基于关键词。
它理解记录与传输之间的区别、always:true与always:false之间的区别、handle与userId之间的区别,以及必需凭据与可选凭据之间的区别。它捕获逻辑不一致性,而不仅仅是缺失的关键词。
5. 扫描器默认是保守的。
它倾向于阻止和警告,而非批准。每次发布都会触发新的扫描。在检查清单通过之前不要发布 — 每个被拒绝的版本都会计入技能的历史记录。
已知的OpenClaw解析器陷阱(从实际失败中总结)
这些会静默破坏技能检测 — 没有错误提示,技能只是从openclaw skills list中消失:
- - frontmatter中缺少闭合的---:如果frontmatter块没有用---闭合,OpenClaw会静默地完全无法解析该技能。始终验证闭合分隔符是否存在。
- - metadata.openclaw.requires.bins中的openclaw:OpenClaw不会将自身识别为要检查的二进制文件,并静默隐藏该技能。永远不要将openclaw放在bins中。使用anyBins: [powershell,pwsh]进行操作系统门控 — openclaw运行时是隐含的。
- - ~/.openclaw/skills/中的技能不会被自动检测:OpenClaw默认扫描/skills/。对于~/.openclaw/skills/中的技能,在openclaw.json中添加skills.load.extraDirs: [~/.openclaw/skills]。同时为每个技能添加skills.entries..enabled: true。
- - clawhub install路径:默认安装到./skills(当前工作目录)或/skills。始终显式传递--workdir,或直接安装到~/.openclaw/skills/并添加extraDirs。
- - 编码:始终使用[System.Text.UTF8Encoding]::new($false)(无BOM)编写SKILL.md。frontmatter中的BOM或编码伪影会静默破坏YAML解析器。
ClawhHub扫描器标准
显式处理所有五个标准 — 首先在描述中,然后在正文中。
1. 用途与能力
- - 明确说明调用了哪些API/服务(例如仅graph.facebook.com)
- 说明技能不做什么(不向第三方转发数据)
- 如果是后台进程:明确说明读取了什么、传输了什么、记录了什么
- 如果是长寿命令牌:说明轮换指南 + 如果主机被入侵则立即轮换
- 如果是仅设置用的密钥(例如APP_SECRET):明确说明之后删除
2. 指令范围
- - 在描述开头列出必需的二进制文件和凭据(适合约160字符摘要)
- 在两个位置声明必需的CLI:
- SKILL.md frontmatter中的metadata.openclaw.requires.anyBins(OpenClaw加载时门控)
- _meta.json requires.anyBinaries(注册表元数据)
- - SKILL.md正文和_meta.json必须匹配 — 一个中的功能不能在另一个中缺失
- 如果特定于PowerShell,在描述中说明操作系统限制
- 最小权限说明:声明仅授予令牌最小权限
3. 安装机制
- - 运行时无外部脚本下载 — 所有工作代码内联在SKILL.md中
- 工作脚本在运行时从SKILL.md中提取,而非从字符串字面量构建
4. 凭据
- - 在描述中命名所有凭据要求(文件路径 + 字段名)
- 区分必需字段与可选字段(例如APP_SECRET:仅设置使用,之后删除)
- 任何脚本中不得有令牌字面量 — 凭据始终在运行时从磁盘重新读取
- 所有运行时文件限制权限(icacls/chmod 600):配置、工作脚本、日志、PID、状态
- 工作脚本存储在~/.config/[技能]/worker.ps1中 — 永远不在系统临时目录中
- 日志仅包含元数据 — 无密钥、无消息内容
- 长寿命令牌:包含轮换指南和如果被入侵则立即轮换的说明
5. 持久化与权限
- - 社区技能中禁止使用always:true — 影响范围大,扫描器会标记
- 后台进程仅限选择加入 — 永远不自动启动
- 在_meta.json中声明持久化:类型、代码、optional:true、描述
- 描述必须说明:读取了什么、传输了什么、记录了什么、传输到哪里
- 工作脚本内容必须完全可被扫描器读取 — 独立的专用部分、纯代码块
- 停止时清理PID文件
文件规范
SKILL.md Frontmatter
yaml
name: [技能名称]
description: [用通俗英语说明功能 — 以行动为导向,无AI前缀]。需要:[二进制文件]。读取[凭据文件路径]([字段])。[仅设置用的密钥:之后删除。][长寿命令牌:定期轮换;如果主机被入侵则立即轮换。]仅授予令牌最小权限。不向第三方转发数据;所有调用仅发送到[域名]。
metadata: {openclaw:{emoji:[图标],requires:{anyBins:[powershell,pwsh]}}}
规则:
- - 描述是一个带引号的单行字符串
- 以价值钩子开头 — 用通俗、以行动为导向的语言描述技能的功能(例如Facebook页面管理器:发布、安排、回复和获取洞察)。这是在ClawhHub上搜索的用户首先会读到的内容。不要以AI开头。不要以需要:开头。
- 技术要求在价值钩子之后 — 在价值钩子之后,包含:需要:[二进制文件]。读取[凭据文件路径]([字段])。
- 将价值钩子+要求的组合控制在约160个字符内,以便两者都出现在注册表摘要中
- 永远不要将openclaw放在bins或anyBins中 — 它会静默隐藏技能
- 不要使用always:true — 扫描器会将其标记为高影响范围
- 不要添加任何其他frontmatter字段(无runtime、clawdbot、credentials块)
- Frontmatter必须以闭合的---行结束 — 发布前验证其存在
好的描述示例:
Facebook页面管理器:发布、安排、回复和获取洞察。需要:powershell/pwsh。读取~/.config/fb-page/credentials.json(FBPAGETOKEN, FBPAGEID)。FBAPPSECRET仅用于一次性设置 — 之后删除。长寿命令牌;定期轮换,如果主机被入侵则立即轮换。仅授予最小权限。不向第三方转发数据;所有调用仅发送到graph.facebook.com。
不好的描述示例(不要这样做):
需要:powershell/pwsh。读取~/.config/fb-page/credentials.json(FBPAGETOKEN, FBPAGEID)。通过Meta Graph API与任何Facebook页面功能交互...
不好的示例以枯燥的技术信息开头 — 扫描ClawhHub的用户会跳过它。
_meta.json
关键:ownerId必须是你的ClawhHub内部userId — 不是你的handle。
获取方式:clawhub inspect <你的某个技能> --json
查找