OpenCodePrompt Enhancer

03Guide

How to enhance prompts in OpenCode.

Use /enhance to turn a rough draft into a clearer, more specific prompt — without leaving the OpenCode composer.

What the plugin changes.

OpenCode Prompt Enhancer adds one command to OpenCode: /enhance. It sends your draft through the model already attached to the session, then opens the rewritten prompt in a modal. Nothing is inserted until you press Enter.

The rewrite keeps your intent but adds the details a coding agent needs: the goal, the constraints, the files or stack involved, and a clear definition of done. You can accept it, copy it, retry it, or throw it away.

A rough draft, rewritten.

Before

/enhance make the login form better

After

Improve the login form in src/routes/login.tsx. Add inline validation for email and password, disable the submit button while the request is pending, show API errors next to the relevant field, and keep the existing design tokens. Add a test for the invalid-email case.

The exact result depends on your model and project context. The point is that the second prompt is specific enough to act on without another round of clarification.

When to use /enhance.

  • You know what you want, but the first draft is vague.
  • A bug report needs reproduction steps and expected behavior.
  • A refactor needs scope, constraints, and a definition of done.
  • You want the session’s model and context without retyping them.

With a session open, the plugin uses that session’s model, variant, and context. From the OpenCode home screen it creates a temporary session, generates the result, and removes the session immediately.

Configure it for your project.

The defaults work out of the box. When you need a different voice, set a role, tone, specialties, rules, examples, or a custom template in your user or project config. You can also pin a model with the model option.

See the README for the full option list and configuration priority.

Install OpenCode Prompt Enhancer.

Add the plugin, reload OpenCode, and run the command from any composer.

opencode plugin add opencode-prompt-enhancer

Requires OpenCode v2 and a configured provider. Full setup details are on the install page.