Preface¶
In the development workflow of DeepSeek Harness (DSH), prompt iteration and optimization are often high-frequency operations. The traditional approach involves repeatedly copy-pasting in the chat window and making manual modifications, which is not only inefficient but also makes it difficult to trace modification history or compare the effects of different versions.
dsh-prompt-studio is a DSH plugin that provides a dedicated “Prompts” panel in the left column of DSH. Its core value lies in centralizing prompt optimization, multi-round iteration, and version management within a single workspace, solving the problem of fragmented operations and providing cross-comparison capabilities.
Plugin Positioning¶
- Name: dsh-prompt-studio
- Category: Model Inference
- Maintainer: CECILIALOVE0616
- License: MIT
- Core Capabilities: Prompt optimization, multi-round iteration, version cross-comparison, template and history management
Core Features¶
The plugin provides a unified prompt workspace in the left column, primarily including the following capabilities:
- Prompt Optimization and Rewriting: Input the original prompt, select a configured model, and obtain the rewritten result.
- Multi-round Iteration: Based on the previous version of the prompt, generate a version chain by inputting adjustment directions (e.g., “more concise”, “add output format constraints”), supporting rollback to any historical version.
- Version Cross-Comparison: Versions are spread out in columns and can be viewed without expansion. It provides a row-level comparison view, with new content marked in green, and deleted content marked in red with strikethrough.
- Template and History Management: Provides five built-in templates such as general optimization, structured expansion, and streamlined compression, supporting custom saving. History records are arranged in reverse chronological order, supporting filtering and deletion.
- Use in New Conversations: The optimized or edited prompt can be directly clicked to fill into the input box of a new conversation and sent, eliminating the copy-paste step.
- Agent Tool Invocation: Registered the
prompt_optimizefunction for Agents to call directly in configuration.
Installation and Activation¶
This plugin is a DSH profile bundle. It must be installed into a DSH profile to register panels, tools, and routes. It has no runtime dependencies and can be used after installation.
Installation Command¶
The simplest way is to install via DSH CLI:
dsh plugin --profile <profile> add dsh-prompt-studio
Install from Source Build¶
If you need to install from source, execute the following steps:
git clone https://github.com/CECILIALOVE0616/dsh-prompt-studio.git
cd dsh-prompt-studio
npm pack
Then install using the generated .tgz file via CLI:
dsh plugin --profile <profile> add ./dsh-prompt-studio-<version>.tgz
Notes¶
- Desktop Profile: The
desktopprofile is exclusively managed by the Electron desktop application, and the CLI cannot execute theaddcommand on it. For desktop scenarios, use the in-app plugin installation interface. - Reload to Activate: After installation, DSH needs to be reloaded for the “Prompts” entry to appear in the left column.
- Hot Update: Except for the
toolEnabledsetting, other configuration modifications usually support hot updates; modifications totoolEnabledrequire restarting DSH to take effect.
Configuration Options¶
In the plugin section of DSH’s settings page, you can configure the following parameters:
| Field | Default | Description |
|---|---|---|
defaultMode |
user |
Default mode when opening the panel (user prompt / system prompt) |
defaultProvider / defaultModel |
Empty | Default model; if left empty, uses the session’s current route |
maxTokens |
4096 |
Maximum output per call |
timeoutMs |
120000 |
Timeout per call (up to 30 minutes) |
maxPromptChars |
20000 |
Maximum length per prompt |
historyLimit |
200 |
How many entries to fetch for the history list at once |
toolEnabled |
true |
Whether to register the prompt_optimize tool |
You can also configure via environment variables, with priority: plugin settings > environment variables > built-in defaults.
Data Storage¶
The plugin uses a local SQLite database for storage, with each workspace having its own independent database file:
Path: <workspace>/.dsh-prompt-studio/prompt-studio.db
The database contains three tables:
* prompts: Stores prompt versions (including parent_id to maintain the version chain).
* runs: Records each model invocation (optimization or iteration).
* templates: Stores templates (built-in templates and user-defined templates).
Tool Invocation API¶
Agents can directly call the prompt_optimize tool. The function signature is as follows:
prompt_optimize(prompt, mode?, direction?, provider?, model?)
→ { optimized, provider, model, elapsedMs }
Parameter Description:
* prompt: Required, the original prompt.
* mode: system or user, defaults to user.
* direction: If provided, runs in iteration mode (adjusts based on the previous version); if not provided, performs general optimization.
* provider / model: If not passed, uses the session’s current route.
Return Value:
* optimized: The optimized prompt.
* provider / model: The actual provider and model used.
* elapsedMs: Time elapsed.
Interruption: The call can be interrupted via exec.signal during execution.
Troubleshooting Common Issues¶
| Symptom | Cause |
|---|---|
| Plugin completely missing | cordis.patch.yml’s insert was not merged into the profile, or DSH was not reloaded |
| Entry in left column but panel won’t open | Client ID doesn’t match the left column item’s id and main area’s key; or exports.inject is missing slots |
| No plugin section in settings page | Config was not exported, or schemastery soft import got something other than the builder |
tool "prompt_optimize" is already registered |
This tool was declared multiple times in the agent preset |
| LLM call returns 503 / undefined | ctx.get('llm') is empty |
Summary¶
dsh-prompt-studio is a DSH plugin focused on prompt engineering. It makes prompt optimization, iteration, and comparison systematic by providing a visual workbench. For developers who frequently debug prompts or users building agents, it provides a complete solution from manual operation to code invocation.