适用于 OpenClaw v2026.2 | 本文假设你已完成基础安装,想扩展 AI 助手能力。
TL;DR: Skills 是预打包的能力扩展。安装 openclaw skill install <name>,目录在 ~/.openclaw/workspace/skills/。ClawHub 有 5700+ 社区技能:编码助手、搜索研究、开发运维、网页自动化等。每个技能包含 SKILL.md(描述+触发词+指令)、可选工具实现。安全扫描通过 VirusTotal 验证。
什么是 Skills?
概念解释
Skills 是预打包的能力扩展模块,包含:
| 组成部分 | 说明 |
|---|---|
| SKILL.md | 技能定义文件,包含描述、触发词、指令、示例 |
| Tools | 可调用的工具函数(可选) |
| Resources | 相关资源文件(可选) |
| Package.json | 依赖声明(可选) |
Skills vs Tools
| 特性 | Skills | Tools |
|---|---|---|
| 来源 | 社区贡献 | 内置/自定义 |
| 安装 | 需要安装 | 默认可用 |
| 复杂度 | 可以很复杂 | 通常简单 |
| 可分享 | 是 | 通常不分享 |
| 更新 | 独立更新 | 随系统更新 |
技能分类
ClawHub 上的技能按类别组织:
| 类别 | 数量 | 代表技能 |
|---|---|---|
| 编码助手 | 133+ | coding-agent, debug-pro, tdd-guide |
| 搜索研究 | 253+ | web-search, deepwiki, exa-search |
| 开发运维 | 212+ | docker-essentials, git-workflows |
| 网页自动化 | 139+ | browser-control, puppeteer-skill |
| 生产力工具 | 135+ | calendar-skill, task-manager |
| 数据分析 | 46+ | data-analyzer, budget-variance |
| 智能家居 | 56+ | home-assistant, smart-home-io |
| PDF 文档 | 67+ | pdf-reader, doc-summarizer |
| 图片视频 | 60+ | image-gen, video-editor |
| 笔记知识 | 100+ | obsidian, notion-sync |
Skills 安装方式
方式一:ClawHub CLI(推荐)
# 搜索技能
openclaw skill search gmail
# 安装技能
openclaw skill install gmail
# 安装指定版本
openclaw skill install [email protected]
# 从 GitHub 安装
openclaw skill install github:user/skill-repo
# 从本地路径安装
openclaw skill install ./my-skill
方式二:手动安装
# 克隆技能仓库
git clone https://github.com/user/skill-repo.git
# 复制到技能目录
cp -r skill-repo ~/.openclaw/workspace/skills/skill-name
方式三:粘贴 GitHub 链接
在聊天中直接发送技能的 GitHub 链接,Agent 会自动识别并安装:
请安装这个技能:https://github.com/user/skill-repo
技能目录结构
~/.openclaw/workspace/skills/
├── gmail/
│ └── SKILL.md
├── calendar/
│ └── SKILL.md
├── web-search/
│ ├── SKILL.md
│ └── package.json
└── my-custom-skill/
├── SKILL.md
├── src/
│ └── index.js
└── package.json
ClawHub 使用指南
访问 ClawHub
访问 clawhub.com 浏览所有可用技能。
搜索技能
# CLI 搜索
openclaw skill search <关键词>
# 示例
openclaw skill search email
openclaw skill search calendar
openclaw skill search home assistant
技能详情
每个技能页面包含:
| 信息 | 说明 |
|---|---|
| 名称和描述 | 技能的功能说明 |
| 作者 | 技能开发者 |
| 版本 | 当前版本号 |
| 下载量 | 安装次数 |
| 依赖 | 需要的其他技能或包 |
| SKILL.md 预览 | 技能定义文件 |
| 安全扫描 | VirusTotal 扫描结果 |
安全扫描
ClawHub 与 VirusTotal 合作,对每个技能进行安全扫描:
# 查看技能安全状态
openclaw skill info gmail --security
# 输出示例:
# Skill: gmail
# Security Status: ✅ Verified
# VirusTotal Scan: Clean (0/72)
# Last Updated: 2026-02-20
安装前检查
# 检查技能依赖
openclaw skill check gmail
# 输出示例:
# Skill: gmail
# Dependencies:
# - google-auth: required ✓
# - google-apis: required ✓
# Conflicts: None
# Recommendations:
# - Consider also installing: calendar
技能配置
配置文件位置
~/.openclaw/workspace/skills/<skill-name>/SKILL.md
SKILL.md 结构详解
---
name: gmail
version: 1.2.0
author: community
description: Send and read Gmail messages through OpenClaw
triggers:
- email
- gmail
- mail
- send email
- read email
dependencies:
- google-auth
tools:
- gmail_list
- gmail_send
- gmail_read
---
# Gmail Skill
Manage your Gmail account through OpenClaw.
## Features
- List recent emails
- Send new emails
- Read specific emails
- Search emails
- Manage labels
## Setup
1. Enable Gmail API in Google Cloud Console
2. Create OAuth credentials
3. Run `openclaw skill config gmail` to authenticate
## Usage Examples
### List emails
User: "Check my recent emails"
Action: Use gmail_list tool with default parameters
### Send email
User: "Send an email to [email protected]"
Action:
1. Ask for subject and body
2. Use gmail_send tool
### Search emails
User: "Search for emails from github"
Action: Use gmail_list tool with query parameter
## Configuration
Set the following environment variables:
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
- GOOGLE_REDIRECT_URI
Or configure in ~/.openclaw/workspace/skills/gmail/config.json
技能配置文件
某些技能需要额外的配置:
# 配置技能
openclaw skill config gmail
# 或手动编辑配置文件
vi ~/.openclaw/workspace/skills/gmail/config.json
配置示例:
{
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"redirectUri": "http://localhost:18789/callback",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.send"
]
}
技能环境变量
# 设置技能环境变量
export GMAIL_CLIENT_ID="your-client-id"
export GMAIL_CLIENT_SECRET="your-client-secret"
# 或在 .env 文件中
echo "GMAIL_CLIENT_ID=your-client-id" >> ~/.openclaw/.env
技能管理
查看已安装技能
# 列出所有技能
openclaw skill list
# 输出示例:
# Name Version Status Last Updated
# gmail 1.2.0 active 2026-02-20
# calendar 2.0.1 active 2026-02-18
# web-search 1.0.0 active 2026-02-15
# home-assistant 0.5.0 disabled 2026-02-10
启用/禁用技能
# 禁用技能
openclaw skill disable home-assistant
# 启用技能
openclaw skill enable home-assistant
更新技能
# 更新单个技能
openclaw skill update gmail
# 更新所有技能
openclaw skill update --all
# 检查可更新
openclaw skill outdated
卸载技能
# 卸载技能
openclaw skill uninstall gmail
# 卸载并清理配置
openclaw skill uninstall gmail --purge
技能诊断
# 诊断技能问题
openclaw skill diagnose gmail
# 输出示例:
# ✓ SKILL.md valid
# ✓ Dependencies installed
# ✓ Configuration complete
# ✓ Authentication working
# ✗ API quota exceeded (2/100 used today)
常用技能推荐
编程开发
| 技能名称 | 功能 | 安装命令 |
|---|---|---|
| coding-agent | 运行 Claude Code、Codex 等 | openclaw skill install coding-agent |
| debug-pro | 系统化调试方法 | openclaw skill install debug-pro |
| tdd-guide | 测试驱动开发 | openclaw skill install tdd-guide |
| git-workflows | Git 工作流 | openclaw skill install git-workflows |
| docker-essentials | Docker 基础 | openclaw skill install docker-essentials |
生产力
| 技能名称 | 功能 | 安装命令 |
|---|---|---|
| gmail | Gmail 管理 | openclaw skill install gmail |
| calendar | 日历管理 | openclaw skill install calendar |
| task-manager | 任务管理 | openclaw skill install task-manager |
| notion-sync | Notion 同步 | openclaw skill install notion-sync |
| obsidian | Obsidian 笔记 | openclaw skill install obsidian |
搜索研究
| 技能名称 | 功能 | 安装命令 |
|---|---|---|
| web-search | 网页搜索 | openclaw skill install web-search |
| deepwiki | Wiki 搜索 | openclaw skill install deepwiki |
| exa-search | AI 搜索 | openclaw skill install exa-search |
| research-paper | 论文搜索 | openclaw skill install research-paper |
智能家居
| 技能名称 | 功能 | 安装命令 |
|---|---|---|
| home-assistant | Home Assistant 控制 | openclaw skill install home-assistant |
| smart-home-io | 智能家居设备 | openclaw skill install smart-home-io |
| philips-hue | 飞利浦 Hue | openclaw skill install philips-hue |
技能开发基础
创建新技能
# 创建技能模板
openclaw skill create my-skill
# 生成的目录结构
my-skill/
├── SKILL.md
├── config.json.example
└── README.md
SKILL.md 模板
---
name: my-skill
version: 1.0.0
author: your-name
description: Brief description of what this skill does
triggers:
- trigger-word-1
- trigger-word-2
dependencies: []
tools: []
---
# My Skill
Detailed description of the skill.
## Features
- Feature 1
- Feature 2
- Feature 3
## Setup
1. Step 1
2. Step 2
3. Step 3
## Usage Examples
### Example 1
User: "..."
Action: ...
### Example 2
User: "..."
Action: ...
## Configuration
Required configuration and environment variables.
## Notes
Any additional notes or warnings.
添加工具定义
## Tools
This skill provides the following tools:
### my_tool_name
Description of what this tool does.
Parameters:
- `param1` (string, required): Description
- `param2` (number, optional): Description, default: 0
Returns:
- Result description
Example usage:
User: "..."
Action: Use my_tool_name with param1="value"
发布技能
# 验证技能
openclaw skill validate my-skill
# 发布到 ClawHub
openclaw skill publish my-skill
# 或提交到 GitHub
git add .
git commit -m "Initial skill release"
git push origin main
技能安全
安全最佳实践
| 建议 | 说明 |
|---|---|
| 审查来源 | 只安装可信来源的技能 |
| 检查权限 | 了解技能需要什么权限 |
| 查看代码 | 检查 SKILL.md 和实现代码 |
| 隔离测试 | 先在测试环境使用新技能 |
| 定期更新 | 保持技能最新版本 |
技能权限
# 查看技能权限
openclaw skill permissions gmail
# 输出示例:
# Skill: gmail
# Permissions:
# - network:outbound (gmail.googleapis.com)
# - filesystem:read (credential files)
# - filesystem:write (token cache)
# Risk Level: Medium
限制技能权限
{
"skills": {
"gmail": {
"permissions": {
"network": {
"allow": ["gmail.googleapis.com", "oauth2.googleapis.com"],
"deny": ["*"]
},
"filesystem": {
"allow": ["~/.openclaw/workspace/skills/gmail/"],
"deny": ["*"]
}
}
}
}
}
技能冲突解决
常见冲突
| 冲突类型 | 说明 | 解决方案 |
|---|---|---|
| 触发词重叠 | 多个技能响应同一关键词 | 明确触发词或禁用冲突技能 |
| 依赖冲突 | 不同技能需要不同版本依赖 | 使用隔离环境 |
| 权限冲突 | 技能需要相同权限 | 检查是否必要 |
解决冲突
# 查看技能冲突
openclaw skill conflicts
# 输出示例:
# Conflict: email trigger
# - gmail
# - outlook
# Resolution: Specify skill name or adjust priorities
# 设置技能优先级
openclaw skill priority gmail 10
openclaw skill priority outlook 5
隔离环境
对于有依赖冲突的技能,可以使用隔离环境:
{
"skills": {
"isolatedSkills": ["gmail", "outlook"],
"isolationMode": "per-skill"
}
}
故障排查
技能不生效
# 检查技能状态
openclaw skill list --status
# 检查技能加载
openclaw skill load gmail --verbose
# 查看技能日志
openclaw logs --filter skill:gmail
认证失败
# 重新认证
openclaw skill auth gmail --reauth
# 检查认证状态
openclaw skill auth gmail --status
依赖问题
# 检查依赖
openclaw skill deps gmail
# 安装依赖
openclaw skill deps gmail --install
# 更新依赖
openclaw skill deps gmail --update
技能加载错误
# 验证 SKILL.md 语法
openclaw skill validate gmail
# 输出示例:
# ✗ Error: Invalid frontmatter
# Line 5: Unknown field 'invalid-field'
# ✗ Error: Missing required field 'name'
小结
Skills 系统是 OpenClaw 扩展能力的核心:
- 丰富的生态:5700+ 社区技能覆盖各种场景
- 简单的安装:一行命令即可安装
- 灵活的配置:支持自定义和覆盖
- 安全可控:权限管理和安全扫描
通过合理选择和配置技能,你可以让 AI 助手获得无限可能的能力扩展。
本篇小结:
- 理解了 Skills 的概念和结构
- 掌握了多种安装和管理技能的方法
- 学会了使用 ClawHub 发现和评估技能
- 了解了技能安全和权限管理
- 掌握了技能开发的基础知识
更新记录:
- 2026-02-26:初版发布,基于 OpenClaw v2026.2
系列导航:
- ← 上一篇:多模型配置与切换
- → 下一篇:Skills 开发入门