Fixes Node (desktop app) loading, derives hook matchers from hooks.json, self-registers skills via the config hook, and splits install docs into CLI and desktop paths.
OpenCode passes different output object shapes to tool.execute.after
depending on tool type: built-in tools get { output: string }, but MCP
tools get { content: [{type, text}] } (raw MCP CallResult).
The previous code used output.output += '...' which silently failed for
MCP tools because output.output is undefined. The fix adds:
- appendToOutput() helper that detects the shape and appends text to
whichever field exists (output.output for built-in, output.content
array for MCP)
- runHook() using spawnSync instead of BunShell ($) for reliable hook
script execution inside OpenCode's plugin context
- realpathSync for symlink-safe path resolution
- Updated README with MCP output shape documentation
Tested: system prompt injection and tool result reminders both verified
working with n8n MCP tools (search_nodes, get_node_types).
Add an opencode/ directory with a TypeScript plugin that bridges the
existing bash hooks into OpenCode's plugin event system, achieving
feature parity with the Claude Code and Codex plugins.
- opencode/plugin.ts: bridges SessionStart, PreToolUse, and PostToolUse
hooks into OpenCode's experimental.chat.system.transform,
experimental.session.compacting, and tool.execute.after events
- opencode/README.md: installation instructions for OpenCode users
- README.md: add OpenCode section under Install
- CLAUDE.md: add opencode/ to repo structure
The plugin is glue code only. All hook logic (node-specific warnings,
antipattern detection, skill routing) stays in the existing hooks/ bash
scripts. Uses relative path resolution via import.meta.dir so it works
regardless of clone location. Tool name matching is flexible since MCP
server names are user-configurable in OpenCode.