Home / Servers

opencode-prompts

by minipuft

opencode-prompts

OpenCode plugin for the claude-prompts MCP server. Chain tracking, gate reminders, and state preservation—all working with OpenCode's native plugin API.

npm version License: MIT

Why This Plugin

ProblemSolutionResult
FAIL verdict executed anywaytool.execute.before blocks prompt_engineGate enforcement before execution
Chain state lost on /compactState preservation hookResume from Step 3/5, not Step 1
Forgot to respond to gate reviewGate reminder injectionGATE_REVIEW: PASS|FAIL prompt appears

| Verify loop runs forever | Shell verify tracking | Loop terminates after max attempts | | MCP server setup is manual | Bundled claude-prompts server | Works out of the box |

Quick Start

# Install globally
npm install -g opencode-prompts
opencode-prompts install

# Or via npx (non-interactive)
npx opencode-prompts install -y

Restart OpenCode. You should see chain progress after prompt_engine calls:

[Chain] Step 2/4 - call prompt_engine to continue
[Gate] code-quality
  Respond: GATE_REVIEW: PASS|FAIL - <reason>

CLI Reference

install

Sets up hooks and registers the plugin globally.

opencode-prompts install [options]

Options:

FlagDescription
--yes, -ySkip prompts, auto-confirm all questions
--forceReinstall hooks even if already installed
--skip-hooksOnly register plugin, skip hook installation
--help, -hShow help message

What it configures:

ComponentLocationDescription
Hook scripts~/.claude/hooks/claude-prompts/Python hooks for chain tracking, gate reminders, state preservation
Hook registration~/.claude/hooks/hooks.jsonRegisters hooks with Claude Code
Plugin registration~/.config/opencode/opencode.jsonAdds "opencode-prompts" to global plugin array

Examples:

opencode-prompts install              # Interactive install
opencode-prompts install -y           # Non-interactive (CI/scripts)
opencode-prompts install --force      # Reinstall hooks
opencode-prompts install --skip-hooks # Plugin registration only

uninstall

Removes hooks and plugin registration.

opencode-prompts uninstall [options]

Options:

FlagDescription
--cleanup-legacyAlso remove hooks from project .claude/settings.json
--help, -hShow help message

What it removes:

ComponentLocation
Hook scripts~/.claude/hooks/claude-prompts/
Hook registration~/.claude/hooks/hooks.json
Plugin registration~/.config/opencode/opencode.json

Examples:

opencode-prompts uninstall                   # Full uninstall
opencode-prompts uninstall --cleanup-legacy  # Also clean project hooks

Features

  • Gate Enforcement — Blocks FAIL verdicts and missing gate responses before execution

  • Chain Tracking — Shows Step 2/4 progress after each prompt_engine call

  • Gate Reminders — Injects GATE_REVIEW: PASS|FAIL format when gates are pending

  • State Preservation — Chain/gate state survives session compaction

  • Shell Verify Tracking — Monitors verification loop attempts

  • Auto-cleanup — Clears state when sessions end

  • Bundled MCP Server — Includes claude-prompts server, no separate install needed

Hooks

OpenCode HookPurpose
tool.execute.beforeBlocks FAIL gate verdicts and missing gate responses
tool.execute.afterInjects chain progress + gate reminder

Related servers

n8n

by n8n-io

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

NOASSERTION198,904

@modelcontextprotocol/server-everything

Official

by modelcontextprotocol

MCP server that exercises all the features of the MCP protocol

89,105

@modelcontextprotocol/server-filesystem

Official

by modelcontextprotocol

MCP server for filesystem access

SEE LICENSE IN LICENSE89,105

mcp-server-fetch

Official

by modelcontextprotocol

A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

89,105