Create a skill
Create one directory per skill with aSKILL.md file:
.opencode/skills/git-release/SKILL.md
SKILL.md.
Discovery
OpenCode automatically adds the following source directories:| Scope | Sources |
|---|---|
| Global | ~/.config/opencode/skills |
| Global compatibility | ~/.claude/skills, ~/.agents/skills |
| Project | .opencode/skills |
| Project compatibility | .claude/skills, .agents/skills |
- Markdown files at the source root, such as
skills/git-release.md SKILL.mdfiles at any depth, such asskills/git-release/SKILL.md
Configure sources
Use theskills array in any opencode.json or opencode.jsonc to add local
directories or HTTP catalogs:
opencode.jsonc
~/ use
the current user’s home directory. Only http:// and https:// values are
treated as URL sources.
Every discovered config document contributes its skills entries; the arrays
are additive rather than replacing one another.
HTTP catalogs
An HTTP source is a base URL containing anindex.json:
index.json
<base-url>/git-release/<file>. File paths must be safe, relative,
same-origin paths. Each entry must include either SKILL.md or a Markdown file
named after the index entry, such as git-release.md.
Use the named Markdown form for HTTP catalogs. Each downloaded skill directory
is itself a source root, so git-release.md produces the ID git-release; a
root-level SKILL.md produces the literal ID SKILL in the current V2
implementation. Increment version when files change so OpenCode refreshes
the cached copy.
Frontmatter
V2 reads these fields:| Field | Purpose |
|---|---|
name | Display name; defaults to the path-derived ID |
description | Summary shown to the model and command catalog |
slash | Set to false to hide the skill from the V2 slash-command catalog |
metadata.opencode/slash | Boolean or "true"/"false"; overrides slash |
metadata.opencode/autoinvoke | Set to false to omit the skill from model-facing discovery |
name, and description are optional at runtime. However, a
clear description is strongly recommended: skills without one are not
advertised to the model. license, compatibility, and other metadata may be
included for portability, but V2 does not interpret them.
opencode/autoinvoke: false only removes the skill from the model’s available
skills list. The skill remains registered and can still be activated explicitly
by its ID.
IDs and validation
The skill ID comes from its path, not its frontmatter:| File | ID |
|---|---|
<source>/git-release.md | git-release |
<source>/git-release/SKILL.md | git-release |
<source>/teams/release/SKILL.md | release |
name and the directory, or
a maximum description length. The frontmatter name is only a display label.
For portable, predictable skills, use a unique lowercase kebab-case ID of 1-64
characters and keep it aligned with the directory name:
Precedence
Skills are keyed by ID. If several sources define the same ID, the later source wins. Sources are registered in this order, from lower to higher precedence:- Built-in skills
.claude/skillssources, global first and then from the current directory upward.agents/skillssources, global first and then from the current directory upward~/.config/opencode/skills- Project
.opencode/skills, from the project root toward the current directory - Explicit
skillsconfig entries, in config priority and array order
Runtime loading
At each model step, OpenCode advertises permitted skills that have a description and do not setopencode/autoinvoke to false. The advertisement
contains only each skill’s ID, name, and description; it does not add every
skill body to the prompt.
When the model calls the skill tool with an exact ID, OpenCode:
- Resolves the current winning definition for that ID
- Checks the
skillpermission for the selected agent - Adds the Markdown body, without frontmatter, to the conversation
- Provides the skill’s base directory and a sample of up to ten supporting file paths
SKILL.md skills; flat Markdown skills
receive no neighboring file list.
In the V2 CLI, skills appear as /id commands unless slash resolves to
false. Selecting one appends the skill body as a skill message and resumes
the session.
Permissions
Permission rules use theskill action and the skill ID as the resource. Rules
are evaluated in order, with the last matching rule winning:
opencode.jsonc
deny removes matching skills from model-facing discovery and rejects skill
tool loading. ask advertises the skill but requests approval when the model
loads it. The same rules can be placed under an individual
agents.<id>.permissions array.
Troubleshooting
If a skill is missing or loads the wrong content:- Confirm the file is either a root-level
*.mdor a nested file named exactlySKILL.md. - Check the path-derived ID rather than the frontmatter
name. - Add a
descriptionif the skill should be advertised to the model. - Check
opencode/autoinvokeand the selected agent’sskillpermissions. - Look for a later source defining the same ID.
- For HTTP catalogs, verify
index.json, same-origin file paths, and a changedversion.