DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

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

dsh-prompt-injector

Prompt Injector

适用于 DeepSeek Harness web profile 的通用逐轮提示词注入器——在设置页面管理上下文提示词列表(带启用开关);每轮对话都会将每个已启用的提示词作为通知行(「上下文注入 xxx」)注入模型上下文,效果与 mem0 recall reminder 完全一致。仅包含主

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

npx -y @deepseek-ai/dsh plugin --profile web add github:runfali/dsh-prompt-injector#131860a5631f9bc1399918da7a50831602b00490
README兼容性版本
Injection in action — one expanded notice row per enabled promptSettings card — master switch, trivial-round filter, editable prompt list

说明

适用于 DeepSeek Harness web profile 的通用逐轮提示词注入器——在设置页面管理上下文提示词列表(带启用开关);每轮对话都会将每个已启用的提示词作为通知行(「上下文注入 xxx」)注入模型上下文,效果与 mem0 recall reminder 完全一致。仅包含主机端逻辑和客户端设置卡片;无需修改 dsh 源码。

兼容性与来源证明

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

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/9/3

版本

0.2.0stable
2026/9/1
0.1.0stable
2026/8/27
查看其余 1 个版本收起版本
0.1.2-rc.1prerelease
2026/9/3

相关插件

正在加载相关插件…

最新版
0.2.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 1
周下载
0
最近提交
2026/9/3
查看源码 ↗
README Badge

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

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

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

认领这个 Plugin →
报告问题

相关插件

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

Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Weknora@wxg-prc-cpg/dsh-weknora适用于 DeepSeek Harness (dsh) 的 WeKnora 知识检索工具:通过自有知识库进行语义搜索、文档阅读以及 RAG/代理回答。Memsearch Dsh@zilliz/memsearch-dsh适用于 DeepSeek Harness 的 MemSearch 插件:在多个代理之间共享 Markdown 记忆,支持捕获、步骤前上下文注入、记忆召回技能和技能候选审核面板。Memory@furongjun1999/dsh-memory灵枢(Lingshu·líng shū)DeepSeek Harness 插件:完整大脑——长期记忆/知识飞轮/自我认知/递归反思接入 DSH,对话自动沉淀进 md_cg 认知图(md 文档)

README

dsh-prompt-injector

English | 简体中文

Generic per-turn context injection for the DeepSeek Harness (dsh) web profile. Manage a list of prompts in the settings page; every conversation round injects each enabled prompt into the model context as a compact collapsed "Context injection" notice line (the leading label and the plugin name are added by the UI; the row title is your prompt title) — the exact mechanism used by memory plugins, made reusable for any rule you want the model to actually follow.

[context injection | dsh-prompt-injector] 图谱·Wiki 提醒  ← one notice line per enabled prompt,
[context injection | dsh-prompt-injector] 回复结构 1-2-3   ← every round, right before the model
[context injection | dsh-prompt-injector] 安全红线清单     ← plans its answer

[!IMPORTANT] Design intent. The plugin reminds, it never executes: it calls no tools and checks nothing itself. A good prompt writes down when to check, when to skip, and what to run — the model still decides per round. See Writing good prompts.

It ships as a standard dsh bundle plugin: dsh plugin add to install, dsh plugin remove to uninstall. It changes no dsh source code.


Table of Contents

  • Why
  • Features
  • How it works
  • Requirements
  • Installation
  • Configuration
  • Writing good prompts
  • Development & testing
  • License

Why

Rules written only in the persona/system layer are unreliable: models reliably lose track of them in long sessions, even when the rules are explicit ("refresh the code graph before coding", "check the wiki first for factual questions" — measured to silently not happen session after session).

Per-round injection, on the other hand, reaches the model's context every turn and is rendered as a visible notice line in the UI (collapsed summary readable at a glance). This is the mechanism dsh-mem0-plugins uses for its memory-recall reminder — this plugin generalizes it: instead of writing a new plugin for every discipline (memory, code graphs, wiki lookup, safety redlines, reply style…), add a prompt in the settings page.

Features

CapabilityBehavior
Per-round injectionOn agent/pre-step, when the round carries fresh user input, every enabled prompt is appended to this round's context as a form:'notice' plugin-source message — one "Context injection" line each.
Trigger modesEach prompt row picks everyTurn (default) or postCompaction: injected exactly once on the next substantive round after a context compaction (counts committed compaction/summary events per session; no repeat within the same compaction; zero LLM cost).
Master switchenabled turns injection on/off globally (settings page or config).
Trivial-round filteringskipTrivial (default on) skips brief acknowledgements/greetings/continuations (好的/嗯/收到/继续/ok/thanks…), so reminders don't nag; substantive input (e.g. "继续帮我看看那个报错") still gets them.
Prompt management UIAdd / delete / edit prompts, per-row enable switch, per-row title + body, all in the settings page.
Remind only, never executeThe plugin calls no tools and runs no checks; judgment stays with the model.
Zero intrusionNo dsh source changes; only two small runtime deps (@deepseek-ai/dsh-settings, @deepseek-ai/schemastery); standard bundle install/uninstall.

