@objctp/opencode-better-promptAutomatically corrects, translates and enhances user prompts before submission to an LLM Model via Claude Code or OpenCode.
0
51
近 7 天 6
28.0
生态多维模型
1 个月前
2026-06-28
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@objctp/opencode-better-prompt@0.9.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@objctp/opencode-better-prompt@0.9.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @objctp/opencode-better-promptopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Automatically fixes and improves user prompts before they reach the model.
Supports two CLIs, with the same settings:
See your CLI's README for install steps and the details that matter.
How it works
Every prompt runs through up to three stages, each of which you can switch on or off:
original → [correction] → [translation] → [enhancement] → final
- Correction — fixes grammar and spelling whilst preserving intent, style, and punctuation
- Translation — translates non-English prompts to English; English passes through unchanged
- Enhancement — rewrites for clarity, specificity, and structure
Stages are optional — the plugin works with just correction, just enhancement, or any combination.
Settings
Settings live in a YAML file. The options are the same on both CLIs — only the path differs, so see your CLI's README.
| Setting | Default | What it does |
|---|---|---|
enabled |
true |
Master switch |
correction |
true |
Fix grammar and spelling |
correction_model |
haiku |
Model for correction |
translation |
false |
Translate non-English to English |
translation_model |
haiku |
Model for translation |
enhancement |
false |
Rewrite for clarity |
enhancement_model |
sonnet |
Model for enhancement |
audit |
true |
Keep a log of prompts and changes |
verbose |
false |
Show extra detail |
Models — haiku, sonnet, and opus work everywhere. OpenCode can also use the providers you've connected (fast, capable, powerful) or an explicit provider/model ID. See the OpenCode README.
Audit log
With audit on, each prompt is logged as one line of JSON — the original text, each stage's output, the mistakes caught, and the models used. OpenCode adds token usage. Paths and exact fields are in the CLI READMEs.
License
MIT