DeepSeek Harness Plugin: dsh-global-rules

Introduction

The core philosophy of DSH is “Everything is a plugin.” When developing agents, ensuring that the Agent always adheres to global instructions is a common pain point. Injecting instructions into historical messages can sometimes result in compression, whereas injecting them into specific positions within the system prompt is more reliable. The dsh-global-rules plugin maintains a list of user-owned rules and injects them into the system prompt of every request, forcing the Agent to verify them one by one before responding.

Core Features

  1. Three Modification Entries: Modify rules via the visual interface in the settings page, the command-line tool /rules, or the global_rules tool available to the Agent. All three methods modify the same data set.
  2. Storage Location: Rules are stored in $DSH_HOME/dsh-global-rules/rules.json.
  3. Injection Position: The system prompt is reassembled for every request, inserting the rules at position 100 (after the deployed persona and before the tool descriptions).

Installation

Install the plugin into the specified profile directory using pnpm. The plugin name is dsh-global-rules.

pnpm add https://github.com/IHS470/dsh-global-rules/archive/refs/tags/v1.0.0.tar.gz --dir <profile>

After installation, it must be added to the bundle list in the profile configuration.

Usage

Command Line

Use the /rules command for quick operations.

/rules                     # View current rules
/rules add <text>          # Add a new rule
/rules remove <index>      # Delete the Nth rule
/rules clear yes           # Clear all rules
/rules on | off            # Enable / disable injection
/rules check on | off      # Show / hide rule check line in response
/rules help                # Show usage instructions

Agent Tools

The Agent can invoke the global_rules tool.

action parameters description
list — List rules and switch status
add text Append a rule
update index / id, text / ruleEnabled Modify content or enable/disable a single rule
remove index / id Delete a rule
clear — Clear all rules
replace rules: string[] Replace the entire set
configure enabled / acknowledge Global switch and visible check

Interface

Navigate to Settings → Global Rules.

Injection Logic & Configuration

The plugin injects a block of text into the system prompt, requiring the Agent to verify the rules one by one before answering.

  • Enable/Disable Injection: Controlled via the settings page or commands.
  • Show Rule Check: Disabled by default. When enabled, a check result line Rule check: N rules verified is appended to the end of every response.

Limitations & Storage

  1. Data Limits: Maximum 2000 characters per rule, up to 200 rules.
  2. Storage Format: Writing is strict (empty rules or over-limit content will not be written), while reading is lenient (if one entry is corrupted, only that entry is discarded).
  3. Log Isolation: The rule list does not enter session logs; it is deployment-level configuration, not conversation content.
  4. Guarantee Scope: The plugin only guarantees that rules are “delivered,” not that the Agent “complies.”

Notes

  • The compliance of the reasoning channel with user rules located in the middle of the system prompt is significantly lower than that of the response itself.
  • Modifying rule phrasing has limited effect on controlling the reasoning language; it is recommended to start a new session if necessary.
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye