jev-prompt-enhancer
v0.1.0
Published
Automatic Prompt Enhancer for any AI agent: Jev decides IF refinement is needed, Mercury rewrites, Jev fidelity-checks, you approve.
Maintainers
Readme
jev-prompt-enhancer
Automatic Prompt Enhancer for any AI agent / IDE. You type the request however it comes out (typos, vague, missing context) — one cheap Jev decision decides whether it even needs refinement; if yes, Mercury (diffusion LLM) rewrites it precisely, a second Jev call checks that the meaning was NOT changed, and you approve / reject / rework.
Full cycle: ~2 s, ~$0.001. Clear prompts pass untouched (that is the point — most prompts don't need help). Fail-open: no key / API error → the original prompt goes through.
Pipeline
raw query → Jev: needs refinement? (noul ~0.5 s, ~$0.00002)
└─ <0.6 → {"enhance": false} — untouched, zero extra cost
└─ ≥0.6 → Mercury rewrite (~1 s)
→ Jev fidelity check: did meaning change?
└─ HIGH → reject the rewrite, warn
└─ LOW/MED → improved prompt + your [approve / reject / rework]Verified (live runs)
| Input | Jev verdict | Result |
|---|---|---|
| а памаги мне зделать чтоб бот торгавал биткоин но штоб не терял деньгу | needs=0.84, typos | ✏️ → «Помоги мне создать бота, который будет торговать биткоином, но не будет терять деньги и не будет слишком рисковать.» (1.9 s, meaning LOW) |
| зделай что-нить для сайта штоб быстрее работал | needs=0.89, ambiguous | ✏️ refined |
| Fix the failing test in tests/auth.spec.ts | needs=0.54 | ✅ untouched |
| обнови зависимости в package.json и запусти тесты | needs=0.32 | ✅ untouched |
| ls | needs=0.25 | ✅ untouched |
Install
npm i -g jev-prompt-enhancer
export OPENROUTER_API_KEY=sk-or-v1-... # env only, never hardcodedUse
jev-enhance "<raw query>" # JSON: original/enhanced/verdicts/latency
jev-enhance "<raw query>" -i # interactive: approve / keep / rework
jev-enhance --init claude # wire into Claude Code (real hook)
jev-enhance --init opencode # wire into OpenCode (plugin)
jev-enhance --init generic # prints AGENTS.md / CLAUDE.md ruleHooks: how it works per agent
Claude Code — real hook (HARD-ish mode). --init claude writes to ~/.claude/settings.json:
{"hooks": {"UserPromptSubmit": [{"hooks": [{"type": "command", "command": "jev-enhance --hook-claude"}]}]}}The hook reads {"prompt": "..."} from stdin, and per the official UserPromptSubmit schema a hook cannot replace the prompt — it can block it or inject additionalContext. So the tool injects: with --auto in the command → Treat the user's request as (technically refined, same intent): "..."; without → an FYI note the model may surface. Either way the decision stays yours — reject in chat and the original is used.
OpenCode — plugin (SOFT mode). --init opencode writes ~/.config/opencode/plugin/jev-enhance.js, which listens to chat.message and appends a [Prompt refinement note] part when Jev says the prompt needs help.
Anything else (Codex, Cursor, Hermes…) — --init generic prints the rule: before answering a non-trivial request, run jev-enhance "<request>", show the improved version, let the user choose. Same pattern as jev-skill-router.
Anti-hallucination gate
The rewriter is instructed: keep exactly the same intent, fix grammar, make vague wording precise, do NOT add requirements — and a second Jev call scores meaning_changed (LOW/MEDIUM/HIGH). HIGH → the rewrite is rejected outright, you get the original back.
Honest limits
- Refinement = clarity, not mind-reading: it can't recover requirements you never wrote (it can only make vagueness explicit).
- The threshold (0.6) is calibrated on tests above; it will occasionally refine a prompt you considered fine — reject and it remembers nothing.
- ~2 s latency per refined prompt (two Jev calls + one Mercury call). Untouched prompts: ~0.5 s.
MIT
