
OpenCode packages reusable agent instructions as skills: folders containing a single SKILL.md file with YAML frontmatter and a markdown body. The format matters because instruction-heavy prompts compete for the same context window as code and tool output, and because instructions bound to one provider become dead weight the moment a project switches models. OpenCode's progressive loading keeps installed skills at roughly a hundred tokens each until the agent decides one is relevant, and the markdown-based design means the same file works against any of the 75+ providers the harness supports. This article walks through the SKILL.md structure, the six directories OpenCode scans, the mechanics of on-demand loading, and the authoring habits that keep skills portable across models and coding agents. It is aimed at solo engineers who maintain their own instruction libraries across personal and client projects. Directory paths, frontmatter fields, and token estimates are version-sensitive and should be checked against current documentation.

OpenCode treats a skill as a self‑contained folder that holds exactly one file – SKILL.md. There is no separate manifest, build script, or JSON config; the entire specification lives in this markdown document. When OpenCode scans its skill directories it reads only the YAML front‑matter of each file (about a hundred tokens), keeping startup cheap. The full markdown body is fetched later, only if the agent decides the skill matches the current task.
| Field | Required? | Notes |
|---|---|---|
name | Yes | Must follow the pattern ^[a-z0-9]+(-[a-z0-9]+)*$ – lowercase alphanumerics separated by single hyphens, no leading, trailing, or double hyphens. The value must be identical to the containing folder name. |
description | Yes | Up to 1,024 characters. Serves as the routing signal the agent uses to decide relevance. |
license | No | Free‑form string (e.g., MIT). |
compatibility | No | Indicates provider versions the skill has been tested against. |
metadata | No | A free string‑to‑string map for ownership, version tags, or any custom data. |
Only the five fields above are interpreted by OpenCode; any additional keys are silently ignored, allowing developers to embed tooling‑specific metadata without breaking loading source.
Everything that follows the closing --- of the front‑matter is plain markdown. The agent reads this section solely when the skill activates, so it can contain detailed procedures, coding standards, or worked examples without contributing to the initial token budget. This design enables dozens of skills to be installed simultaneously while keeping the prompt size low source.
The recognised field set, the naming regex, and the 1,024‑character cap are subject to change in future OpenCode releases. Authors should validate their SKILL.md files against the latest skills documentation before relying on them in automation pipelines.
By adhering to this minimal yet strict layout—single file, strict front‑matter, and markdown body—skills remain portable across the 75+ providers OpenCode supports, and they stay lightweight enough for progressive loading to stay effective.

