Introduction

In using DeepSeek Harness (DSH), building a complex workflow that includes multiple roles usually requires describing a Prompt on the fly for each subtask. This is cumbersome and difficult to reuse or standardize. The dsh-subagent-library plugin addresses this problem by encapsulating common roles (such as code review, red-team testing, and multimodal understanding) into a persistent, named subagent roster. The model can select a participant and assign work through the standard tool interface, and the main session can trigger it with a single instruction.

Core Features

  • Named subagent roster: Persists configurations such as model, Persona, and tool filtering, with hot reload support.
  • Tool integration: Provides two tools for the model: list_subagents (list the roster) and delegate (dispatch tasks).
  • Visual editing: Add, delete, and modify entries directly on the DSH settings page, without manually maintaining YAML files.
  • Host-plane tool registration: Tools are registered on the Host plane and do not depend on a specific Agent Preset; switching Presets will not cause them to be lost.
  • Background mode support: Supports one-shot (one-off task) and continuable (continuable subagent) modes.

Installation and Enablement

Install the plugin via npm:

npx @deepseek-ai/dsh plugin --profile web add dsh-subagent-library

After installation, restart the dsh web process and refresh the page to use it.

Configuration and Usage

Directory Structure

Starting from version 0.3, the roster is stored as a directory structure, with the default path ~/.dsh/subagents/. Each named subagent corresponds to one YAML file (the filename is the ID).

~/.dsh/subagents/
  k3-reviewer.yaml     # corresponds to ID k3-reviewer
  glm-reader.yaml
  _backups/            # backup area; files/directories starting with an underscore are ignored by the plugin
  README.md            # optional; documentation for Agents or humans to read

Tool Calling Flow

  1. Main session instruction: The main session Agent only needs to be told “do this using xxx”.
  2. Model decision: The model uses the list_subagents tool to inspect available entries in the roster (including description, model routing, etc.).
  3. Task delegation: The model uses the delegate tool to assign the task to the corresponding subagent based on the selected library_id.
  4. No Slash command required: Model-level interaction is fully completed through tools; the /subagent command is only for humans to view the roster in the command palette.

Configuration Item Explanation

Example configuration for a single entry file (k3-reviewer.yaml):

description: Independent read-only review by Kimi K3-256K, with image visual inspection
provider: kimi-coding
model: k3-256k
persona: |
  You are an independent review agent running on Kimi K3-256K...
toolFilter:
  deny: [write, edit, todo_write, create_goal, update_goal, subagent, subagent_fork, send_message, interrupt_agent, workflow, ralph, list_subagents, delegate]
maxDepth: 1
backgroundMode: continuable

Main field meanings:
* id: The filename, which must match [a-z0-9][a-z0-9-]*.
* description: Role description, used for display in list_subagents.
* provider: LLM route (e.g., deepseek-official, kimi-coding).
* model: LLM model ID.
* subagentProvider: Subagent transport layer (defaults to the plugin-level default spawn).
* persona: The subagent’s role prompt, supporting {{…}} template interpolation.
* toolFilter: Tool filter list. For read-only roles, it is recommended to add list_subagents and delegate to deny to prevent subagents from being induced by global prompts into chained delegation.
* maxDepth: Maximum delegation depth, preventing excessive recursion.
* backgroundMode: Background mode, one-shot (default) or continuable.

Design Notes

  • Hot reload: The roster reads the directory in real time on every operation; modifying YAML files does not require restarting DSH.
  • Host plane: Tools are registered on the Host plane, ensuring they remain available when switching Presets.
  • Fault tolerance: Files that fail parsing or validation are skipped; error messages appear in list_subagents output and the diagnostics UI, without causing the roster to crash.
  • Atomic operations: Single-entry writes use a temporary file + rename retry mechanism; in multi-writer environments, the later write takes effect.

Applicable Scenarios and Notes

  • Applicable scenarios: Suitable for long-term workflows with fixed role division, such as code review, red-team testing, and multimodal understanding.
  • Security note: The configuration endpoint /subagent-library/api follows the local trust boundary of the DSH Web Host; the plugin itself does not include an independent authentication layer. If you bind DSH to the public internet or a local area network, configure authentication and access control at the outer layer, and do not expose the endpoint to untrusted clients.
  • Dependencies: The plugin is an independent community project and is not affiliated with DeepSeek. It is recommended to review the source code and license before installation.