Preface¶
When developing intelligent agents with DeepSeek Harness (DSH), prompt engineering often becomes an efficiency bottleneck. Manual iterative editing is time-consuming and makes it hard to track historical versions. Among existing community solutions, some have cumbersome configuration, while others rely too heavily on databases. dsh-prompt-forge aims to provide a lightweight solution that performs streaming prompt optimization and skill accumulation directly within the current session context.
Plugin Introduction¶
This is a native DSH plugin maintained by nina27486486. By reusing the current session’s model (agentDefaultModel) and streaming interface (llm.stream), it enables prompt optimization with zero API Key configuration. It also provides file-based prompt library management and one-click skill file generation, making it suitable for developers who need to iterate on prompts quickly.
Core Features¶
- One-click optimization and streaming output: After entering a draft in the input box, click the ⚒ button or switch to card mode, and the system will stream the optimized results via SSE. Three modes are supported: Lightweight (single-sentence polishing), Standard (structured rewrite), and Expert (task inference + output contract + variable placeholders).
- Zero-configuration runtime: No API Key or additional endpoint is required; it directly reuses the current session’s model parameters.
- Basic actions: Supports replacing the draft with the optimized result, reverting changes, copying content, or re-triggering optimization.
- File-based prompt library: Stores prompt entries in a plain JSON file (located at
$DSH_HOME/prompt-forge/prompts.json). It supports direct editing, Git syncing, browsing within the card, and click-to-insert. - Save as skill: For satisfactory results, it can generate a
dshskill file with one click (located at$DSH_HOME/skills/forge-<slug>/SKILL.md). It can then be invoked later using the/forge-<slug>command.
Installation and Enablement¶
The plugin supports self-contained deployment. When installing, be mindful of path issues caused by spaces. It is recommended to use mklink to create a junction to a directory without spaces.
# 建立目录联接(处理路径空格)
cmd /c mklink /J D:\prompt-forge-dev "D:\deepseek harness\plugins\dsh-prompt-forge"
# 通过 dsh 命令添加插件
./dsh.sh plugin --profile web add D:/prompt-forge-dev
Typical Usage¶
- Enter a draft in the input box, then click the ⚒ button (or switch to card mode) to view the streamed optimization results.
- Browse entries in the “Prompt Library” tab within the card. Clicking an entry inserts it directly into the input box.
- When satisfied with the optimization, click “Save as Skill.” The system generates the corresponding SKILL.md file, which can then be triggered using
/forge-<slug>.
Notes and Limitations¶
- Quality dependency: The optimization quality depends entirely on the model selected for the current session.
- Error display: If the API Key is invalid, error information is displayed in the card via streaming.
- Implementation coupling: The plugin reads and writes drafts by manipulating the composer DOM, so it is coupled to the official renderer implementation. If the host renderer undergoes major changes, the
findComposerfunction may need to be adjusted. - Version compatibility: The slot contract in version 0.1.1-rc.2 (
{session, input}) is incompatible with host versions ≥0.1.2-rc.1. Care must be taken when upgrading the host to ensure compatibility. - Dependencies: The plugin has no runtime dependencies.
Conclusion¶
dsh-prompt-forge provides a complete pipeline from draft to skill file, making it suitable for developers who value lightweight design and data controllability. For more details, refer to the plugin directory or GitHub repository.