OpenCode Plugins
@reflection-3.ts - push opencode agent to reflect on the task, useful for continuous interrupted runs
Task: Add real-data antipatterns to the reflection plugin's self-assessment judge prompt, tuned via an eval loop (issue #140).
Why: The reflection plugin decides whether an agent's work is actually done or whether it stopped prematurely. It was missing the most common real failure modes, so it let premature stops slide. We mined real OpenCode + Claude Code sessions to find what those failures actually look like.
How:
- Mined ground truth — extracted 143 local sessions (OpenCode SQLite + Claude jsonl), built turn-granular
.dataset/*.xml (634 real user-follow-up examples). Gotcha caught: tool_result carries role=user, inflating follow-ups 8x — fixed with compact().
- Classified stops — 227 cases where agent stopped and user replied. Haiku 3x majority-vote labeled them: 177/227 (78%) were premature — 91 permission-seeking, 68 stopped-with-todos.
- Wrote antipatterns from that data into the production prompts (
buildSelfAssessmentPrompt + analyzeSelfAssessmentWithLLM in reflection-3.ts), not just the eval mirror — plus the test-helpers copy that had drifted. Key rule: final-turn yes/no question about something the agent can do itself = premature.
- Eval loop — fixed dead infra (
~/.env.d/azure-dev.env has live gpt-5.1), updated CI secrets, ran the real promptfoo judge: 34/34, 0 errors.
- Shipped — PR #141 squash-merged (
c4dd7bc), both CI checks green, prod-verified on main, issue #140 closed.
Done and verified through the real channel. Nothing pending except the optional follow-up: stuck/compression/agent eval suites were bumped to gpt-5.1 but only run on manual dispatch — not separately re-verified.
@claude/ - Claude Code reflection plugin (experimental)
Port of the reflection idea to Claude Code as a Stop hook. Classifies the last assistant turn into one of six categories (complete, working, waiting_for_user_legitimate, tool_available_punt, summary_drift_stop, genuinely_stuck) with Claude Haiku 4.5, and re-prompts the agent when it punted to the user, drifted into "summary + next step + stop", or halted mid-thought. Honors stop_hook_active loop guard and caps at 3 inject cycles per session. Install with claude --plugin-dir ./claude for dev or via the marketplace once published. See claude/README.md. Baseline classifier accuracy and dataset are tracked in evals/datasets/README.md and follow-up #138.
@telegram.ts - integrates with Telegram over t.me/OpencodeMgrBot bot

@tts.ts - uses coqui TTS to read the opencode agent response. Useful to run a few agents on macOS and be notified when one finishes a task.

Make your AI coding assistant actually finish the job. Self-reflection and task verification for OpenCode - the open-source AI coding agent.
The Problem
AI coding assistants often:
- Stop before the task is truly complete
- Miss edge cases or skip steps
- Say "done" when tests are failing
- Require constant human supervision
The Solution
This plugin adds a judge layer that automatically evaluates task completion and forces the agent to continue until the work is actually done. Plus, get notified on Telegram when long-running tasks finish - and reply back via text or voice.
| Plugin | Description |
|---|
| reflection-3.ts | Judge layer that verifies task completion and forces agent to continue if incomplete |
| tts.ts | Text-to-speech + Telegram notifications with two-way communication |
| worktree-status.ts | Git worktree status tool for checking dirty state, branch, and active sessions |
Key Features