Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

opencode-plugin-test

A test plugin demonstrating OpenCode's native bundled extensions support for commands, skills, agents, and MCP servers.

Features

Agents

AgentDescription
reviewerExpert code reviewer for analyzing code quality and issues
documenterDocumentation specialist for writing clear docs

Commands

CommandDescription
/analyzeAnalyze code for issues and improvements
/explainExplain code or concepts in detail
/test-genGenerate tests for code or functionality

Skills

SkillDescription
git-workflowGit workflow best practices
debuggingSystematic debugging techniques

MCP Servers

ServerDescription
context7Library documentation via Context7

Installation

From Source (Development)

  1. Clone and build:
cd~/Work/opencode-plugin
npm install
npm run build
  1. Add to your .opencode/config.json:
{
"plugin": ["file:///home/ryan/Work/opencode-plugin/dist/index.js"]
}

From npm (After Publishing)

{
"plugin": ["opencode-plugin-test@latest"]
}

Project Structure

src/
agents/ # Agent definitions
reviewer.ts
documenter.ts
index.ts
commands/ # Command definitions
analyze.ts
explain.ts
test-gen.ts
index.ts
skills/ # Skill definitions
git-workflow.ts
debugging.ts
index.ts
mcp/ # MCP server configs
index.ts
index.ts # Main plugin entry

How It Works

This plugin uses OpenCode's native extension bundling:

importtype{Plugin}from"@opencode-ai/plugin";import{reviewer,documenter}from"./agents";import{analyze,explain,testGen}from"./commands";import{gitWorkflow,debugging}from"./skills";import{builtinMcps}from"./mcp";exportconstTestPlugin: Plugin=async(ctx)=>{return{// Native agent registrationagent: {
reviewer,
documenter,},// Native command registrationcommand: {
analyze,
explain,"test-gen": testGen,},// Native skill registrationskill: {"git-workflow": gitWorkflow,
debugging,},// MCP via config hookconfig: async(config)=>{config.mcp=config.mcp||{};for(const[name,mcp]ofObject.entries(builtinMcps)){if(!config.mcp[name]){config.mcp[name]=mcp;}}},};};

Precedence

Extensions are loaded in order (later wins):

  1. Built-in
  2. Plugin-provided (this plugin)
  3. Config-based (~/.config/opencode/)
  4. File-based (.opencode/command/*.md, etc.)

Users can override any plugin-provided extension by creating a file-based version.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages