Skip to main content
Agent skills let OpenCode discover reusable instructions from your repo or home directory. Skills are loaded on-demand via the native skill tool—agents see available skills and can load the full content when needed.

Place files

Create one folder per skill name and put a SKILL.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
1

Create skill directory

Create a directory for your skill:
2

Create SKILL.md file

Create a SKILL.md file with frontmatter and content:
.opencode/skills/git-release/SKILL.md
3

Use the skill

The agent can now load this skill:

Understand discovery

For project-local paths, OpenCode walks up from your current working directory until it reaches the git worktree. It loads any matching skills/*/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:
  1. Global external skills (.claude/skills/, .agents/skills/ in home directory)
  2. Project external skills (walking up from current directory to worktree)
  3. OpenCode skills (.opencode/skills/ directories)
  4. Additional paths (from skills.paths config)
  5. Remote skills (from skills.urls config)
Later sources can override earlier ones if they have the same skill name.

Discovery implementation

The skill discovery system:

Write frontmatter

Each SKILL.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)
Unknown frontmatter fields are ignored.

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
Equivalent regex:
Valid names:
  • git-release
  • code-review
  • test-generator
  • api-docs
Invalid names:
  • 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 the skill tool description. Each entry includes the skill name and description:
The agent loads a skill by calling the tool:

Configure permissions

Control which skills agents can access using pattern-based permissions in opencode.json:
Patterns support wildcards: 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):
For built-in agents (in opencode.json):

Disable the skill tool

Completely disable skills for agents that shouldn’t use them: For custom agents:
For built-in agents:
When disabled, the <available_skills> section is omitted entirely.

Advanced configuration

Additional skill paths

Add custom directories to scan for skills:
opencode.json
Paths can be:
  • Absolute: /path/to/skills
  • Relative to project: ./team-skills
  • Home relative: ~/shared-skills

Remote skill repositories

Load skills from remote URLs:
opencode.json
The remote URL must serve an index.json file:
https://example.com/skills/index.json
Skills are downloaded to ~/.cache/opencode/skills/ and loaded automatically.

Disable external skills

Disable Claude Code/Agent compatible skill directories:
This disables scanning of .claude/skills/ and .agents/skills/ directories.

Skill content structure

The content of your SKILL.md (after the frontmatter) contains instructions for the agent.

Best practices

Be specific about what the skill does:
Explain when to use the skill:
Provide context and constraints:
Include examples:
Create release:

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
  1. Check that frontmatter includes name and description
  2. Ensure skill names are unique across all locations
    • Check for duplicate names in global and project skills
    • Later sources override earlier ones
  3. Check permissions—skills with deny are hidden from agents
  4. Verify directory name matches skill name
  5. Check skill name format