Files
2026-02-23 18:36:11 +08:00

78 lines
1.5 KiB
Markdown
Raw Permalink 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.
---
name: opencode-skill-creator
description: 教你如何在opencode中创建自定义skill
---
## Skill 创建指南
### 目录结构
每个skill都是一个文件夹包含以下文件
```
skills/
└── your-skill-name/
└── SKILL.md
```
### SKILL.md 文件格式
使用 YAML frontmatter 定义元数据:
```yaml
---
name: 技能名称
description: 技能描述
---
```
### Frontmatter 字段说明
| 字段 | 必填 | 说明 |
|------|------|------|
| `name` | 是 | 技能名称,用于显示在技能列表中 |
| `description` | 是 | 技能简短描述 |
### 技能内容规范
1. **描述要详细**清楚地说明这个skill能做什么
2. **提供示例**:包含实际使用的代码示例
3. **说明参数**:列出所有可用参数及其作用
4. **保持简洁**:避免冗长的说明
### 创建步骤
1.`/workspace/.opencode/skills/` 目录下创建新文件夹
2. 在文件夹中创建 `SKILL.md` 文件
3. 编写frontmatter和内容
4. 技能将自动被系统识别
### 示例
```yaml
---
name: 示例技能
description: 这是一个示例技能的描述
---
这是一个详细的技能说明文档。
## 使用方法
```bash
# 示例命令
echo "Hello World"
```
## 参数说明
- `param1`: 参数1说明
- `param2`: 参数2说明
```
### 注意事项
- 文件名必须是 `SKILL.md`(大写)
- frontmatter 必须使用 `---` 包裹
- 内容支持 Markdown 语法
- 可以包含代码块、表格、列表等