In the DeepSeek Harness (DSH) ecosystem, extending capabilities through plugins is a core design principle. When handling large projects, models often cannot recall the exact specifications of all files without prior context. The dsh-rules-paths plugin implements a rule-injection mechanism similar to Claude Code’s paths: rule: when the model successfully reads a file that matches a rule, the rule body is injected into the model’s context. It is built on DSH’s official @deepseek-ai/dsh-agent-instructions mechanism and supports SHA-1 deduplication and byte-budget control.
Core Features¶
- Preset-scoped, optionally activated: The plugin is not automatically mounted at the configuration-file level; it must be referenced by an agent preset to be activated. The four built-in system presets (
standard/code/minimal/cordis) ignore this plugin by default, and a new session only enables it if the selected preset includes the relevant line. - Path rules: Rule files declare
paths:glob patterns in YAML frontmatter. Once the model successfully performs areadoperation and the file matches, the rule body is injected at the next step boundary. - Global and project rules: Rules without
pathsare treated as global rules and injected at session start. WhenrulesDirProjectis enabled, the plugin also scans<projectRoot>/.dsh/rulesand<projectRoot>/.claude/rulesunder the project root. - Deduplication and budget: Within the same session, rules whose content has not changed are not sent again; when content changes, a
replaceinstruction is sent. Injected messages are limited bymaxBytes; if the limit is exceeded, the content is truncated and budget consumption is reported.
Installation and Activation¶
This plugin requires DSH 0.1.0-rc.x (Web profile). Installation has two steps: first install the package into the profile’s node_modules, then activate it from a preset.
1. Install the plugin package¶
The plugin is published in a GitHub repository rather than the npm registry. Use the following command to install it:
dsh plugin --profile web add git+https://github.com/Temoa/dsh-rules-paths.git
After installation, the package is located at node_modules/@temoa/dsh-rules-paths/, but it is not activated at this point because no preset references it.
2. Activate it in a preset¶
Because the built-in presets are read-only, you need to copy a preset to edit it. In the Web UI, open Settings → Agent Presets and copy standard or another preset. Add the following lines to agent.cordis.yml in the copied preset:
- id: rules-paths
name: '@temoa/dsh-rules-paths'
config:
rulesDir: "~/.dsh/rules"
rulesDirProject: true
After making the changes, restart Harness. In a newly created empty session, select this preset, and the plugin takes effect. Existing sessions with content do not support switching presets.
Configuration and Usage¶
Rule File Structure¶
Rule files are usually located under ~/.dsh/rules/*.md (configurable via rulesDir). Each file corresponds to one rule and contains YAML frontmatter and rule body.
---
paths:
- "**/*.dart"
- "lib/**/*.ts"
description: Dart conventions (optional, metadata only)
---
Rule body: guidance the model follows after reading a matching file.
Configuration Parameters¶
The plugin supports the following configuration options (rulesDirProject defaults to false):
| Key | Default | Meaning |
|---|---|---|
rulesDir |
~/.dsh/rules |
User-level rules directory (~ is expanded) |
maxBytes |
65536 |
Byte limit for a single injected message |
maxSourceBytes |
1048576 |
Maximum number of bytes allowed to be read for a single rule file |
rulesDirProject |
false |
Whether to scan .dsh/rules and .claude/rules under the project root |
How It Works¶
After the model successfully executes the read tool, the plugin performs the following logic:
1. Scan the configured rules directory.
2. Match the read file path against the paths globs in the rules (both absolute and relative paths are matched).
3. Render the matched rule body as a single user-role message, then, after SHA-1 deduplication and byte-budget checks, collapse it into agent/pre-step.
Notes¶
- Permissions and restart: After editing a preset, you must restart Harness. Changes to rule files themselves do not require a restart and take effect on the next match or during global reconciliation.
- Input trust level: Rule content is treated as untrusted input and processed only as text; it is not executed.
- Ecosystem note: This plugin is maintained by community user Temoa and has no official affiliation with DeepSeek or SkillHub.