Skip to content

Opencode

The Idea

Configure skills to auto-load for specific agents via oh-my-opencode.json.

Context

Wanted content-seed harvesting to be always active, not requiring manual /content-seed invocation each session.

Solution: Add skills array to agent config.

Implementation

// ~/.config/opencode/oh-my-opencode.json
{
  "agents": {
    "sisyphus": {
      "model": "...",
      "skills": ["content-seed"]  // ← auto-loads
    }
  }
}

Why It Matters

  • Skills become persistent behaviors, not one-off invocations
  • Enables “always-on” passive agents (harvesters, monitors, etc.)
  • Configuration as behavior definition

Content Angle

  • Tutorial: “Making OpenCode skills always-active”
  • Pattern: “Passive AI behaviors through skill injection”

What Happened

OpenCode config validation failed with “Invalid input mcp.mcp-image” error. The MCP server configuration used wrong schema format.

The Broken Config

"mcp-image": {
  "type": "stdio",           // WRONG
  "command": "npx",          // WRONG
  "args": ["-y", "mcp-image"], // WRONG
  "env": {                   // WRONG field name
    "GEMINI_API_KEY": "...",
    "IMAGE_OUTPUT_DIR": "..."
  }
}

Investigation

  1. First tried adding "type": "stdio" - still failed
  2. Fetched official OpenCode docs at opencode.ai/docs/mcp-servers
  3. Discovered correct schema from docs

Resolution

"mcp-image": {
  "type": "local",                           // local, not stdio
  "command": ["npx", "-y", "mcp-image"],    // array, not separate args
  "environment": {                           // environment, not env
    "GEMINI_API_KEY": "...",
    "IMAGE_OUTPUT_DIR": "..."
  }
}

Key differences:

  • type: "local" not "stdio" (OpenCode terminology)
  • command is a single array including args, no separate args field
  • environment not env for env vars

Lesson

OpenCode MCP schema differs from Claude Desktop’s MCP schema. Always check vendor docs - don’t assume schema compatibility between different MCP hosts.

What Happened

ProviderModelNotFoundError when starting OpenCode. The oh-my-opencode.json config referenced model IDs that don’t exist in the provider definitions.

The Error

ProviderModelNotFoundError
providerID: "google"
modelID: "gemini-3-flash"
suggestions: ["gemini-3-flash-preview", "antigravity-gemini-3-flash"]

Investigation

  1. Error showed suggestions for valid model names
  2. Searched config files for the invalid model ID
  3. Found references in ~/.config/opencode/oh-my-opencode.json:
    • Line 19: multimodal-looker agent
    • Line 39: visual-engineering category
    • Line 46: artistry category
    • Line 60: writing category

Resolution

Changed all occurrences to use valid model IDs:

// Before (invalid)
"model": "google/gemini-3-flash"
"model": "google/gemini-3-pro"

// After (valid - using antigravity provider)
"model": "google/antigravity-gemini-3-flash"
"model": "google/antigravity-gemini-3-pro"

Lesson

Model IDs in oh-my-opencode.json must exactly match the model IDs defined in opencode.json provider config. The error’s suggestions field shows valid alternatives - use those exact strings.