npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-enhancer-plugin

v1.5.0

Published

Universal Technical Architect & Prompt Enhancer with Todo Enforcer and Strategos Planning Mode

Readme

🚀 OpenCode Enhancer Plugin

npm version License OpenCode

Universal Technical Architect & Prompt Enhancer - Transform vague ideas into precise, context-aware engineering specifications.

✨ What is Enhancer?

The Enhancer is a third primary agent mode for OpenCode that sits alongside Plan and Build. It acts as your technical architect, analyzing your codebase and generating detailed, actionable prompts that you can execute in Build mode.

🎯 Key Features

  • 🔍 Intelligent Context Analysis - Automatically explores your project structure, tech stack, and relevant files
  • 🧠 Intent Classification - Categorizes requests as FIX, FEAT, REFACTOR, TEST, or EXPLAIN
  • 🔒 Todo Enforcer System - Tracks TODOs and prevents stopping until all tasks are completed (for ultraplan and strategos agents)
  • 🎯 Strategos Mode - Strategic planning with interview mode for complex tasks
  • 📚 Context7 Integration - Conditionally includes use context7 when documentation-heavy frameworks are detected
  • 🎨 Style-Aware - Mimics your project's coding style and patterns
  • ⚡ One-Click Workflow - Generates copy-pasteable prompts ready for Build mode

🚀 Quick Start

Installation

From npm (Recommended)

Add to your OpenCode config (~/.config/opencode/opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "opencode-enhancer-plugin@latest"
  ]
}

Restart OpenCode and press Tab to cycle through modes:

Plan → Build → Enhancer → Plan

From Source (Development)

  1. Clone this repository:

    git clone https://github.com/MaansenV/opencode-enhancer-plugin.git
    cd opencode-enhancer-plugin
  2. Install dependencies and build:

    npm install
    npm run build
  3. Add to your OpenCode config using the local path:

    {
      "plugin": [
        "file:///path/to/opencode-enhancer-plugin/dist/index.js"
      ]
    }

Version Management

  • Latest version: "opencode-enhancer-plugin@latest"
  • Current version: "[email protected]"
  • Specific version: "[email protected]"
  • Update: OpenCode auto-updates plugins on startup, or run opencode --update-plugins

Uninstall

Remove from your opencode.json:

{
  "plugin": []
}

📖 How It Works

┌─────────────┐     ┌──────────────┐     ┌─────────────┐
│   User      │────▶│  Enhancer    │────▶│   Build     │
│  Request    │     │   Agent      │     │   Mode      │
└─────────────┘     └──────────────┘     └─────────────┘
                           │
                           ▼
                    ┌──────────────┐
                    │  Explore-    │
                    │   Context    │
                    │  (Subagent)  │
                    └──────────────┘

Workflow

  1. Select Enhancer Mode (Tab to cycle)
  2. Describe your goal - "Fix the login bug" or "Add user authentication"
  3. Enhancer analyzes - Calls explore-context to map your codebase
  4. Receive enhanced prompt - Structured markdown with context, instructions, and technical requirements
  5. Copy & Execute - Switch to Build mode and run the generated prompt

📝 Changelog

v1.5.0 - Specialized Subagents

  • 📚 Librarian - Documentation and research specialist with Context7 and Code Search
  • 🔮 Oracle - Debugging and code architecture specialist
  • 🏗️ Architect - Dependencies and system design specialist
  • ✅ Reviewer - Plan validation specialist
  • 🎤 Interviewer - Requirements clarification specialist
  • Optimized 4+1 subagent structure (4 specialists + 1 interviewer)
  • Simplified, focused prompts for better performance

v1.4.0 - Todo Enforcer & Strategos Mode

  • 🔒 Todo Enforcer System - Tracks TODOs and prevents stopping until all tasks are completed (for ultraplan and strategos agents)
  • 🎯 Strategos Mode - New primary agent with strategic planning and interview mode for complex multi-phase tasks
  • strategos-interviewer subagent for stakeholder requirement gathering
  • Enhanced hooks for session management and TODO tracking
  • Auto-activation of strategos mode on keyword detection

