Adds a sparkle button left of the model selector in the composer: it rewrites the draft into a clearer, more complete task brief, replaces it in place with one-click undo, offers five rewrite styles, and greys out while the draft carries file/command chips.
Install
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/zzy6-a/dsh-prompt-enhance/releases/download/v0.1.0/dsh-prompt-enhance-0.1.0.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:zzy6-a/dsh-prompt-enhance
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
One-click prompt enhancement for the DSH composer. Type a rough sentence, hit ✨ next to the model selector, and your wording comes back as a task brief with a clear goal and the missing details filled in — with one-click undo.
Prompts for coding agents usually fail on what was not said: what to change, what to leave alone, what the deliverable is, how "done" is judged. This plugin turns that into a single click, using the model you are already talking to and nothing else.
Features
| ✨ Enhance | Reads the draft → fills in goal / scope / deliverable / constraints / acceptance → replaces the draft |
| ↩ Undo | The undo button stays available until you edit the draft yourself |
| 🎛 Five styles | Fill in details (default) · Concise · Detailed · Add constraints · Structured |
| 🧭 Model routing | Follow the session model (default) or pin a cheap model for rewriting |
| 🧩 Chip aware | With @file references, /commands or skill chips in the draft the button greys out and explains why |
| 🪄 Empty draft | Grey out, or "derive a prompt from the recent conversation" |
| 🌏 Bilingual | UI copy follows the DSH language (zh / en) |
Usage
- Write whatever you have, e.g.
make the log page filter a dropdown; - Click ✨ left of the model selector;
- The button turns into
···, then the draft is replaced by the rewritten prompt; - Not happy? Click ↩ to restore the original text.
If the draft contains
@file references,/commands or skill chips, ✨ stays disabled — on purpose: a whole-draft replace would downgrade those structured references to plain text.
Settings
Settings → Prompt enhance (its own section in the sidebar, it does not take over another plugin's card).
| Setting | Options | Default |
|---|---|---|
| Enable the enhance button | on / off | on |
| Rewrite style | Fill in details / Concise / Detailed / Add constraints / Structured | Fill in details |
| Model | Follow the session / Fixed provider + model | Follow the session |
| Empty draft | Disable the button / Derive a prompt from the recent conversation | Disable the button |
| Custom system template | Empty = built-in style template; filled = overrides it completely | empty |
Values live in the host settings namespace prompt-enhance and apply immediately.
How it works
composer draft ──POST /api/dsh-prompt-enhance/enhance──▶ host half
│
system = built-in style / custom template ◀┘
│
ctx.llm.stream (one-shot call)
│
rewritten prompt ◀──────── JSON ───────────────────────┘
│
inputActions.setDraft(text) ← whole-draft replace (undoable)
- One-shot model call: a hand-built request that never enters the session log or the agent context — no conversation pollution, no prompt-prefix cache churn;
- Route priority: the fixed pair from settings → the session's most recent main-model call (captured off the
llm/streamwaterfall, auxiliary calls excluded) → the host default model; - The host half does three things: compose the system prompt, call the model, strip a stray code fence. It stores no drafts.
HTTP API
POST /api/dsh-prompt-enhance/enhance
// request
{ "sessionId": "session-…", "draft": "make the log page filter a dropdown" }
// success
{ "ok": true, "text": "…", "route": { "provider": "opencode-go", "model": "deepseek-flash" },
"style": "default", "fromContext": false }
// failure
{ "ok": false, "error": "草稿为空" }
| Status | Meaning |
|---|---|
| 200 | Rewritten |
| 400 | Empty draft (and context mode off) |
| 403 | Disabled in settings, or an untrusted origin |
| 413 | Draft longer than 12000 characters |
| 422 | Empty draft + context mode, but no usable conversation context |
| 502 | Model call failed / returned nothing |
| 503 | No usable model route |
Known limits
- References are not preserved: drafts with chips can only be greyed out. The current plugin-facing input surface exposes
setDraftonly (plain text, reference placeholders stripped); preserving references needs an upstream chip-aware write action onInputActions. - No button in a brand-new session:
conversation.input.rightis a session-scoped seat and does not render without a session id. - It rewrites, it does not append: the whole draft is replaced.
- A model may ignore the "no code fence" rule; the host strips one wrapping fence as a fallback.
Install
GitHub Release (current channel)
Grab dsh-prompt-enhance-<version>.tgz from the latest release:
cd ~/.dsh/profiles/web
npm i /path/to/dsh-prompt-enhance-0.1.0.tgz
# then add "dsh-prompt-enhance" to dsh.profile.bundles
dshmarket
Search and install from the market once listed (see awesome-dsh-plugin).
From source
git clone https://github.com/zzy6-a/dsh-prompt-enhance.git
cd dsh-prompt-enhance
npm install
npm run build
# mount it in your profile your own way (bundle patch: cordis.patch.yml)
Requirements
- Node.js ≥ 22.19
- DSH ≥
0.1.5-rc.1(needs thesettings,sessions,llmandwebServerhost services) - A usable model route (session model or pinned in settings)
Development
npm install # four dev dependencies only (schemastery / @types/node / tsdown / typescript)
npm run build # host: tsc → lib/; client: tsdown → lib/client.js
npm run typecheck
npm test # node:test, six host-side unit tests
npm pack # produces dsh-prompt-enhance-<version>.tgz
Security & boundaries
- The route only serves same-origin / loopback callers (everything else: 403);
- 64 KB request cap, 12000-character draft cap, 90 s end-to-end deadline;
- No draft ever touches disk, nothing is written to the session log;
- The only network activity is sending your draft to the model route you configured.
License
MIT © 2026 zzy6-a
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10124
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10124
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 7006
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 6922
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 4933
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
Devin-AXIS/deepseek-design#deepseek-idesign★ 1723
Visual design studio for websites, app prototypes, posters, cards, reports, and magazines, with templates, direct element editing, selection-aware AI draft handoff, and export.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.