load_skills parameter. They support YAML frontmatter configuration, markdown content, and embedded MCP server definitions.
Skill Anatomy
A skill is a.md file with YAML frontmatter:
Frontmatter Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Skill identifier (kebab-case) |
description | string | Yes | Brief skill description for agent selection |
mcp_servers | array | No | Embedded MCP server definitions |
permissions | object | No | Tool restrictions for this skill |
category | string | No | Suggested delegation category |
File Structure
Place skills in.opencode/skills/ directory:
Loading Skills
Skills are loaded via thetask tool’s load_skills parameter:
Embedded MCP Servers
Skills can bundle MCP servers that become available when the skill is loaded.MCP Configuration Schema
Stdio MCP Example
Permission Management
Restrict tool access within skills using thepermissions field:
allow: Explicitly allow (default)deny: Block tool usage
Skill Content Patterns
Role Definition
Phase-Based Workflows
PHASE 2: CLASSIFY
| Type | Detection | Action |
|---|---|---|
| BUG | Title contains [Bug] | SUBAGENT_BUG |
- Read the issue carefully
- Search the codebase for relevant code
- Determine outcome:
Built-in Skill Examples
From the source repository:github-triage Skill
Location:.opencode/skills/github-triage/SKILL.md
Features:
- Parallel background task spawning (1 task per issue/PR)
- Uses
category="free"for cost-effective processing - Structured prompt templates for each issue type
- Result tracking via
TaskCreate/TaskUpdate
Skill Discovery
Oh My OpenCode discovers skills from:- Project skills:
.opencode/skills/*/SKILL.md - Built-in skills: Bundled with the plugin
- Config registration:
oh-my-opencode.jsonc
Registering External Skills
Skill Resolver
Theskill-resolver.ts module handles skill loading:
src/features/opencode-skill-loader/skill-content.ts
Best Practices
IF YES (condition met):
Step A: Do X
Step B: Run command: `cmd`
Step C: Report back with EXACT format:
ACTION: COMPLETED
SUMMARY: [description]
MCP Lifecycle
TheSkillMcpManager handles embedded MCP servers:
Source: src/features/skill-mcp-manager/index.ts
Accessing MCP Tools
Environment Variables
Use${VAR} syntax in MCP configurations:
Disabling Skills
Disable skills globally via config:Testing Skills
Test skills in isolation using theskill tool:
Related Files
- Skill Loader:
src/features/opencode-skill-loader/skill-content.ts - MCP Manager:
src/features/skill-mcp-manager/index.ts - Skill Tool:
src/tools/skill/tools.ts - Agent Builder:
src/agents/agent-builder.ts(skill injection)