v1.2.0 - New Agents & Model Configuration

  • ultraplan & ask primary agents
  • review-plan subagent for critical analysis
  • Enhanced model configuration with environment variables

v1.0.0 - Initial Release

  • enhancer primary agent
  • explore-context subagent for project analysis
  • Intent classification and Context7 integration
  • Style-aware prompt generation

🎨 Example Output

# Task: Fix Authentication Token Validation

## Context
Detected **React + TypeScript + Express** project. Authentication logic located in `src/auth/middleware.ts` and `src/utils/token.ts`.

## Instructions
use context7
1. Modify `src/auth/middleware.ts`:
   - Locate function `validateToken` (line 45)
   - Add null check for `req.headers.authorization`
   - Implement JWT verification using existing `verify()` pattern
2. Update `src/utils/token.ts`:
   - Add error handling for expired tokens
   - Return structured error object instead of throwing
3. Testing:
   - Run `npm test` to verify auth flow
   - Check edge cases: missing token, expired token, malformed token

## Technical Requirements
- **Style**: Follow existing async/await patterns
- **Error Handling**: Use `try/catch` with custom AuthError class
- **TypeScript**: Maintain strict typing, add interfaces for token payload

🛠️ Architecture

Components

Primary Agents (User-Facing)

Activated via Tab key in OpenCode:

