Does OpenCode support skill "scripts"? How to define them?
This post might have stale content, as dev is 2000 commits ahead.
does opencode support skill "scripts"? if so, how do i define them? i'm using typescript
I have all the information needed to answer your question.
##Yes, OpenCode supports "skills"!
Skills are reusable instruction files (not executable scripts) that agents can load on-demand. They're defined using Markdown files with YAML frontmatter — not TypeScript.
###How to Define a Skill
-
Create a folder in one of these locations:
.opencode/skill/<name>/SKILL.md(project-level)~/.config/opencode/skill/<name>/SKILL.md(global).claude/skills/<name>/SKILL.md(Claude-compatible, project-level)~/.claude/skills/<name>/SKILL.md(Claude-compatible, global)
-
Write your
SKILL.mdwith YAML frontmatter:
---
name: git-release
description: Create consistent releases and changelogs
license: MIT
---
## What I do
- Draft release notes from merged PRs
- Propose a version bump
- Provide a copy-pasteable `gh release create` command
## When to use me
Use this when you are preparing a tagged release.
###Frontmatter Fields
| Field | Required | Description |
|---|---|---|
name | ✅ | Must be lowercase alphanumeric with hyphens, match the folder name |
description | ✅ | 1-1024 characters, helps agent decide when to use |
license | ❌ | Optional license info |
compatibility | ❌ | Optional compatibility note |
metadata | ❌ | Optional string-to-string map |
###Name Rules
- 1–64 characters
- Lowercase alphanumeric with single hyphens (
^[a-z0-9]+(-[a-z0-9]+)*$) - Must match the directory name
###If You Want Executable TypeScript...
You might be thinking of custom tools or plugins — those are defined in TypeScript/JavaScript:
- Custom Tools:
.opencode/tool/*.ts— define tools the LLM can call - Plugins:
.opencode/plugin/*.ts— hook into OpenCode lifecycle events
Would you like details on either of those instead?
END OF POST