把你的技能skills发布到ClawHub流程攻略。
一、发布前必备(所有方式通用)
1. 注册 & 登录
2. 本地技能目录结构(必须)
你的技能文件夹(比如 my-hello-skill)至少要有:
1
2
3
4
| my-hello-skill/
├─ SKILL.md # 核心元数据(必填)
├─ README.md # 使用说明(推荐)
└─ 你的脚本/代码 # 如 main.py / run.sh 等
|
3. SKILL.md 最小示例(直接复制可用)
1
2
3
4
5
6
7
8
9
| name: Hello World Skill
slug: hello-world
version: 1.0.0
description: 输出 Hello World 的示例技能
author: your-github-name
license: MIT-0
triggers:
- hello
- world
|
- slug:小写、字母数字+短横线,全局唯一
- version:语义化版本(x.y.z),每次发布必须递增
二、方式一:本地文件夹 → 网页直传(新手推荐)
- 准备好上面的
my-hello-skill 文件夹 - 打开发布页:https://clawhub.ai/publish-skill
- 选「Upload Folder」
- 拖放整个文件夹到页面,或点击选择文件夹
- 表单自动填充,核对/补全:
- Slug(必须合规、无重名)
- Display Name
- Description
- Tags(选填,如
demo utils)
- 勾选 MIT-0 协议
- 填写 Changelog:
Initial release - 点 Publish skill → 看到绿色提示即成功
三、方式二:本地文件夹 → CLI 命令发布(推荐自动化)
1. 安装 CLI
1
2
3
| npm i -g clawhub
# 或
pnpm add -g clawhub
|
2. 登录(首次必做)
1
2
| clawhub login
# 按提示授权 GitHub
|
3. 本地测试(可选但建议)
1
2
| cd my-hello-skill
clawhub install . # 本地安装测试
|
4. 发布命令
1
2
3
4
5
6
| clawhub publish . \
--slug hello-world \
--name "Hello World Skill" \
--version 1.0.0 \
--tags demo,utils \
--changelog "Initial release"
|
- 成功提示:
✔ Published successfully: https://clawhub.ai/your-name/hello-world
5. 后续更新(关键)
- 修改代码
- SKILL.md 改 version:
1.0.1 - 再次运行 publish 命令即可(自动上新版本)
四、方式三:GitHub 仓库 → ClawHub 导入(已有仓库最省事)
1. 准备 GitHub 仓库
- 新建/使用现有仓库,必须 Public
- 仓库根目录放
SKILL.md(同前结构) - 推送到 GitHub:
1
2
3
4
5
| git init
git add .
git commit -m "init skill"
git remote add origin https://github.com/你的名/hello-world-skill.git
git push -u origin main
|
2. ClawHub 从 GitHub 导入
- 打开: https://clawhub.ai/import
- 填入仓库地址:
https://github.com/你的名/hello-world-skill - 如果你的仓库是tree,点击右侧 …,选择
copy permalink - 把 永久链接 填入输入框
- 点 Detect → 自动读取 SKILL.md 填充表单
- 选择勾选发布的文件
- 核对信息、填 Changelog、勾选协议
- 点 Publish skill 完成
- 你的的skills 地址: https://clawhub.ai/ah0210/tech-discussion-manager
五、常见错误 & 避坑
| 错误 | 原因 | 解决 |
|---|
| Slug must be lowercase | 大写/非法字符 | 全小写,只用 a-z 0-9 - |
| Remove non-text files | 含 .git / 二进制 | 删除 .git,只留文本文件 |
| GitHub account too new | 账号不满 7 天 | 等 7 天再发 |
| Version already exists | 同版本重复发 | 改 version(如 1.0.1) |
六、发布后验证