OpenCode discovers reusable instructions by scanning six predefined locations, three scoped to the current project and three scoped to the user’s home directory. The layout looks like this:
| Scope | OpenCode‑native | Claude‑compatible | Agent‑standard |
|---|---|---|---|
| Project | .opencode/skills/ | .claude/skills/ | .agents/skills/ |
| Global | ~/.config/opencode/skills/ | ~/.claude/skills/ | ~/.agents/skills/ |
The global OpenCode directory is ~/.config/opencode/skills/, not ~/.opencode/skills/ – a frequent error in third‑party guides [1].
When you start a session, OpenCode:
skills/*/SKILL.md inside the three project‑scoped folders listed above.Any matching SKILL.md files are added to the skill catalogue with only their name and short description (≈ 100 tokens each). The full markdown body is fetched later only if the agent explicitly requests the skill [2].
| Directory | Typical use | Why choose it |
|---|---|---|
.opencode/skills/ (repo‑level) | Project conventions, code‑base‑specific helpers, team‑reviewed instructions | Versioned with the code, reviewed in pull requests, guarantees that every collaborator sees the same skill set. |
~/.config/opencode/skills/ (global) | Personal session habits (e.g., a “debug‑session” checklist or a preferred linting workflow) | Follows you across all repositories, avoids cluttering each project with personal tweaks. |
.agents/skills/ (repo‑level) | Skills that should be visible to any compatible coding agent (Claude, Gemini, etc.) | Implements the open “Agent Skills” standard, so the same folder can be used by other agents without conversion. |
Because each location stores plain SKILL.md files, a skill authored for Claude Code (.claude/skills/.../SKILL.md) works unchanged in OpenCode’s native runtime—the file format and discovery mechanism are identical [1]. This model‑agnostic design lets you maintain a single instruction library while switching between providers.
Practical tip: keep project‑specific skills under .opencode/skills/ so they live in the same Git history as the code they support, and reserve ~/.config/opencode/skills/ for personal shortcuts that you don’t want to commit. When you need a skill to be reusable by other agents, place it in .agents/skills/ (or the matching global path) and the same SKILL.md will be discovered automatically.

When a session starts, OpenCode walks through every installed skill folder and reads only the YAML front‑matter – the name and description fields. This lightweight snapshot is injected into the model via the native skill tool definition and typically occupies ≈ 100 tokens per skill — a figure reported by third‑party benchmarks and noted as version‑sensitive [1][2]. No full instruction bodies or auxiliary files are loaded at this stage.
On each turn the model evaluates the compact list against the current task. If a skill appears relevant, the model issues a call such as:
skill({ "name": "data‑validation" })
The tool then streams the complete markdown body of that SKILL.md into the conversation. Only at this point does the instruction payload consume context. Supporting assets—scripts, reference files, or external documentation—form a third tier; they are fetched only when the agent explicitly reads them.
The token savings are arithmetic. With 20 installed skills, the standing cost is roughly 20 × 100 ≈ 2 000 tokens. If every full body (often several hundred tokens) were injected unconditionally, the same library could exceed tens of thousands of tokens, quickly exhausting the LLM’s context window. Consequently, unused skills never touch the prompt, keeping a personal skill library practical for solo engineers.
This design does have a caveat: selection relies on the model’s judgment of the brief description. An inaccurate or overly vague description can lead to either silent non‑activation (the skill never matches) or an unnecessary load (wasting tokens on a mis‑chosen skill). Authors therefore invest effort in clear, concise front‑matter as the primary gatekeeper for on‑demand activation.

OpenCode’s native skill tool examines every installed skill at each turn and pattern‑matches the description field against the user’s utterance. Aside from the skill’s name, the description is the sole routing signal that tells the model whether a skill is relevant — making it the highest‑leverage sentence in the entire SKILL.md file【1†L9-L12】.
skill({ name: "…" }) and loads the full markdown body on demand【2†L3-L7】.Treat the description as a trigger condition:
Use when the user asks to scrape a URL, crawl a documentation site, or extract structured data from a webpage.
Contrast this with a vague claim such as “helps with web tasks,” which frequently fails to activate because the pattern match is too broad【4†L9-L13】.
scrape, crawl, extract, search, download.URL, documentation site, webpage, HTML table.“fetch the latest API docs”, “grab the table from this page”).A skill that tries to cover multiple workflows (e.g., scraping, form filling, and PDF conversion) will fire for any of them, leaving the model unable to decide which sub‑procedure to run. The result is nondeterministic activation and wasted context. Keeping each skill narrowly scoped to a single job prevents this ambiguity【4†L14-L18】.
.opencode/skills).skill tool call).If the description is too broad—e.g., “handles any web operation”—the skill will load on unrelated turns, silently consuming the context window and degrading overall performance. Monitoring tool calls during the test protocol quickly reveals such over‑triggering, allowing you to tighten the description back to a precise trigger.
By treating the description as a deterministic routing rule—specific, single‑purpose, and empirically verified—you ensure that OpenCode’s progressive loading stays efficient and that each skill remains portable across the 75 + model providers supported by the harness.

OpenCode treats a skill as plain‑text markdown that is injected into the conversation exactly like any other user‑generated message. Because the skill tool lives inside OpenCode’s harness, the model never sees a provider‑specific SDK or compiled artefact—only the SKILL.md body (YAML front‑matter plus markdown instructions). Any LLM that can parse markdown and issue a tool call (skill({ name: "…" })) can therefore consume the skill, regardless of whether it is Anthropic Claude, OpenAI GPT‑4/5, Google Gemini, xAI, Moonshot Kimi, an OpenAI‑compatible endpoint, or a locally‑hosted model via Ollama. The provider‑agnostic nature comes from OpenCode’s provider layer, which abstracts all 75+ vendors through the AI SDK and Models.dev aggregation service OpenCode models documentation.
SKILL.md files work immediately.While the format survives provider changes, instruction fidelity does not. A weaker model may misinterpret nuanced directives or ignore tool calls altogether. To maximise cross‑model reliability, authors should:
skill tool”) so that every supported model can map them to its own API.By keeping skills as lightweight markdown, OpenCode ensures that the structure of an engineer’s instruction library is stable across any of the supported providers, while still leaving room for quality variations that depend on the chosen model’s capabilities.

The Agent Skills open specification (hosted at agentskills.io) defines a single SKILL.md file with required YAML front‑matter (name, description) and a markdown body that describes the task. Because OpenCode scans the directories
.claude/skills/.agents/skills/both inside the project and in the user’s home (~/.claude/skills/, ~/.agents/skills/) see Firecrawl’s guide, any skill written to the spec is discovered automatically, regardless of whether the runtime agent is Claude Code, an OpenAI‑based Codex CLI, or any of the 40+ agents that have announced support Pinggy blog. The result is tool‑agnosticism: a single folder can be installed once and used by every compatible coding agent without modification.
For a solo engineer the calculus flips. The time spent crafting a well‑structured SKILL.md is reclaimed each time another agent loads the same file. If you maintain a personal library of, say, 30 reusable skills, each skill can be invoked by any of the agents you switch between—Claude Code, Gemini CLI, Cursor, etc.—turning one hour of writing into potentially dozens of hours of saved context‑budget and debugging effort across projects.
Portability is not implicit. The markdown body must stay within the bounds of the open spec; any reference to OpenCode‑only runtime hooks (e.g., the skill tool’s internal permission flags) will be ignored or cause errors on agents that do not expose those flags. To make intent clear, the optional compatibility field in the front‑matter can list target agents (e.g., compatibility: ["claude", "openai", "gemini"]). This field is advisory—agents that do not recognise it simply ignore it—yet it documents the author’s intention and helps reviewers spot non‑portable constructs.
name, description, and optionally compatibility.{{runtime.option}}.By adhering to these guidelines, a developer creates portable skills that benefit from the network effect of the open standard: anyone who publishes a useful skill can see it consumed by the growing ecosystem, and every consumer enjoys a reduced “setup cost” for new projects. This virtuous loop is the core payoff of OpenCode’s alignment with the Agent Skills open specification.

OpenCode’s progressive‑loading model reads only a skill’s name and description (≈ 100 tokens) at startup; the full instruction body is injected only when the agent deems the skill relevant 【2†source】. Because unused skills never enter the context window, the most effective way to keep token pressure low is to make the SKILL.md itself lean and move heavyweight material into companion files that load on demand.
| Sub‑directory | Purpose | Typical token impact |
|---|---|---|
scripts/ | Deterministic code (parsing, validation, sorting, CLI helpers). Executable files are run by the model rather than reasoned about, which is cheaper and more reliable 【3†source】. | |
references/ | Long‑form documentation, templates, edge‑case tables, lookup data. These files are read only when the skill explicitly references them, so their tokens are charged only on demand. | |
assets/ | Static resources (icons, config snippets, sample data). Treated as opaque blobs; loading occurs via @‑style file inclusion to avoid scanning the whole repository 【5†source】. |
These conventions are part of the Agent Skills specification, not a hard OpenCode rule, so treat them as community best practice and document the intent in your own readme.
references/; reference them with a clear marker (e.g., {{ load: references/edge‑cases.md }}) so the model knows when to fetch the extra tokens.@ syntax when you need the exact content of a file, which loads the file directly without scanning unrelated files, saving thousands of tokens 【5†source】..project-conventions/
├── SKILL.md
├── scripts/
│ └── validate‑naming.py
├── references/
│ └── style‑guide.md
└── assets/
└── eslint‑config.json
SKILL.md
---
name: project-conventions
description: >-
Activate when the user asks about stack choices, folder layout, or coding
standards for this repo.
trigger: "project conventions"
---
## Stack
React + TypeScript + Redux Toolkit.
## Folder architecture
- src/
- entities/
- features/
- pages/
## Code standards
- Use functional components only.
- Follow BEM naming for CSS modules.
> For detailed lint rules and naming edge cases see `{{ load: references/style-guide.md }}`.
> Validation of file names can be run with `{{ run: scripts/validate-naming.py }}`.
The body supplies only the essential, high‑level guidance. All detailed patterns, rule tables, and deterministic validation live in the referenced files, ensuring that the skill occupies roughly a hundred tokens until the agent explicitly pulls the extra context. This pattern maximises portability across the 75+ providers supported by OpenCode while keeping the runtime token budget minimal.

OpenCode’s skill system can be curbed at the source‑file level so the agent only sees what you intend. The primary control surface is opencode.json under the permission.skill key. Here you map skill‑name patterns (wildcards such as internal-* are allowed) to one of three actions:
| Action | Effect |
|---|---|
allow | Skill is visible and can be loaded automatically when the model deems it relevant. |
deny | The skill is completely omitted from the routing list—it never appears as a candidate for loading, eliminating any context cost. |
ask | The agent asks for human approval before pulling the skill’s body into the session. |
These rules are evaluated before any on‑demand load, so a deny entry removes the skill from the routing table rather than merely blocking it at load time 【1†https://nodemaven.com/blog/best-opencode-skills/】.
The same permission.skill block can be overridden per agent configuration. Setting tools: { skill: false } in an agent’s config disables the whole skill subsystem for that agent, which is useful when a project relies on a single, highly‑specialised instruction set. Different agents in the same code base can thus expose distinct skill portfolios without touching the global opencode.json 【1†https://nodemaven.com/blog/best-opencode-skills/】.
Even when a skill is not matched by the model’s relevance heuristic, you can force its loading by naming it directly in a prompt, e.g., skill({ name: "sql‑builder" }). This bypasses the automatic selection logic and injects the full markdown body immediately. Use this sparingly; each forced load consumes roughly a hundred tokens regardless of relevance.
OpenCode does not yet provide a unified install command. Skills arrive via:
opencode skills CLI,curl | sh style install script,git clone into one of the six watched directories.After any addition, the OpenCode process must be restarted so it rescans the directories and updates the internal skill catalog. Failure to restart leaves newly added skills invisible to the runtime 【2†https://www.firecrawl.dev/blog/best-opencode-skills】.
deny for any skill that surfaces on irrelevant turns; it removes the token overhead altogether.ask for experimental skills – this gives you a safety net without fully committing them to the context.opencode.json so the reasoning behind differing skill sets is clear.By combining granular permission rules, explicit loading, and disciplined install/re‑scan cycles, solo engineers can keep their instruction libraries lean, portable, and truly model‑agnostic.