bvcvb/dsh-baize-rules
DeepSeek Harness (DSH) plugin — inject durable user-set session/global must-do / must-not requirements into the model at conversation start (Baize).
Project Overview项目介绍
dsh-baize-rules (Baize) is a plugin built specifically for the @deepseek-ai/dsh harness, named after the mythical beast Baize that "understands the nature of all creatures." At the start of every conversation it injects the user's plain-text, durable "must-do / must-not" rules into the model request as a persistent user/message, wrapped in a <system-reminder> frame and tagged with source.kind='plugin' plus plugin='baize-rules'. The rule bodies carry no must / mustNot markers — the body language itself decides whether something is required or forbidden — and if no rules are active (or the byte budget cuts all of them) the plugin returns undefined and never emits an empty reminder shell. It installs through the dsh package, registers the /baize-rules slash command, mounts an HTTP API at /baize-rules.api, and exposes a web panel.
The plugin supports three scopes — global (all sessions), session (the current session) and project (the session's working directory) — all of which ultimately reach the model; render precedence is project > session > global, and tighter byte budgets keep the more specific rules first. State is persisted under $DSH_HOME (default ~/.dsh), tolerant reads turn a broken or hand-edited file into an empty scope plus a problems warning instead of failing the conversation, and every write carries the file version it read so concurrent edits are refused with a retry hint rather than silently overwritten. Both the command and the panel share the same store, deduplicate by SHA-1 of the rendered text, republish the snapshot after startup/resume/clear/compact or once it is refreshAfterSteps steps old (default 20), escape literal </system-reminder> in user bodies, and offer tag filtering plus a JSON exportable/importable template library whose application produces a content copy rather than a live link.
For development the repo is a pnpm + TypeScript project whose fast feedback loop is pnpm dev:render (sub-second, without touching dsh); other scripts cover pnpm test, pnpm test:watch, pnpm test:client, pnpm build, pnpm typecheck and pnpm check:exports, with sources split across src/rules.ts, src/core.ts, src/store.ts, src/command.ts, src/index.ts, src/api.ts, src/invariant.ts and a cordis.patch.yml mount. License is MIT and dependencies are Node.js with pnpm. First-run caveat: the CI publish job in .github/workflows/ci.yml requires an NPM_TOKEN secret that is not configured, so every v* tag fails with npm error code ENEEDAUTH (verified on v0.1.3–v0.1.5); the version that actually ships is the one you push locally with npm publish --access public after building, typechecking and testing.
dsh-baize-rules(白泽)是面向 @deepseek-ai/dsh 的插件,以白泽命名寓意通晓万物之性。它在每次会话开始时把用户预先设定、纯文本写成的"必须做/不可做"规则,封装进 <system-reminder> 框架中,作为带 source.kind='plugin' 标识的持久 user/message 注入到模型请求里。规则不依赖 must/mustNot 标记,由正文语言本身表达,且通过 dsh 包安装后挂载为插件并提供 /baize-rules 命令与 Web 面板。
插件支持 global(跨全部会话)、session(当前会话)与 project(会话工作目录)三级作用域,所有规则都最终抵达模型;渲染顺序为 project > session > global,字节预算紧张时优先保留更具体的规则。文件持久化在 $DSH_HOME(默认 ~/.dsh),损坏文件仅降级该作用域并写入 problems 警告,不阻断会话。面板与命令共享同一核心,并提供 SHA-1 去重、refreshAfterSteps 重新发布、标签筛选、模板库 JSON 导入导出以及基于文件版本的冲突安全写入。
运行依赖 Node.js 与 pnpm,工作流脚本包括 pnpm dev:render、pnpm test、pnpm build 与 pnpm test:client 等;/baize-rules 命令在前端面板与核心之间复用同一存储。许可为 MIT,但 .github/workflows/ci.yml 中的 NPM_TOKEN 尚未配置,带 v* 标签的发布任务会因 ENEEDAUTH 失败,实际发布需本地 npm publish --access public。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-baize-rules(bvcvb/dsh-baize-rules)
仓库:https://github.com/bvcvb/dsh-baize-rules
本站详情页:https://www.yhbd.top/plugins/bvcvb-dsh-baize-rules/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-09-22 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-baize-rules@0.2.4
把 bvcvb/dsh-baize-rules 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-baize-rules
English | 简体中文 — 中文说明见 README.zh.md。
dsh-baize-rules (Baize) is a dsh plugin that injects user-set, durable "must-do / must-not" requirements — plain-text rules — into the model at conversation start as a sourced user/message.
The name comes from Baize (白泽) — a mythical beast said to "understand the nature of all creatures, know the names of all things, and comprehend the principles of everything." It carries the behavioral baseline that the user sets for the model.

- Rules are plain text with no
must/mustNotmarkers — whether something is "must-do" or "must-not" is expressed by the language of the body itself (e.g.Write comments in Chinese.= must,Do not delete the tests.= must-not). - Injection happens at the start of a conversation: the currently active rules are injected into the model request as a persistent
user/message, wrapped in a<system-reminder>frame, withsource.kind='plugin'andplugin='baize-rules'. - No rules → no injection; if the byte budget shrinks such that all rules are cut, it returns
undefinedand never injects an empty reminder shell.
Features
| Feature | Description |
|---|---|
| Three scopes, all injected | global (all sessions) / session (current session) / project (the session's working directory — this directory only): all three reach the model |
| Persistence | Everything is written to $DSH_HOME (default ~/.dsh); survives across sessions and restarts |
| Specificity wins | Render order project > session > global; when the byte budget is tight, the more specific rules are preserved first |
| A corrupt file never breaks a step | Rule files are read tolerantly: a broken or hand-edited file degrades that scope to empty and surfaces a problems warning, instead of failing the conversation |
| Deduplication | Suppresses duplicate injection by SHA-1 digest of the rendered text; optional injectAtEveryStep forces a refresh on every step |
| Stays present in long threads | The snapshot is republished when the text changes, after a session lifecycle change (startup / resume / clear / compact), and once the last copy is refreshAfterSteps steps old (default 20) — so the rules are never left behind only at the top of a long conversation |
| Escape protection | Literal </system-reminder> in rule bodies is escaped so user text can't close the plugin's frame |
| Command + API share the same source | The /baize-rules command and the front-end panel use the same store/core, so there is always a single source of truth |
| Tags | Rules can carry free-text tags (flow, #frontend) that the panel filters by. Panel-only by default — tags cost no model-context budget (injectTags opts in) |
| Template library | Save frequently used rules as templates (body + tags) and apply them to any scope; export/import the library as JSON to move it across machines and sessions. Applying a template makes a content copy — later template edits do not rewrite the rules you already added |
| Conflict-safe writes | Every write carries the file version it read; if another window changed the file in between, the write is refused with a retry hint instead of silently overwriting |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
liangmianya/dsh-synapse
alaliqing/claude-paper
acryldev/acryl
omdsh-dev/dsh-annotation
Anionex/dsh-turn-rewind
Tyan66666/billion-context-dsh
qkycir-123/dsh-run2skill