Fetches and reads the latest OpenCode documentation from the official repository to stay current with features, best practices, and configuration options...
This skill provides a systematic approach to fetching and reading the latest OpenCode documentation from the official repository. Use this to stay current with OpenCode features, understand new capabilities, and ensure configurations follow the latest best practices.
Core principle: Always reference the latest official documentation when working with OpenCode configurations.
Announce at start: "I'm using the fetch-opencode-docs skill to get the latest OpenCode documentation."
Load this skill when:
All OpenCode documentation source files are in the production branch at:
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/
Why use raw MDX files instead of rendered HTML?
Introduction: index.mdx
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/index.mdxConfiguration Guide: config.mdx
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/config.mdxAgents Guide: agents.mdx
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/agents.mdxSkills Guide: skills.mdx
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/skills.mdxCommands Guide: commands.mdx
command)https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/commands.mdxTools Guide: tools.mdx
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/tools.mdxPermissions Guide: permissions.mdx
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/permissions.mdxModels Guide: models.mdx
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/models.mdxtui.mdxcli.mdxproviders.mdxthemes.mdxkeybinds.mdxformatters.mdxmcp-servers.mdxcustom-tools.mdxlsp.mdxrules.mdxAll additional resources follow the same URL pattern:
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/<filename>.mdx
Determine what information you need:
Use the webfetch tool to retrieve raw MDX files from the production branch:
# Fetch as text (recommended - clean MDX format)
webfetch url="https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/agents.mdx" format="text"
# Fetch config guide
webfetch url="https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/config.mdx" format="text"
# Fetch skills guide
webfetch url="https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/skills.mdx" format="text"
Note on MDX syntax: The files contain minimal MDX-specific syntax:
:::tip, :::note, :::caution - Treat as informational calloutstitle="filename" - Standard markdown with metadataFocus on the specific sections needed:
Use the documentation to:
Question: What tools are available for agents?
Fetch: https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/tools.mdx
Key info: Built-in tools include bash, edit, write, read, grep, glob, list, lsp, patch, skill, todowrite, todoread, webfetch, plus custom tools and MCP server tools
Question: How do I configure tool permissions?
Fetch: https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/permissions.mdx
Key info: Three levels (allow, ask, deny), pattern matching for bash commands, global and per-agent configuration
Question: What's the required structure for a skill?
Fetch: https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/skills.mdx
Key info:
skill/<name>/SKILL.mdname and descriptionQuestion: What template variables are available?
Fetch: https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/commands.mdx
Key info:
$ARGUMENTS - All arguments as string$1, $2, etc. - Individual positional arguments!command`` - Shell command output interpolation@filename - File content referencesQuestion: How do I specify a different model?
Fetch:
https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/models.mdxhttps://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/config.mdxKey info:
provider/model-id (e.g., anthropic/claude-sonnet-4-5)model and small_model in configBase URL: https://raw.githubusercontent.com/sst/opencode/production/packages/web/src/content/docs/
| Need | File | Key Sections |
|---|---|---|
| Getting started | index.mdx |
Install, Configure, Usage |
| Agent setup | agents.mdx |
Types, Built-in, Options, Examples |
| Skill creation | skills.mdx |
Structure, Frontmatter, Permissions |
| Command syntax | commands.mdx |
Templates, Variables, Interpolation |
| Tool configuration | tools.mdx |
Built-in tools, Custom, MCP |
| Permissions | permissions.mdx |
Levels, Patterns, Configuration |
| Config file | config.mdx |
Schema, Locations, All options |
| Models & providers | models.mdx |
Provider setup, Model selection |
| Custom tools | custom-tools.mdx |
Creating custom tools |
| MCP servers | mcp-servers.mdx |
Integration with MCP |
| TUI usage | tui.mdx |
Terminal interface, Commands |
| CLI usage | cli.mdx |
Command-line interface |
| Formatters | formatters.mdx |
Code formatting configuration |
| Keybinds | keybinds.mdx |
Keyboard shortcuts |
| Themes | themes.mdx |
Theme configuration |
If webfetch fails:
Example:
ā ļø Unable to fetch latest documentation. Using cached knowledge.
Please verify at: https://opencode.ai/docs/ or
https://github.com/sst/opencode/tree/production/packages/web/src/content/docs
If specific doc doesn't exist:
Never create configurations from memory alone:
ā Fetch docs ā Review syntax ā Create config
ā Create config ā Hope it works
When using examples from docs:
OpenCode evolves rapidly:
Validate information across multiple sources:
User: "Create an agent for code review"
You: I'm using the fetch-opencode-docs skill to get the latest OpenCode documentation.
[Fetch agents.mdx from production branch]
[Fetch config.mdx for configuration options]
[Review examples in agents.mdx for code-review patterns]
Based on the latest documentation:
- Agents require 'description' in frontmatter (mode defaults to 'all')
- Code review agents typically use: read, grep, bash tools
- Permission level 'ask' recommended for edit operations
- Temperature 0.1-0.3 recommended for analytical tasks
- Example security-auditor agent shows best practices
[Proceed with configuration creation using validated information]
Never:
Always:
---
description: Brief description (required)
mode: primary|subagent|all (defaults to 'all')
model: provider/model-id
temperature: 0.0-1.0
maxSteps: positive integer
tools:
read: true
write: false
bash: true
permission:
edit: allow|ask|deny
bash:
"git *": allow
"*": ask
webfetch: deny
---
---
name: skill-name (required, must match directory)
description: What this skill does (required, 1-1024 chars)
license: MIT (optional)
compatibility: opencode (optional)
metadata: (optional, string-to-string map)
key: value
---
# Skill Title
## Overview
## When to Use
## Instructions
## Examples
---
template: Command template with $ARGUMENTS (required)
description: What this command does (optional)
agent: which-agent-handles-it (optional)
subtask: true|false (optional)
model: provider/model-id (optional)
---
If version-specific features are mentioned:
Track when features were introduced:
This skill ensures you always work with the latest, most accurate OpenCode documentation. By systematically fetching and applying official documentation, you create reliable, standards-compliant configurations that leverage the full power of OpenCode.
Remember: OpenCode is actively developed. Always fetch the latest documentation rather than relying on cached knowledge.