skill tool—agents see available skills and can load the full content when needed.
Place files
Create one folder per skill name and put aSKILL.md inside it.
OpenCode searches these locations:
- Project config:
.opencode/skills/<name>/SKILL.md - Global config:
~/.config/opencode/skills/<name>/SKILL.md - Project Claude-compatible:
.claude/skills/<name>/SKILL.md - Global Claude-compatible:
~/.claude/skills/<name>/SKILL.md - Project agent-compatible:
.agents/skills/<name>/SKILL.md - Global agent-compatible:
~/.agents/skills/<name>/SKILL.md
Create SKILL.md file
Create a
SKILL.md file with frontmatter and content:.opencode/skills/git-release/SKILL.md
Understand discovery
For project-local paths, OpenCode walks up from your current working directory until it reaches the git worktree. It loads any matchingskills/*/SKILL.md in .opencode/ and any matching .claude/skills/*/SKILL.md or .agents/skills/*/SKILL.md along the way.
Global definitions are also loaded from ~/.config/opencode/skills/*/SKILL.md, ~/.claude/skills/*/SKILL.md, and ~/.agents/skills/*/SKILL.md.
Discovery order
Skills are discovered in this order:- Global external skills (
.claude/skills/,.agents/skills/in home directory) - Project external skills (walking up from current directory to worktree)
- OpenCode skills (
.opencode/skills/directories) - Additional paths (from
skills.pathsconfig) - Remote skills (from
skills.urlsconfig)
Discovery implementation
The skill discovery system:Write frontmatter
EachSKILL.md must start with YAML frontmatter.
Only these fields are recognized:
name(required)description(required)license(optional)compatibility(optional)metadata(optional, string-to-string map)
Validate names
name must:
- Be 1–64 characters
- Be lowercase alphanumeric with single hyphen separators
- Not start or end with
- - Not contain consecutive
-- - Match the directory name that contains
SKILL.md
git-releasecode-reviewtest-generatorapi-docs
Git-Release(uppercase)-git-release(starts with hyphen)git--release(consecutive hyphens)git_release(underscore)
Follow length rules
description must be 1-1024 characters.
Keep it specific enough for the agent to choose correctly.
Use an example
Create.opencode/skills/git-release/SKILL.md like this:
Recognize tool description
OpenCode lists available skills in theskill tool description.
Each entry includes the skill name and description:
Configure permissions
Control which skills agents can access using pattern-based permissions inopencode.json:
| Permission | Behavior |
|---|---|
allow | Skill loads immediately |
deny | Skill hidden from agent, access rejected |
ask | User prompted for approval before loading |
internal-* matches internal-docs, internal-tools, etc.
Override per agent
Give specific agents different permissions than the global defaults. For custom agents (in agent frontmatter):opencode.json):
Disable the skill tool
Completely disable skills for agents that shouldn’t use them: For custom agents:<available_skills> section is omitted entirely.
Advanced configuration
Additional skill paths
Add custom directories to scan for skills:opencode.json
- Absolute:
/path/to/skills - Relative to project:
./team-skills - Home relative:
~/shared-skills
Remote skill repositories
Load skills from remote URLs:opencode.json
index.json file:
https://example.com/skills/index.json
~/.cache/opencode/skills/ and loaded automatically.
Disable external skills
Disable Claude Code/Agent compatible skill directories:.claude/skills/ and .agents/skills/ directories.
Skill content structure
The content of yourSKILL.md (after the frontmatter) contains instructions for the agent.
Best practices
Be specific about what the skill does:Examples
Code review skill
.opencode/skills/code-review/SKILL.md
Test generator skill
.opencode/skills/test-generator/SKILL.md
Database migration skill
.opencode/skills/db-migration/SKILL.md
-
Check that frontmatter includes
nameanddescription -
Ensure skill names are unique across all locations
- Check for duplicate names in global and project skills
- Later sources override earlier ones
-
Check permissions—skills with
denyare hidden from agents -
Verify directory name matches skill name
-
Check skill name format