dsh-baize-rules: Durable Rule Injection for DeepSeek Harness
bvcvb/dsh-baize-rules
Baize is a DeepSeek Harness (DSH) plugin that injects user-defined plain-text must-do / must-not rules — global, session or project scoped — into the model at conversation start so your behavioral baseline persists.
dsh-baize-rules is a rule injection plugin for DeepSeek Harness that turns the must-do and must-not requirements you write down into durable constraints the model reads at the start of every conversation. It removes the chore of repeating the same instructions in each new session: rules are kept as plain text locally and injected automatically as a sourced message when a conversation begins. Rules live in global, session, or project scope, more specific ones take priority, and a tight byte budget never leaves an empty reminder shell behind.
How to Install
dsh plugin --profile web add dsh-baize-rules- Category
- Tools & Capabilities
- Platform
- DSH Plugin
- Author
- bvcvb
- Distribution
- Plugin
dsh-baize-rules Key Features
dsh-baize-rules Repo Summary
What Does It Do?
Baize is a DSH plugin for DeepSeek Harness that turns the durable "must-do / must-not" requirements you write down into constraints the model reads at the start of every conversation. It solves the problem of repeating the same instructions in each new session: rules are stored as plain text locally and injected automatically as a sourced user/message when a conversation begins. Rules can live in global, session, or project scope, with more specific rules taking priority, and the plugin never injects an empty reminder shell.
Core Features
- Three scopes: global applies to all sessions, session applies to the current one, and project follows the session working directory (experimental).
- Local persistence: everything is written to the DSH home directory (default ~/.dsh) and survives across sessions and restarts.
- Specificity wins: render order is project > session > global, and the more specific rules are preserved first when the byte budget is tight.
- Deduplication: duplicate injection is suppressed by the SHA-1 digest of the rendered text, with an optional per-step forced refresh.
- Escape protection: literal delimiters inside rule bodies are escaped so user text cannot close the plugin's injection frame.
- One source of truth: the slash command and the front-end panel share the same store and core logic.
How to Use This Plugin?
After enabling it in DSH, manage rules through the /baize-rules command family: with no argument it behaves like list and shows the active rules; add puts a plain-text rule into the default scope, while global add writes it globally; edit, disable, and enable change the text, turn a rule off, or turn it back on; scope switches the default scope for later commands, clear empties one scope, and export dumps all rules as JSON. Write rules in natural language, such as "Write comments in Chinese" for a must-do or "Do not delete the tests" for a must-not; no must / mustNot markers are required.
How to Troubleshoot This Plugin?
If a rule seems to have no effect, first confirm that an enabled rule actually exists in the current scope — with no rules the plugin injects nothing, and if the byte budget cuts every rule it returns nothing rather than an empty reminder shell. If you suspect duplicate injection, check whether the per-step forced refresh is on, or whether an edit changed the rendered digest. When delimiters inside a rule body cause framing problems, follow the official instructions to verify that escaping is working.
This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: bvcvb/dsh-baize-rules. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.
