技能 编写
- 作者仓库星标 225
- 作者仓库 agent-bank
What I do
- Define the steps and checks for adding a new OpenCode skill
- Ensure the skill is discoverable by the
skilltool - 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
- Pick a skill name that matches
^[a-z0-9]+(-[a-z0-9]+)*$and is 1–64 chars. - Create
.opencode/skill/<name>/SKILL.mdand ensure the folder matches the name. - Add YAML frontmatter with
nameanddescription(optional:license,compatibility,metadata). - Write the body with clear sections (Purpose/What I do, When to use, Workflow, Completion criteria).
- Confirm discovery: run OpenCode in the repo and check
skilltool list. - If permissions block it, update
opencode.jsonwithpermission.skillrules.
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.mdis all caps and contains YAML frontmatternamematches folder namedescriptionis 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
skilltool list skill({ name })loads without errors- Instructions are clear enough to execute without extra context
- 流狐分类
- 通用
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @different-ai · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 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
Adding a new reusable workflow or playbook as a skill Updating skill metadata to meet OpenCode discovery requirements
Pick a skill name that matches ^[a-z0-9]+(-[a-z0-9]+)$ and is 1–64 chars. Create .opencode/skill/<name>/SKILL.md and ensure the folder matches the name. Add YAML frontmatter with name and description (optional: license, compatibility, metadata).
Project: .opencode/skill/<name>/SKILL.md Project (Claude compatible): .claude/skills/<name>/SKILL.md Global: ~/.config/opencode/skill/<name>/SKILL.md
SKILL.md is all caps and contains YAML frontmatter name matches folder name description is 1–1024 characters
Example
## 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 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> What I do → When to use → Workflow → Placement rules (from opencode.ai docs) → Validation checklist → Example
要点 -> 1. Pick a skill name that matches ^[a-z0-9]+(-[a-z0-9]+)$ and is 1–64 chars.
文件/命令 -> ^[a-z0-9]+(-[a-z0-9]+)$ · .opencode/skill/<name>/SKILL.md · name · description · license · compatibility · metadata · opencode.json
内容 SHA-256 -> 0dc9df6ffb26
方法与流程
适用与边界
原文中的明确线索
^[a-z0-9]+(-[a-z0-9]+)$、.opencode/skill/<name>/SKILL.md、name、description、license、compatibility、metadata、opencode.json