| Agent | Color | Steps | Description | |-------|-------|-------|-------------| | enhancer | Purple (#9C27B0) | 15 | Universal Technical Architect - analyzes intent and generates executable prompts | | ultraplan | Orange (#FF5722) | 20 | Iterative Planner with Todo Enforcement - creates plans through parallel subagent analysis and review loops | | ask | Blue (#2196F3) | 15 | Research Assistant - answers codebase questions via multi-source context gathering | | strategos | Deep Orange (#BF360C) | 30 | Strategic Planner with Interview Mode - handles complex multi-phase tasks with strategic planning and stakeholder interviews |

Subagents (Background Workers)

Called automatically by primary agents via task tool:

| Subagent | Called By | Description | |----------|-----------|-------------| | librarian | All primary agents | Documentation and codebase research specialist (Context7 + codesearch) | | oracle | All primary agents | Debugging and code architecture specialist | | architect | ultraplan, strategos, ask | Dependencies and system design specialist | | reviewer | ultraplan, strategos | Plan validation and critical analysis specialist | | interviewer | strategos only | Requirements clarification and stakeholder interview specialist |

Supported Tech Stacks

  • Web: React, Vue, Angular, Svelte, Next.js, Nuxt, Vite
  • Backend: Express, Django, Flask, FastAPI, Rails, Laravel, Spring
  • Game Engines: Unity, Godot, Unreal Engine
  • Data/ML: TensorFlow, PyTorch, NumPy, Pandas
  • Infrastructure: Docker, Kubernetes, Terraform
  • And more...

⚙️ Configuration

Agent Configuration

The plugin automatically registers agents via the config hook with configurable models:

// Enhancer (Primary Agent) - Model configurable via opencode.json or env vars
{
  mode: "primary",
  model: "opencode/kimi-k2.5-free",  // Default, can be overridden
  description: "Universal Technical Architect & Prompt Enhancer",
  color: "#9C27B0",
  steps: 15,
  tools: { task: true, read: true }
}

// Explore-Context (Subagent) - Model configurable via opencode.json or env vars
{
  mode: "subagent",
  hidden: true,
  model: "opencode/kimi-k2.5-free",  // Default, can be overridden
  tools: { list: true, read: true, grep: true, bash: true }
}

Model Configuration

You can configure custom models for Enhancer agents. This is useful for:

  • Using more powerful models for complex planning tasks
  • Saving costs by using simpler models for subagents
  • Testing specific models for certain task types

Configuration Methods (Priority: Highest → Lowest)

1. OpenCode Agent Config (Recommended)

Configure models directly in your opencode.json:

{
  "agent": {
    "strategos": {
      "model": "anthropic/claude-sonnet-4-5"
    },
    "oracle": {
      "model": "anthropic/claude-sonnet-4-5"
    },
    "librarian": {
      "model": "opencode/kimi-k2.5-free"
    }
  }
}
2. Environment Variables

Use environment variables for CI/CD or temporary changes:

# All Subagents
export ENHANCER_MODEL_SUBAGENT="opencode/kimi-k2.5-free"

# All Primary Agents  
export ENHANCER_MODEL_PRIMARY="anthropic/claude-sonnet-4-5"

# Specific Agent (highest priority among env vars)
export ENHANCER_MODEL_STRATEGOS="anthropic/claude-opus-4"
export ENHANCER_MODEL_ORACLE="anthropic/claude-sonnet-4-5"

Model Recommendations by Agent Type

Primary Agents (Use stronger models for complex reasoning):

| Agent | Recommended | Minimum | Purpose | |-------|-----------|---------|---------| | strategos | anthropic/claude-sonnet-4-5 | opencode/kimi-k2.5-free | Strategic planning with interview mode | | ultraplan | anthropic/claude-sonnet-4-5 | opencode/kimi-k2.5-free | Planning with todo enforcement | | enhancer | opencode/kimi-k2.5-free | opencode/kimi-k2.5-free | Prompt enhancement & analysis | | ask | opencode/kimi-k2.5-free | opencode/kimi-k2.5-free | Q&A and research |

Subagents (Lightweight models sufficient for information gathering):

| Subagent | Recommended | Minimum | Purpose | |----------|-------------|---------|---------| | librarian | opencode/kimi-k2.5-free | opencode/kimi-k2.5-free | Documentation & research (Context7 + codesearch) | | oracle | anthropic/claude-sonnet-4-5 | opencode/kimi-k2.5-free | Debugging & code architecture | | architect | opencode/kimi-k2.5-free | opencode/kimi-k2.5-free | Dependencies & system design | | reviewer | opencode/kimi-k2.5-free | opencode/kimi-k2.5-free | Plan validation | | interviewer | anthropic/claude-sonnet-4-5 | opencode/kimi-k2.5-free | Requirements clarification |

Validation

The plugin validates configured models against known providers:

  • opencode/*
  • anthropic/*
  • openai/*
  • google/*
  • mistral/*
  • cohere/*
  • ollama/*

Invalid models automatically fall back to the default (opencode/kimi-k2.5-free).

🎨 Ready-to-Use Templates

Siehe MODEL-TEMPLATES.md für vorgefertigte Konfigurationen:

  • 🚀 Performance First - Beste Ergebnisse mit Claude
  • 💰 Budget First - Kosten sparen mit Kimi
  • Hybrid - Intelligente Aufteilung nach Aufgabe
  • 🔧 Custom Models - OpenAI, Google, etc.

Quick-Start:

# Hybrid Template (empfohlen für den Anfang)
curl -s https://raw.githubusercontent.com/MaansenV/opencode-enhancer-plugin/main/MODEL-TEMPLATES.md | grep -A 50 "Template 3: Hybrid"

Context7 Integration

The plugin automatically detects libraries that benefit from Context7:

// Libraries triggering "use context7"
["react", "django", "unity", "tensorflow", "docker", ...]

🔧 Development

Project Structure

opencode-enhancer-plugin/
├── src/
│   └── index.ts          # Source TypeScript
├── dist/                 # Compiled output (published to npm)
│   ├── index.js
│   └── index.d.ts
├── package.json          # Package metadata
├── tsconfig.json         # TypeScript config
└── README.md             # This file

Hooks

  • config - Registers agents on startup
  • tool.execute.before - Logs subagent calls
  • message.updated - Appends Build mode hint
  • message.completed - Extracts and stores TODOs
  • stop.requested - Prevents stop when TODOs are open
  • session.start - Manages todo store lifecycle
  • session.end - Manages todo store lifecycle
  • user.prompt.submitted - Auto-activates strategos mode on keywords

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Ideas for Contributions

  • Add more tech stack detectors
  • Improve Context7 heuristics
  • Add support for additional intent types
  • Enhance prompt templates

📄 License

MIT License - see LICENSE file for details.

🙏 Acknowledgments

  • Built for OpenCode
  • Inspired by the need for better context-aware AI assistance
  • Thanks to the OpenCode community for feedback and ideas

⬆ Back to Top

Made with ❤️ for the OpenCode community