@temoa/dsh-rules-paths
Claude Code-style `paths:` rule injection for DeepSeek Harness (DSH): inject rules from ~/.dsh/rules, <project>/.dsh/rules and <project>/.claude/rules into the model context.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Temoa/dsh-rules-paths说明文档
阅读完整 README ↗dsh-rules-paths
面向 DeepSeek Harness (DSH) 的 Claude Code 风格 paths: 规则注入插件。
读文件 → 命中规则在下一步边界注入会话上下文。机制与官方 @deepseek-ai/dsh-agent-instructions 同构(tools/result 挂钩、agent.inbox.nextStep 收件箱、agent/pre-step 折叠、SHA-1 去重、字节预算)。
English | 中文
特性
- 路径规则:规则文件用
paths:声明 glob;模型成功read命中文件后,下一步边界注入规则正文。 - 全局规则:没有
paths(或完全没有 frontmatter)的规则,在会话第一个进入的 step 即注入,不依赖任何文件读取(时机同AGENTS.md)。 - 项目级规则:可选扫描
/.dsh/rules和/.claude/rules(Claude Code 约定),以.git标记项目根。 - 去重与预算:同一规则每会话只注入一次,内容变化时以
replace更新;注入消息恒不超过maxBytes,省略/截断时给出Rules budget …提示。 - 指导,不是强制:注入内容是 user 角色消息,不覆盖 system/developer/用户直接指令;字面 `` 会被转义。
安装
方式 A:作为包装进 profile(dsh plugin add),无需 npm
直接从 GitHub 安装(按 commit 固定并带完整 integrity 哈希):
dsh plugin --profile web add git+https://github.com/Temoa/dsh-rules-paths.git
# (装到 $DSH_HOME/profiles/
/node_modules;preset 行的裸包名从
# profile 基址解析,父级 $DSH_HOME/profiles/node_modules 平铺符号链接兜底内置包)
包声明了 dsh.bundle.patch(cordis.patch.yml),reconciler 会自动把它加入
profile 的 dsh.profile.bundles —— 插件挂到 profile(host)级,该 profile 上
所有会话都启用规则注入,无需改任何 preset。若只想在某个 preset 启用,
改为在用户 preset(standard 的副本)里加一行:
- id: rules-paths
name: '@temoa/dsh-rules-paths'
config:
rulesDir: "~/.dsh/rules"
rulesDirProject: true
卸载:dsh plugin --profile web remove @temoa/dsh-rules-paths。
改插件代码后必须完整重启 harness:模块按 URL 在进程内缓存,preset 每次挂载会重读,但插件不会重新 import;规则文件本身永远不用重启。 不要改随附预设(///)——复制一个再改。