Files
chatgpt-on-wechat/docs/skills/index.mdx
2026-03-29 17:57:12 +08:00

65 lines
2.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 技能概览
description: CowAgent 技能系统介绍
---
技能Skill为 Agent 提供无限的扩展性。每个 Skill 由说明文件(`SKILL.md`)、运行脚本(可选)、资源(可选)组成,描述如何完成特定类型的任务。
Skill 与 Tool 的区别Tool 是由代码实现的原子操作如读写文件、执行命令Skill 则是基于说明文件的高级工作流,可以组合调用多个 Tool 来完成复杂任务。
## 获取技能
CowAgent 提供多种方式获取技能:
- **Cow 技能广场** — 通过 `/skill list --remote` 浏览和安装社区技能
- **GitHub** — 直接从 GitHub 仓库安装,支持批量安装
- **ClawHub** — 通过 `/skill install clawhub:名称` 安装 ClawHub 上的技能
- **URL** — 从 zip 压缩包或 SKILL.md 链接安装
- **对话创建** — 通过自然语言对话让 Agent 自动创建技能
详细安装方式参考 [安装技能](/skills/install) 和 [技能管理命令](/commands/skill)。也可以通过对话 [创建技能](/skills/create)。
## 技能加载优先级
1. **工作空间技能**(最高):`~/cow/skills/`
2. **项目内置技能**(最低):`skills/`
同名技能按优先级覆盖。
## 技能文件结构
```
skills/
├── my-skill/
│ ├── SKILL.md # Skill description (frontmatter + instructions)
│ ├── scripts/ # Execution scripts (optional)
│ └── resources/ # Additional resources (optional)
```
### SKILL.md 格式
```markdown
---
name: my-skill
description: Brief description of the skill
metadata:
emoji: 🔧
requires:
bins: ["curl"]
env: ["MY_API_KEY"]
primaryEnv: "MY_API_KEY"
---
# My Skill
Detailed instructions...
```
| 字段 | 说明 |
| --- | --- |
| `name` | 技能名称,需与目录名一致 |
| `description` | 技能描述Agent 据此决定是否调用 |
| `metadata.requires.bins` | 依赖的系统命令 |
| `metadata.requires.env` | 依赖的环境变量 |
| `metadata.always` | 是否始终加载(默认 false |