opencode-mastery — Claude Code skill: what it does, how to install
opencode-mastery accesses official OpenCode documentation in real time via the Context7 API and manages project preferences in local memory.
MIT 1 installs updated 2026-02-21
npx skills add digi4care/opencode-mastery --skill opencode-mastery -a claude-codeWhat opencode-mastery does
The skill pulls live docs from the anomalyco/opencode repository using Context7 semantic search. When an internet connection drops, it falls back to a local cache in ~/.ai_docs/opencode/ governed by a 7-day TTL. Built-in tools allow querying CLI flags, SDK references, and plugin authoring guidelines.
It also handles persistent session memory inside .memory.md. Dedicated tools track architectural decisions or runtime preferences and compact the file once it exceeds 50KB. The skill targets OpenCode architecture exclusively, ignoring general app debugging or standalone frontend frameworks.
What it helps with
- inspect OpenCode CLI arguments and syntax directly from official references
- generate boilerplate for skills, tools, and plugins using official patterns
- retain tech stack decisions and user preferences in project memory
- compress large
.memory.mdrecords once storage crosses 50KB
Example prompts for the agent
- Show me how to define a plugin tool with Zod schema in OpenCode
- Search OpenCode documentation for SKILL.md frontmatter parameters
- Remember that this project uses Bun instead of npm under preference category
How to install opencode-mastery
1Skills CLI (Vercel)
npx skills add digi4care/opencode-mastery --skill opencode-mastery -a claude-code2Manually: put the files in place
~/.claude/skills/opencode-mastery/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/opencode-mastery/
1Skills CLI (Vercel)
npx skills add digi4care/opencode-mastery --skill opencode-mastery -a codex2Manually: put the files in place
.agents/skills/opencode-mastery/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add digi4care/opencode-mastery --skill opencode-mastery -a cursor2Manually: put the files in place
.cursor/skills/opencode-mastery/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install digi4care/opencode-mastery src/skill/opencode-mastery2Manually: put the files in place
.github/skills/opencode-mastery/SKILL.md1Skills CLI (Vercel)
npx skills add digi4care/opencode-mastery --skill opencode-mastery -a gemini-cli2Platform CLI
gemini skills install https://github.com/digi4care/opencode-mastery --path src/skill/opencode-masteryManually: put the files in place
.devin/skills/opencode-mastery/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add digi4care/opencode-mastery --skill opencode-mastery -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about opencode-mastery
How to install opencode-mastery in Claude Code?
Run npx skills add digi4care/opencode-mastery --skill opencode-mastery -a claude-code in your terminal.
What does opencode-mastery do?
It queries live OpenCode documentation through Context7 and manages contextual project preferences in .memory.md.
How does offline documentation work?
Cached markdown files are stored in ~/.ai_docs/opencode/ with a 7-day cache TTL and fuzzy search support.
Source text
SKILL.md · MIT
---
name: opencode-mastery
description: Complete OpenCode knowledge base with live documentation access. Use for questions about OpenCode CLI, skills, plugins, tools, agents, SDK, or configuration. Automatically searches official docs via Context7 API with local fallback.
license: MIT
compatibility: opencode
metadata:
author: OpenCode Community
version: "2.0.0"
source: https://github.com/anomalyco/opencode
---
# OpenCode Mastery
I have direct access to OpenCode documentation via tools.
## When to Use Me
Use me for:
- Questions about OpenCode CLI commands and options
- How to create/use skills, plugins, tools, agents
- SDK documentation and API reference
- Configuration and setup questions
- Best practices and patterns
Do not use me for:
- General programming questions
- Framework-specific questions (Svelte, React, etc.)
- Debugging your application code
## Available Tools
| Tool | Purpose |
| ---------------- | ----------------------------------- |
| `searchDocs` | Search OpenCode documentation |
| `downloadDocs` | Download/update local documentation |
| `memoryStatus` | Check project memory status |
| `memoryRemember` | Store info for future sessions |
| `memoryCompact` | Compact large memory files |
## Workflow
When asked about OpenCode:
1. **Search documentation automatically**
```
searchDocs({ query: "skills", source: "both", maxResults: 5 })
```
2. **Return accurate information**
- Cite sources (Context7 or local)
- Provide code examples from docs
- Link to relevant documentation
3. **Remember important context**
```
memoryRemember({ content: "User prefers TypeScript", category: "preference" })
```
## Documentation Sources
1. **Context7 (Primary)** - Live docs from `/anomalyco/opencode`
- Always up-to-date
- Semantic search
- API-based access
2. **Local (Fallback)** - Cached docs in `~/.ai_docs/opencode/`
- Updated via `downloadDocs` tool
- 7-day cache TTL
- Fuzzy search
## Memory Management
Project memory is stored in `.memory.md`:
- **Check status**: `memoryStatus()`
- **Store info**: `memoryRemember({ content: "...", category: "preference" })`
- **Compact**: `memoryCompact()` when over 50KB
Categories: `preference`, `pattern`, `correction`, `context`, `decision`
## Examples
### Search for Skills Documentation
```
searchDocs({ query: "skills SKILL.md frontmatter", maxResults: 3 })
```
### Search for Plugin Tools
```
searchDocs({ query: "plugin tool zod schema", maxResults: 5 })
```
### Remember a Preference
```
memoryRemember({
content: "User prefers Bun over npm for JavaScript",
category: "preference",
priority: "high"
})
```
## References
- `references/registry.json` - Reference index
- `examples/plugins/` - Plugin templates (minimal, intermediate, advanced)
- `examples/tools/` - Tool templates (minimal, intermediate, advanced)
- `examples/skills/` - Skill templates (minimal, intermediate, advanced)
© OpenCode Community · MIT · digi4care/opencode-mastery