📅 更新于 2026-05-29 | OpenClawClawHub技能生态

🦞 ClawHub 详解

世界上有一种商店,不卖衣服不卖鞋,只卖AI的技能包。凌晨3点22分,你突然发现你的Agent缺个"发Discord消息"的技能,于是你打开了ClawHub——就像饿了点外卖一样简单。

—— 妙趣AI · 技能商店哲学

📖 什么是 ClawHub?

ClawHub是OpenClaw的官方技能中心(Skill Hub),类似于VS Code的扩展市场、Chrome的插件商店。它提供:

🧠 核心原理

1. 技能包结构

ClawHub上的每个技能都是一个标准的OpenClaw Skill:

my-skill/
├── SKILL.md          # 技能描述(必需)
├── package.json      # 元数据(名称、版本、依赖)
├── src/
│   └── index.js      # 技能实现(可选)
└── README.md         # 使用文档(可选)

2. 技能注册与发现

步骤说明
1. 开发者发布将技能推送到ClawHub仓库或注册到索引服务
2. 索引构建ClawHub扫描技能,提取description、标签、依赖
3. 用户搜索根据关键词、分类查找技能
4. 一键安装下载技能文件到本地skills/目录
5. Agent发现OpenClaw启动时自动扫描新技能

3. 技能依赖管理

技能可以声明依赖(类似npm):

// package.json
{
  "name": "discord-notifier",
  "version": "1.0.0",
  "description": "Send messages to Discord",
  "dependencies": {
    "webhook-helper": "^1.0.0",
    "message-formatter": "^2.1.0"
  },
  "openclaw": {
    "minVersion": "2026.1.0",
    "requiredTools": ["curl", "node"]
  }
}

🛠️ OpenClaw 实战应用

场景一:妙趣AI安装Discord技能

妙趣AI需要Discord社区运营,从ClawHub安装技能:

# 1. 搜索技能
openclaw skill search discord

# 输出:
# discord-notifier v1.2.0 - Send messages to Discord channels
# discord-bot v2.0.1 - Full Discord bot with slash commands
# ...

# 2. 安装技能
openclaw skill install discord-notifier

# 3. Agent自动发现新技能
# 下次启动时,会扫描到discord-notifier技能
# 读取其SKILL.md,加入工具索引

# 4. 使用技能
# 用户:"发个消息到Discord"
# Agent自动匹配discord-notifier技能并执行

场景二:发布自定义技能到ClawHub

妙趣AI的营销技能发布到ClawHub:

# 1. 创建技能目录
mkdir marketing-psychology
cd marketing-psychology

# 2. 编写SKILL.md
cat > SKILL.md << 'EOF'
---
name: marketing-psychology
description: 应用70+心理模型优化营销文案。当用户需要优化广告、文案、推送内容时使用。
---

# Marketing Psychology Skill
## 使用方式
当用户说"优化这段文案"时,调用本技能...
EOF

# 3. 发布到ClawHub
openclaw skill publish marketing-psychology

# 4. 其他用户就能安装了
# openclaw skill install marketing-psychology

场景三:技能版本管理

# 查看已安装技能
openclaw skill list

# 更新技能
openclaw skill update discord-notifier

# 回滚到旧版本
openclaw skill install discord-notifier@1.0.0

# 卸载技能
openclaw skill uninstall discord-notifier

💻 代码示例

示例1:ClawHub技能安装器(简化版)

// ClawHub Skill Installer
class ClawHub {
  constructor() {
    this.registry = 'https://clawhub.openclaw.ai';
    this.skillsDir = '~/.openclaw/skills/';
  }
  
  async search(query) {
    const response = await fetch(
      `${this.registry}/api/skills?q=${encodeURIComponent(query)}`
    );
    return response.json();
  }
  
  async install(skillName, version = 'latest') {
    // 1. 从ClawHub下载技能
    const skill = await this.download(skillName, version);
    
    // 2. 检查依赖
    await this.checkDependencies(skill);
    
    // 3. 安装到本地skills目录
    const targetDir = path.join(this.skillsDir, skillName);
    await this.extractSkill(skill, targetDir);
    
    // 4. 更新本地技能索引
    await this.updateIndex(skillName, skill);
    
    return { success: true, path: targetDir };
  }
  
  async download(skillName, version) {
    const url = `${this.registry}/skills/${skillName}/${version}.tar.gz`;
    const response = await fetch(url);
    return response.buffer();
  }
}

示例2:技能元数据格式

// 从ClawHub API获取的技能信息
{
  "name": "discord-notifier",
  "version": "1.2.0",
  "description": "Send messages to Discord channels via webhook",
  "author": "openclaw-community",
  "tags": ["discord", "notification", "chat"],
  "stars": 128,
  "downloads": 5430,
  "lastUpdated": "2026-05-15T10:00:00Z",
  "openclaw": {
    "minVersion": "2026.1.0",
    "requiredTools": ["curl"]
  },
  "repository": "https://github.com/openclaw/skills/discord-notifier",
  "readme": "https://clawhub.openclaw.ai/skills/discord-notifier/readme"
}

示例3:本地技能索引

// ~/.openclaw/skills/.index.json
{
  "installed": {
    "discord-notifier": {
      "version": "1.2.0",
      "installedAt": "2026-05-20T08:00:00Z",
      "source": "clawhub",
      "path": "~/.openclaw/skills/discord-notifier"
    },
    "marketing-psychology": {
      "version": "2.0.1",
      "installedAt": "2026-05-22T14:30:00Z",
      "source": "local",
      "path": "~/.openclaw/skills/marketing-psychology"
    }
  },
  "lastUpdated": "2026-05-29T04:00:00Z"
}

✅ 最佳实践

✅ DO(推荐做法)

⚠️ DON'T(常见坑)

📊 技能生态对比

平台类型优点OpenClaw/ClawHub
VS Code Marketplace编辑器扩展生态成熟、审核严格轻量、文件即配置
npmJS包依赖管理强专门为AI Agent设计
LangChain HubPrompt/Chain社区活跃技能更完整、可执行
ClawHubAgent Skills热加载、零代码✅ 我们的选择

🎬 周星驰式总结

就像《食神》里的"少林寺十八铜人"——每个人都有自己的绝活,组合在一起就是无敌战队。ClawHub就是Agent的"技能超市",缺什么买什么,不用自己从头造轮子。记住:站在巨人的肩膀上,你的Agent也能成为超级英雄!

🔗 相关链接

🔗 相关推荐

🔧 工具教程
OpenClaw Context Engineering:上下文工程优化实战 (2026)
🔧 工具教程
OpenClaw ClawHub市场指南:Skills生态系统完全教程
🔧 工具教程
OpenClaw ClawHub 发布流程:从开发到上架全指南 (2026)

📚 相关术语

📖 术语
Context Engineering
📄 文章
OpenClaw Skill
📄 文章
OpenClaw
📄 文章
openclaw
📄 文章
AI Agent
📖 术语
Agent