返回

06. OpenClaw Skills 技能系統詳解

Skills 是 OpenClaw 的擴充能力核心,社群已貢獻 5700+ 個技能包。本文詳細介紹 Skills 的概念、安裝方法、ClawHub 使用、技能分類、設定管理,以及如何選擇和使用合適的技能來增強 AI 助手的能力。

適用於 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

系列導航