In the development and use of DeepSeek Harness (DSH), frequently switching prompt templates, handling variable filling, and maintaining sessions for different contexts are common requirements. dsh-knj-prompts aims to solve these issues by managing prompts as scenes, supporting variable preview and automatic session switching.

Plugin Positioning

This is a client plugin maintained by yangdongzhen590. It provides a visual prompt scene management mechanism, supporting variable filling, scene editing, and exporting/importing scene packages.

Core Features

Scene Selection and Variable Filling

Click the “✦ Prompts” button on the right side of the input box toolbar to list all scenes. Built-in scenes are marked with a “built-in” badge, and variables are displayed as chips.
If a scene’s prompt contains {variable}, clicking it first opens a fill-in panel. The user enters variable values one by one; while typing, the final result is previewed in real time on the right. After confirmation, the content is automatically filled into the input box.

Automatic Session Handling

Based on the current session state, the plugin uses different filling strategies:
* Empty session: Fill the draft directly in the current session.
* Existing conversation: Automatically create a new session in the same workspace through the official New Session channel and fill the prompt into the draft area.

Scene Management

Click “Manage Scenes…” to open the management dialog. It supports:
* Add / Edit / Delete: Built-in scenes can be edited but cannot be deleted.
* Save all: Persist changes to disk.
Scene data is stored in <DSH_HOME>/knj-prompts/scenes.json, supports atomic write operations, and is automatically backed up and rebuilt if the file is corrupted. Built-in seed data is merged into local data.

Scene Package

The plugin includes two built-in scenes, “Export Scene Package” and “Install Scene Package”, to guide the AI in using the corresponding skill.
A scene package is a portable ZIP file for regular scenes. It does not include regular DSH plugin code, nor does it copy runtime configuration values. Its standard structure is as follows:

<scene-id>.dshscene.zip
├─ manifest.json
├─ scene.json
├─ README.md
├─ skills/          # 可选:<skill-id>/SKILL.md 及其文件
└─ materials/       # 可选:操作说明中列出的素材

Safe Execution Mechanism

The plugin does not execute content inside a scene package.
* Installation process: Selecting “Install Scene Package” opens a file picker, accepts only ZIP format, temporarily stores the file in <DSH_HOME>/knj-prompts/imports/, and writes the actual path returned by the server into the installation session draft.
* Executor: The actual actions—such as extracting, installing skills, and writing runtime configuration—are performed by the AI through the installer skill. Before execution, it performs a precheck, displays a plan, and asks for environment configuration. If an embedded skill has the same name under the target root directory, the entire operation is blocked; no partial writes are allowed before confirmation or when a conflict occurs.

Installation and Enablement

Run the following command in the plugin directory to build and package it:

npm.cmd run typecheck && npm.cmd run check:client && npm.cmd run build && npm.cmd run build:client && npm.cmd run pack

After the build is complete, enable it by pointing the dependency in the web profile’s package.json to the newly generated tgz file and reinstalling.

Typical Usage

  1. Use a scene: Use the “✦ Prompts” dropdown on the right side of the input box to select a scene.
  2. Handle variables: If the scene contains {variable}, first enter the variables in the pop-up panel and preview the result in real time; after confirmation, click Confirm.
  3. Send the conversation: Based on the current session state, if it is an empty session, send directly; if there is an existing conversation, the plugin automatically switches to a new session, and the user can make minor adjustments before sending.
  4. Import a scene: Select the “Install Scene Package” scene and choose a .dshscene.zip file. The plugin uploads it, and then the AI reads the file and installs it according to the defined process.

Notes

  • Permission scope: The plugin runs with the permissions of the current DSH process. Review the source code and license before installing.
  • V1 limitations: The current version does not support multiple scene packages, overwrite/merge, remote repositories, signing, dependency graphs, update synchronization, or automatic configuration discovery.
  • Skill files: On first launch, the plugin only copies scene-package-exporter and scene-package-installer from this package’s skills/ to <DSH_HOME>/skills/. If directories with the same names already exist locally, they are retained in all cases and are never overwritten or merged.

Summary

dsh-knj-prompts addresses the pain points of prompt reuse and variable filling in DSH through structured scene management and strict execution workflows. It treats scene packages as portable ZIPs and delegates actual execution to AI skills, ensuring flexibility while limiting the plugin’s execution permissions.