Install the opencode-sessions plugin
mainTo use opencode-sessions for multi-agent collaboration and workflow orchestration, add it to your opencode.json configuration file:
{
"plugin": ["opencode-sessions"]
}repository·main·Indexed 17 days ago
https://github.com/malhashemi/opencode-skillsAn Anthropic Agent Skills Specification plugin for OpenCode that enables the discovery and execution of skills via dynamic tool registration using Markdown files. Version 1.0.0 is now deprecated as skills functionality is native to OpenCode (v1.0.190+). The plugin allows creating skills with SKILL.md files containing YAML frontmatter and Markdown instructions, with automatic tool name generation based on directory structure.
To use opencode-sessions for multi-agent collaboration and workflow orchestration, add it to your opencode.json configuration file:
{
"plugin": ["opencode-sessions"]
}If you are using the legacy opencode-skills plugin (pre-v1.0.190), follow these steps to create a skill:
.opencode/skills/ (e.g., .opencode/skills/my-skill).SKILL.md file with YAML frontmatter containing name and description.Example Directory Structure:
my-skill/
├── SKILL.md # Required
├── scripts/ # Optional: Executable code
│ └── helper.py
└── references/ # Optional: Documentation
└── api-docs.mdExample SKILL.md:
---
name: my-skill
description: A custom skill that helps with specific tasks in my project
license: MIT
---
# My Custom Skill
This skill helps you accomplish specific tasks.
## Instructions
1. First, do this
2. Then, do thatmkdir -p .opencode/skills/my-skillAs skills support has become native to OpenCode, you should migrate from the opencode-skills plugin to the native implementation. Follow these three steps:
opencode-skills plugin from your configuration.skill/ (singular) at the project root, whereas the plugin used .opencode/skills/. Move your skill files to the new location.To use the opencode-sessions tool, add it to the plugin array within your opencode.json configuration file.
{
"plugin": ["opencode-sessions"]
}The opencode-skills plugin is deprecated because skills functionality is now built into OpenCode (v1.0.190+). Follow these steps to migrate:
opencode-skills entry from your opencode.json file..opencode/skills/ to skill/ at your project root.~/.opencode/skills/ to ~/.config/opencode/skill.opencode.json instead of the old tools configuration. Use the permission.skill key to allow or deny specific skills.Key Differences Table:
| Aspect | Plugin | Native (v1.0.190+) |
|---|---|---|
| Tool name | skills_my_skill | skill (single tool) |
| Directory | .opencode/skills/ | skill/ |
| Loading | Eager (all at startup) | Lazy (on-demand) |
| Permissions | tools config | permission.skill patterns |
// opencode.json
{
- "plugin": ["opencode-skills"]
}
// New permission structure
{
+ "permission": {
+ "skill": {
+ "my-skill": "allow",
+ "*": "deny"
+ }
+ }
}The plugin searches for SKILL.md files in several locations. If duplicate tool names are found, the location with the highest priority wins.
Discovery Order (Lowest to Highest Priority):
$XDG_CONFIG_HOME/opencode/skills or ~/.config/opencode/skills~/.opencode/skills$OPENCODE_CONFIG_DIR/skills (if OPENCODE_CONFIG_DIR is set)[project_root]/.opencode/skillsThe plugin automatically generates tool names for the agent based on the directory structure relative to the skill's base directory. The pattern is skills_{{path_components_joined_by_underscore}}, where hyphens in directory names are replaced with underscores.
Examples:
.opencode/skills/brand-guidelines/SKILL.md $\rightarrow$ skills_brand_guidelines.opencode/skills/document-skills/docx/SKILL.md $\rightarrow$ skills_document_skills_docxIn OpenCode v1.0.190+, permissions for the skill tool are managed via the permission.skill object in opencode.json. This allows you to use pattern-based matching to control access. Use allow to grant access and deny to restrict it.
Example configuration to allow a specific skill while denying all others:
{
"permission": {
"skill": {
"my-skill": "allow",
"*": "deny"
}
}
}The opencode-skills plugin implements Anthropic's Agent Skills Specification. To create a skill, you must create a SKILL.md file within a directory. The directory name must match the name field in the YAML frontmatter.
name: Must be lowercase alphanumeric with hyphens (e.g., my-skill).description: Must be at least 20 characters long.license: (Optional) String.allowed-tools: (Optional) Array of strings.metadata: (Optional) Key-value pairs.---
name: brand-guidelines
description: Provides the official brand colors and typography rules.
license: MIT
---
# Brand Guidelines
Use #FF5733 for primary buttons.Common issues when using the opencode-skills plugin:
SKILL.md exists in discovery paths (.opencode/skills/, ~/.opencode/skills/, or ~/.config/opencode/skills/).name in SKILL.md matches the directory name exactly.SKILL.md are relative to the skill directory.[a-z0-9-]+).cat ~/.cache/opencode/node_modules/opencode-skills/package.json | grep versionrm -rf ~/.cache/opencode and then restart OpenCode.When using the opencode-skills plugin, tool names are automatically generated based on your directory structure. To ensure compatibility, follow these rules:
my-skill).name: Must match the directory name exactly.skills_ (e.g., skills_my_skill).| Directory | Frontmatter Name | Tool Name |
|---|---|---|
brand-guidelines/ | brand-guidelines | skills_brand_guidelines |
tools/analyzer/ | analyzer | skills_tools_analyzer |
The Skill interface defines the structure of a parsed skill discovered by the plugin. Each skill is derived from a SKILL.md file containing YAML frontmatter and Markdown content.
Key properties include:
name: The identifier from frontmatter (must be lowercase alphanumeric with hyphens).toolName: The automatically generated tool name used by the agent (e.g., skills_brand_guidelines).description: The skill's purpose, used for agent discovery.content: The raw Markdown body of the skill.fullPath: The directory containing the skill.path: The absolute path to the SKILL.md file.export interface Skill {
name: string // From frontmatter (e.g., "brand-guidelines")
fullPath: string // Full directory path to skill
toolName: string // Generated tool name (e.g., "skills_brand_guidelines")
description: string // From frontmatter
allowedTools?: string[] // Parsed but not enforced (agent-level restrictions instead)
metadata?: Record<string, string>
license?: string
content: string // Markdown body
path: string // Full path to SKILL.md
}