DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Rules — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins

dsh-rules

Rules

DSH 规则插件:通过 glob 匹配代理读取或编辑的文件,激活规则提示词 / Markdown 文档(Claude Code rules.md 风格)。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add dsh-rules@0.1.3
README兼容性版本

兼容性与来源证明

Rules 以 dsh-rules 发布,当前版本为 0.1.3。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
npm
Registry 更新时间
2026/9/13

版本

0.1.3stable
2026/9/13
0.1.2stable
2026/9/9
0.1.1stable
2026/8/29

相关插件

正在加载相关插件…

最新版
0.1.3
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
59.7 kB
文件数
8
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 2
周下载
0
最近提交
2026/9/13
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 developer-tools 分类下经过校验的插件。

Web App@deepseek-ai/dsh-web-appdsh 浏览器界面捆绑包:位于 dsh-base 之上的 Web 补丁层,加上运行时粘合插件(提供前端 dist、Web 界面提示符、bash 运行时变量和 URL 行)Sdk Minimal@deepseek-ai/dsh-sdk-minimal独立的最小 SDK 配置包:JSON-RPC、一个 DeepSeek 适配器、持久化 Shell 和 JSONL 会话Sdk App@deepseek-ai/dsh-sdk-appdsh SDK 配置包:基于 dsh-base 提供 stdio JSON-RPC 服务和进程生命周期管理Subagent Codex@deepseek-ai/dsh-subagent-codex基于官方 app-server 协议的一次性 Codex 子代理提供程序

README

dsh-rules

English | 中文

Glob-activated rule prompts for DeepSeek Harness (DSH) — a Claude Code rules.md / # Path:-style mechanism. Each rule declares glob patterns; when the agent reads or edits a matching file, the rule activates and its content (any prompt or markdown document) is injected into the conversation as a superseding <rules> snapshot.

Works in every DSH deployment: desktop / web / tui / headless / custom profiles — nothing about this plugin is desktop-specific.

Contents

  • Features
  • How it works
  • Installation
  • Rule format
  • Configuration
  • Discoverability
  • Limitations
  • Development
  • License

