Overview
Theskill tool loads specialized instructions from skills and slash commands. Skills provide detailed step-by-step guidance, embedded MCP servers, and domain-specific knowledge for specific tasks.
Source: src/tools/skill/
Skill vs command
| Type | Format | Purpose |
|---|---|---|
| Skill | SKILL.md file | Full instructions with MCP servers, multi-step guidance |
| Command | Template file | Quick commands with argument interpolation |
Parameters
The skill or command name (without leading slash for commands)Examples:
"code-review"- Load code-review skill"publish"- Load /publish command (omit the slash)"mintlify"- Load Mintlify documentation skill
Optional arguments or context for command invocationUsed for slash commands that accept arguments:Example:The user_message is interpolated into command templates.
Response
Skill instructions or command templateSkill example:Use
skill_mcp tool with mcp_name="github-api" to invoke.Skill discovery
Skills are discovered from multiple locations with priority:- Project (
.opencode/skills/) - Highest priority - User (
~/.config/opencode/skills/) - OpenCode (
.opencode-project/skills/) - Built-in (plugin’s builtin skills) - Lowest priority
Skill format
Skills are defined inSKILL.md files:
YAML frontmatter
name- Skill identifier (required)description- Short description for tool listingcompatibility- Compatibility noteslicense- License identifiermcp_servers- Embedded MCP server configs (optional)agent- Restrict to specific agent (optional)allowed_tools- List of allowed tools (optional)
MCP servers
Skills can embed MCP servers that are automatically loaded when the skill is invoked:Command format
Commands are template files in.opencode/commands/ or ~/.config/opencode/commands/:
Template variables
{{USER_MESSAGE}}- Replaced withuser_messageparameter{{REPO_NAME}}- Repository name{{BRANCH_NAME}}- Current branch
Usage patterns
Load skill for task context
Execute command with arguments
Load skill with MCP servers
Delegate with skill loading
Prefer loading skills via thetask tool instead:
Agent restrictions
Skills can restrict which agents can load them:Tool restrictions
Skills can specify allowed tools:Error handling
Skill not found
Partial match suggestions
MCP connection failure
Disabled skills
Skills can be disabled in configuration:Built-in skills
Oh My OpenCode includes several built-in skills:mintlify- Mintlify documentation site authoringdoc-reader- External documentation navigationdoc-author- Documentation writing and editingupdate-nav- Update docs.json navigationgit-master- Git workflow automation
MCP integration
When a skill with MCP servers is loaded:- MCP servers are automatically started
- Tool lists tools, resources, and prompts
- Use
skill_mcpto invoke MCP capabilities - Servers are cleaned up when session ends
Implementation details
Lazy loading
Skill content is loaded lazily when the skill is invoked, not when the tool is registered. This improves plugin startup performance.Scope priority
When multiple skills have the same name, the highest priority scope wins:Description caching
Skill descriptions are cached for fast tool description generation. Cache is invalidated when skills change.Git-master config injection
Thegit-master skill receives special handling:
Related tools
- task - Delegate with skill loading
- skill_mcp - Invoke skill MCP capabilities
- slashcommand - Execute slash commands (deprecated, use skill instead)