技能创作

其他 社区

技能解读

当前原文的自动摘译,尚未人工审校。

我做什么

定义添加新 OpenCode 技能的步骤和检查 确保该技能可由 skill 工具发现 验证命名、frontmatter 和放置规则

何时使用

添加新的可重用工作流程或剧本作为技能 更新技能元数据以满足 OpenCode 发现要求

工作流程

选择与 ^[a-z0-9]+(-[a-z0-9]+)*$ 匹配且长度为 1-64 个字符的技能名称。创建.opencode/skill/<name>/SKILL.md并确保文件夹与名称匹配。添加带有 name 和 description 的 YAML frontmatter(可选:license、compatibility、metadata)。写出清晰的正文(目的/我做什么、何时使用、工作流程、完成标准)。确认发现:在repo中运行OpenCode并检查skill工具列表。

放置规则(来自 opencode.ai 文档)

项目:.opencode/skill/<name>/SKILL.md 项目(Claude 兼容):.claude/skills/<name>/SKILL.md 全球:~/.config/opencode/skill/<name>/SKILL.md 全球(Claude 兼容):~/.claude/skills/<name>/SKILL.md

验证清单

SKILL.md 全部大写并包含 YAML frontmatter name 与文件夹名称匹配 description 为 1–1024 个字符 存储库中没有重复的技能名称

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
通用
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@different-ai · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
  • 命令执行
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

## What I do

- Define the steps and checks for adding a new OpenCode skill
- Ensure the skill is discoverable by the `skill` tool
- Validate naming, frontmatter, and placement rules

## When to use

- Adding a new reusable workflow or playbook as a skill
- Updating skill metadata to meet OpenCode discovery requirements

## Workflow

1. Pick a skill name that matches `^[a-z0-9]+(-[a-z0-9]+)*$` and is 1–64 chars.
2. Create `.opencode/skill/<name>/SKILL.md` and ensure the folder matches the name.
3. Add YAML frontmatter with `name` and `description` (optional: `license`, `compatibility`, `metadata`).
4. Write the body with clear sections (Purpose/What I do, When to use, Workflow, Completion criteria).
5. Confirm discovery: run OpenCode in the repo and check `skill` tool list.
6. If permissions block it, update `opencode.json` with `permission.skill` rules.

## Placement rules (from opencode.ai docs)

- Project: `.opencode/skill/<name>/SKILL.md`
- Project (Claude compatible): `.claude/skills/<name>/SKILL.md`
- Global: `~/.config/opencode/skill/<name>/SKILL.md`
- Global (Claude compatible): `~/.claude/skills/<name>/SKILL.md`

## Validation checklist

- `SKILL.md` is all caps and contains YAML frontmatter
- `name` matches folder name
- `description` is 1–1024 characters
- No duplicate skill names in the repo

## Example

```
---
name: git-release
description: Create consistent releases and changelogs
compatibility: opencode
---

## What I do

- Draft release notes from merged PRs
- Propose a version bump
- Provide a `gh release create` command
```

## Completion criteria

- Skill appears in `skill` tool list
- `skill({ name })` loads without errors
- Instructions are clear enough to execute without extra context

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。