Features

  • Glob activation — rules activate per file the agent touches: **, *, ?, {a,b}, [abc], and ! negation (picomatch).
  • Claude Code compatible — plain rule files (.dsh/rules/*.md) and # Path: sections inside CLAUDE.md / AGENTS.md.
  • Visible & durable — active rules are injected as a user message the UI shows and the session log persists; each injection appears in the chat as a collapsible row (same chrome as tool-call rows) with a one-line notice — e.g. dsh-rules · Active rules: typescript, docs — expanding to the full rules text. Each snapshot supersedes earlier ones, so the model always sees the current set.
  • Budget-bounded — byte-budget rendering (32 KB default): low-priority rules are dropped first, then the last rule is truncated; content is escaped so it can never break out of the framing tags.
  • Resume-friendly — on session resume the last snapshot and its matched files are restored from the log, preventing duplicate injection.
  • Per-session tracking — every agent/session tracks its own touched files (subagents included); global rules (no path:) are always active.

How it works

workspace
  .dsh/rules/*.md    ← rule definitions (frontmatter declares globs)
  ~/.dsh/rules/*.md  ← user-level rules (optional)
  CLAUDE.md          ← optional: # Path: sections (Claude Code compatible)

agent reads/edits a file (fs/observed) → record per-session touched path
  ↓ every step (agent/pre-step)
match touched paths against globs → collect active rules → render a <rules> snapshot into the conversation
  • Injection point: an agent/pre-step waterfall listener appends a <rules>-framed user message; a new message is only appended when the snapshot text changes.
  • Discovery & caching: rule sources are re-probed per step with version caching (fs.stat().version, or mtimeMs:size on the Node fallback) — edits to rule files take effect on the next step.
  • Reads: prefer the harness fs service (containment-aware); fall back to Node's filesystem when no fs service is mounted.

Installation

Any DSH deployment (generic)

Published on the npm registry — dsh plugin installs and activates the plugin in one step:

# Adjust the profile name: desktop / web / tui / headless
dsh plugin --profile desktop add dsh-rules

The package declares dsh.bundle.patch, so the reconcile pass of dsh plugin add appends dsh-rules to the profile's dsh.profile.bundles layer list automatically — no manual cordis.patch.yml edits are needed. Restart DSH (restart the desktop app; restart the web/headless process) and the plugin loads with the next Cordis composition.

Updates: dsh plugin --profile desktop update dsh-rules (or remove + add).

Installing from a local checkout (development):

# From the repo root — activates the bundle automatically, same as the registry install
dsh plugin --profile desktop add .

⚠️ pnpm splits add arguments on spaces, so a repository path containing spaces must be installed through a no-space junction (see below).

DSH Desktop (Windows) one-click script

# 1. Clone this repository, then from the repo root:
node scripts\install-desktop.mjs

# 2. Restart DSH Desktop — the plugin loads with the next Cordis composition

The script creates a no-space junction to the repo and runs the desktop app's own dsh plugin add through it (pnpm splits add arguments on spaces, so a repository path containing spaces must go through the junction):

# 0) Create a no-space junction to the repository (needed when the path contains spaces)
mklink /J "C:\code_repos\dsh-rules" "C:\code_repos\dsh rules plugin"

# 1) Install via the desktop's own dsh command (through the junction path)
& "C:\Program Files\DSH Desktop\DSH Desktop.exe" --expose-internals `
  "C:\Program Files\DSH Desktop\resources\app.asar.unpacked\lib\desktop-cli.js" `
  plugin --profile desktop add "C:\code_repos\dsh-rules"

Per-profile configuration (optional): the plugin loads with its code defaults; to customize, override the entry's config in <profile>/cordis.patch.yml:

- id: dsh-rules
  name: dsh-rules
  config:
    includeClaudeSections: true
    projectRootMarkers: [".git", ".dsh"]

Uninstall: node scripts\install-desktop.mjs --uninstall (or dsh plugin --profile desktop remove dsh-rules), then restart the app. Installing/uninstalling never touches the DSH installation directory (resources\app.asar.unpacked) — only profile configuration, fully reversible.

Rule format

Source A: rule files (.dsh/rules/*.md and ~/.dsh/rules/*.md)

---
path:
  - "src/**/*.ts"
  - "!src/**/*.test.ts"
---
Rule body (markdown, injected verbatim when active — any prompt content works)
Frontmatter fieldDescription
pathString or list of globs, relative to the project root, / separators; ! prefixes mark exclusion patterns. Absent or empty = always-active global rule (active for any session in the workspace).
nameOptional; rule identity (used for same-name deduplication). Defaults to the file name without .md.

Source B: # Path: sections (requires includeClaudeSections: true)

Parses # Path: <globs…> headings out of AGENTS.md / CLAUDE.md (including .local.md variants and ~/.dsh/AGENTS.md):

# Project notes (content before the first heading is handled by the built-in agent-instructions baseline, not by this plugin)

# Path: src/**/*.ts, scripts/**
This section activates only when a file under src/**/*.ts or scripts/ is touched
  • Each # Path: heading starts a rule that runs until the next heading (or end of file).
  • Globs may be comma- or space-separated.
  • Content before the first # Path: heading is intentionally not injected by this plugin — DSH's built-in agent-instructions already injects the full AGENTS.md/CLAUDE.md baseline.

Precedence & deduplication

Project rules (rank 100) > user rules (rank 200) > # Path: sections (rank 300). Same-name rules keep the highest-priority entry; rendering order is (rank, name) — deterministic across steps.

Configuration

OptionDefaultDescription
dshHome$DSH_HOME / ~/.dshRoot for user rules and ~/.dsh/AGENTS.md
projectRootMarkers[".git"]Marker files/dirs used to find the project root by walking up
ruleDirNames[".dsh/rules"]Rule directories inside the project (relative to the project root, multiple allowed)
includeUserRulestrueEnable ~/.dsh/rules/*.md
includeClaudeSectionsfalseParse # Path: sections
instructionFileCandidates["AGENTS.md", "CLAUDE.md"]Candidate file names for # Path: sections
localInstructionFileCandidates["AGENTS.local.md", "CLAUDE.local.md"]Per-directory candidate file names
maxBytes32768Per-injection render budget (UTF-8 bytes); <= 0 disables the plugin
maxSourceBytes1048576Per-rule source size cap; larger files are skipped
maxTouchedPaths512Touched-path cap per session (FIFO eviction)

Discoverability

This plugin is discoverable through the GitHub dsh-plugin topic — the channel recommended by the DeepSeek Harness README ("Community and support": Add the dsh-plugin topic to your plugin repository for discoverability). Community plugin lists and marketplaces (e.g. awesome-dsh-plugin, dsh-plugin-marketplace) scan that topic to pick up new plugins; the tag can be viewed/edited in the repository's About section.

Limitations

  • Only files inside the project root can activate rules; reads outside the root never trigger (avoids ../ false positives).
  • The touched-path set is in-memory: after resuming a session, rules re-activate as the agent re-reads files (the previously matched list is restored from the log).
  • Deployments with includeRuntimeContext: false are unaffected — this plugin injects its own message and does not depend on the runtime-context snapshot.
  • Rules are injected as "superseding snapshot" messages; the session log retains historical snapshots, but each snapshot is the complete current set and the model follows the latest one.

Development

pnpm install
pnpm test        # node --test: parsing / glob matching / precedence / budget / determinism / fs fallback

Layout:

  • lib/index.js — plugin entry (name / Config / apply): fs/observed touch tracking, agent/pre-step injection, agent/disposed cleanup.
  • lib/rules.js — pure logic: frontmatter and # Path: parsing, glob compilation/matching, precedence merging, budget rendering.
  • lib/fs.js — versioned discovery/reads: harness fs service first, Node fallback.
  • test/rules.test.mjs — unit tests.
  • examples/.dsh/rules/ — sample rules (copy into your project to get started).
  • fixtures/demo-project/ — a ready-made project for trying the plugin out.

License

MIT