Introduction¶
DeepSeek Harness (DSH) emphasizes the “everything is a plugin” extension philosophy. In multi-project collaboration, developers often need to repeatedly paste the same “project specifications,” “code style,” or “notes” as system prompts in each conversation. The mycodesite/dsh-rules (RuleBase) plugin uses a file-driven approach to solidify these rules, achieving “write once, apply everywhere.”
What is this?¶
mycodesite/dsh-rules is a workflow plugin. It supports global and project-level Markdown rule files and automatically injects them into the AI context at the start of each conversation or when assembling the system prompt. Rule files are persisted in .md format and take effect immediately through a file-watching mechanism, without restarting DSH. The plugin provides a visual rule-management interface in the DSH settings panel.
Core Features¶
- Global + project-level injection: Global rules (default path
~/.dsh/rules) manage specifications shared by all projects; project rules (<cwd>/.dsh/rules) follow the current working directory (cwd), and the corresponding rules are applied automatically when switching projects. - File watching, immediate effect: Once a rule file is saved, it is captured immediately, and the next model request automatically uses it, without restarting.
- Visual rule management: In the “Rules” section of the DSH settings panel, you can directly add, delete, update, and query rules and refresh them with one click, with operation results visible immediately.
- Zero runtime dependencies: The plugin uses only compile-time type dependencies (
import type) for host dependencies, which are erased after transpilation.node_modulesis not required at runtime, and it can run directly in any new environment.
Installation and Activation¶
This plugin requires DeepSeek Harness >= 0.1.5-rc.1 and Node.js >= 22.5.
# 通过 GitHub 源安装
dsh plugin add github:mycodesite/dsh-rules
# 指定版本
dsh plugin add github:mycodesite/dsh-rules#v0.1.7
Typical Usage¶
- Create rule files: Create a
.dsh/rulesdirectory in the project root, or create.mdfiles under the global~/.dsh/rulesdirectory (the file name is used as the rule ID). - Configure rules: Check the recognized files in the “Rules” section of the DSH settings panel. If no project is selected, please start a project conversation first.
- Apply rules: Switch to the conversation for the specified project. The global rules and project rules will be automatically assembled and injected into the system prompt.
Applicable Scenarios and Notes¶
- Beware of name conflicts: Do not update this plugin from the plugin marketplace. A package with the same name exists on npm; installing that package prevents DeepSeek Harness from starting. Always install it via the GitHub source described below or a local tarball.
- Global path: The default global rule path is
~/.dsh/rules. If the environment variableDSH_HOMEis set, rules follow that variable. - Version compatibility: This plugin is adapted to the two-argument
rpc.handleand authentication mechanism in DSH >= 0.1.5-rc.1.
Conclusion¶
RuleBase helps turn the AI assistant into a “collaborator that understands your project’s rules.” Through file-driven rule injection, it eliminates repetitive verbal instructions and solidifies project specifications into manageable configuration. For detailed documentation and source code, see the GitHub repository.