How it works

  • Injection point: agent/pre-step → the plugin appends to decision.messages (same hook chain as dsh-mem0-plugins). One message per enabled prompt, role: user, source: { kind: 'plugin', form: 'notice', summary: '<title>' } — the UI renders it as a collapsed notice line whose summary is visible without expanding.
  • Hooking: listens to agent/created for new agents and backfills pre-existing agents at apply time (a WeakSet guards against double registration).
  • Trivial detection: acknowledgement/greeting/continuation lexicon (ported from dsh-mem0-plugins, itself from hermes is_trivial_prompt, MIT) + slash-command pattern; input carrying real content is never miscategorized.
  • Compaction generations: a plugin-level session/event listener counts committed compaction/summary events per session; postCompaction rows fire once per generation (applied-generation tracked per prompt, cleared on session/disposed). Old configs without trigger behave as everyTurn — zero migration.
  • Persistence: prompts live in the dsh settings store (user layer), editable in the settings page, saving immediately without a restart.

Injection in action — one expanded notice row per enabled prompt

Requirements

  • DeepSeek Harness (dsh) web profile, Node ≥ 22.
  • The prompts you write may reference your own tooling (code graph services, wiki search commands, …) — those are just text; nothing is executed by the plugin.

Installation

dsh plugin --profile web add /path/to/dsh-prompt-injector
# restart dsh

Uninstall: dsh plugin --profile web remove dsh-prompt-injector

After restart, open Settings → Plugins → "Context injection" to manage prompts. The prompt list starts empty — nothing is injected until you add your own.

Configuration

Settings card — master switch, trivial-round filter, editable prompt list

KeyTypeDefaultMeaning
enabledbooleantrueMaster switch.
skipTrivialbooleantrueSkip trivial rounds (ack/greeting/continuation).
promptsarray[] (empty)Prompt list: [{ id, title, text, enabled, trigger }]; trigger is everyTurn (default) or postCompaction.

The settings page edits these; the user layer wins over the composition defaults. To override via the profile patch:

# ~/.dsh/profiles/web/cordis.patch.yml
- insert:
    - id: prompt-injector
      name: dsh-prompt-injector
      config:
        enabled: true
        skipTrivial: true
        prompts:
          - id: my-rule
            title: My rule
            text: |
              [my-rule] Before answering, judge: does this round need it?
              ...
            enabled: true

Prompt examples (not built in)

The plugin ships with an empty list — the mechanism is generic, the content is yours. Two examples from real deployments you can copy and adapt. "图谱·Wiki 提醒" (everyTurn; code graph + wiki reminder) demonstrates the intended "judge first" style:

[graph-wiki requirement] 本轮开始,先判断是否需要查图谱/Wiki,再决定是否执行——不是每轮都要查:
① 编码任务(本轮要改代码)→ 消费图谱:目标仓库先 `code-review-graph update` 刷新(无图谱则自动建库),然后 `crg search/impact/stats` 查询(多仓库自动发现:--repo <别名|路径> > 当前目录 .git 根 > 兜底 mem0_falkordb;`crg xsearch` 全仓搜索),深层结构用 graphify 查询(graphify-mcp 5566)。只改文档/纯叙述/无代码改动则跳过刷新。
② 技术事实类问题(版本/行为/配置/术语/流程步骤)→ 先 `gmcp search '{"query":"..."}'` 查 wiki(score≥0.45 取前 3 页,读页后再答,标注 [[wikilink]] 来源)。
③ 纯闲聊、纯算术、无事实成分的简单操作 → 跳过,直接回答。
若不确定属于哪类:宁可查一次(gmcp 或 crg 成本低),不要凭记忆给过时答案。

The commands referenced (crg, graphify, gmcp) belong to that deployment's own graph/wiki tooling — replace them with whatever your environment actually has.

"压缩后提醒" (postCompaction) fires once after each compaction, when early transcript is unrecoverable:

[上下文已压缩] 本轮之前发生过 compaction,早期原文不可恢复。
涉及历史事实、报错原文、文件路径、此前决定时,先 mem0_search 或重读相关文件核实,勿凭印象引用。

Writing good prompts

The plugin's value comes from how you phrase each prompt. Advice that worked in practice:

  1. State the judgment condition, not just the action. "Before coding, refresh the graph" alone will over-trigger; add the skip branch: "…unless this round only touches docs/narration".
  2. Explicitly allow skipping. Rounds without factual content or code work should be told "just answer directly" — otherwise a mandatory-sounding prompt burns tokens and attention every round.
  3. Give a fallback for uncertainty. "If unsure which category, one lookup is cheap — don't answer from stale memory."
  4. Keep it short. One screen or less per prompt; a wall of text gets skimmed, not followed.
  5. Consider frequency. An everyTurn prompt is injected every round. If a rule is only relevant to a specific task type, that's fine (the model filters by the judgment text) — but don't stack many long prompts. Rules that only matter after a context compaction should use postCompaction.

Development & testing

node --test test/smoke.mjs        # host logic: defaults, normalization, injection decision, generations
node --test test/entry-smoke.mjs  # host entry load + pre-step/compaction end-to-end
node test/client-smoke.mjs        # client bundle: slot contract, locale, card rendering, trigger select

Layout:

  • src/index.js — plugin entry: settings.installSection wiring (dsh 0.1.2-alpha.3+) + agent/pre-step injection + agent hooks/backfill.
  • src/logic.js — zero-dependency pure logic (defaults, normPrompts, isTrivialPrompt, makePromptMessage, shouldInject, selectPrompts generation selector).
  • lib/client.js — settings card (master switch + trivial toggle + prompt list editor), PInj_ prefixed styles.

License

MIT