Skills

Skills are reusable instruction sets that provide domain-specific workflows and guidance to OpenCode AI agents. They are stored as SKILL.md files and can be scoped globally or per-project.

Scopes

ScopeLocationDescription
Global$WORKSPACE_PATH/.config/opencode/skills/<name>/SKILL.md (defaults to ./workspace/.config/opencode/skills/)Available across all repositories
Project<repo>/.opencode/skills/<name>/SKILL.mdScoped to a specific repository

When sandboxing is enforced, only the global skills directory is mounted into the microVM; project skills are reachable only through the session's own repository mount. A global skill that bundles scripts or reference files can therefore run them from a sandboxed shell call, while a project skill is visible only in a session working in that repository. Because the global mount is writable, an agent command can also modify a global skill, which affects every later session in every repository.

Skill File Format

Each skill is a SKILL.md file with YAML frontmatter and a markdown body:

---
name: my-skill
description: Short description of what this skill does
---
Your skill instructions go here. This is the content that gets
injected into the AI agent's context when the skill is loaded.

Frontmatter Fields

FieldRequiredDescription
nameYesLowercase alphanumeric with hyphens (e.g., my-skill). Max 64 characters.
descriptionYesWhat the skill does. Max 1024 characters.

Naming Rules

Skill names must match the pattern ^[a-z0-9]+(-[a-z0-9]+)*$:

  • Lowercase letters and numbers only
  • Hyphens allowed between words
  • No spaces, underscores, or uppercase letters
  • Examples: test-skill, code-review, deploy-helper

Managing Skills

Create and edit skills in Settings → OpenCode Config → Skills. The Skills tool in a repository's tool rail (desktop) or More drawer (mobile) lists the skills available there and can install, delete, and load them into a session. Skills can also be managed through the API.

Skills Manager

API Endpoints

All paths are relative to /api/settings. repoId is required whenever scope=project.

MethodPathDescription
GET/skillsList all skills (optional ?repoId= or ?directory= filter)
POST/skills/installInstall a skill from a GitHub URL (JSON body with sourceType: "github", url, scope, repoId, overwrite) or from uploaded files (multipart form)
GET/skills/:nameGet a specific skill (requires scope query param)
POST/skillsCreate a new skill
PUT/skills/:nameUpdate an existing skill (requires scope query param)
DELETE/skills/:nameDelete a skill (requires scope query param)

Creating, updating, installing, or deleting a skill reloads OpenCode so the change applies on the next message; the response's restartRequired is true only when that reload fails. Creating a name that already exists returns 409; reading, updating, or deleting a skill that does not exist returns 404.

Create Request

{
  "name": "my-skill",
  "description": "Runs type check and lint",
  "body": "Instructions for the AI agent...",
  "scope": "global"
}

repoId is required when scope is "project".

Update Request

All fields are optional. Omit fields you do not want to change.

{
  "description": "Updated description",
  "body": "Updated instructions"
}