DeepSeek Harness plugin

dsh-repo-context

把 git 状态与仓库规范动态注入 system prompt:分支/脏文件数/最近提交 + 仓库规范指引(官方 system-prompt section/context/variable 缝隙插件)

Jump to install

Source facts

Repository
qing3a/dsh-repo-context
Latest update
Aug 14, 2026
Category
Tools & Capabilities
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/qing3a/dsh-repo-context
Plugin: dsh-repo-context
Author: qing3a

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer2 files
README.mdSource · read only

dsh-repo-context

> 把 git 状态与仓库规范 动态注入 system prompt——DSH 的 system-prompt 缝隙插件 > (官方 docs/subsystems/system-prompt.md 能力,生态真空位)。

模型每轮组装 prompt 时,自动带上当前仓库的分支/脏文件/最近提交,以及"遵循仓库规范"的指引——不用人肉重复,也不污染历史(走 durable context,变化才记录)。

安装 / 卸载

# 安装(web profile 示例)
dsh plugin --profile web add @qing3a/dsh-repo-context
# 卸载
dsh plugin --profile web remove @qing3a/dsh-repo-context

重启 DSH 后生效。源码安装:dsh plugin add link:<本仓库路径>

Quick start

默认配置即用:在任意 git 仓库内运行,插件自动注入分支/脏文件数/最近提交 + 仓库规范指引。

dsh web --profile web
# 会话中模型即可看到 "Git repository: branch `main`, working tree clean, last commit ..."

Configuration

配置默认说明
enabledtrue总开关
gitContexttrue注入 git 状态 context(分支/脏文件/最近提交)
repoRulestrue注入仓库规范指引 section
refreshSeconds0git 状态缓存刷新间隔(秒),0 = 仅启动时取一次
recentCommits1最近提交展示条数
# profile 的 cordis.patch.yml 覆盖
- update:
    - id: dsh-repo-context
      config:
        refreshSeconds: 60

Permissions & data

  • 只读:仅执行 git rev-parse / git status --porcelain / git log,不写文件、不改配置、无网络请求
  • git 信息只在进程内缓存,不持久化、不外发

Compatibility

  • DSH mainline 47f94385(rc.5 + npm-public 后)实测通过
  • 依赖 ctx.systemPrompt@deepseek-ai/dsh-system-prompt,base bundle 默认挂载)

Verification

dsh-plugin-verify 0.1.2(mock 平台感知修正后)实测:

✅ 通过 | 捕获事件: 13 | waterfall: 7/7 | tools/result: 是
R1-entry-shape ✓  R2-patch-yaml ✓  R3-tools-result ✓(工具真实执行成功,isError:false)

报告:https://github.com/qing3a/dsh-plugin-verify/blob/main/reports/repo-context-2026-08-14.json (判定站已收录 ✅ Verified:https://github.com/qing3a/dsh-plugin-verify)

Development

pnpm install        # 或 npm install
pnpm build          # tsc → lib/

源码要点:text/variable provider 是官方同步签名,git 状态在 apply 时预取缓存(refreshSeconds 定时刷新);变量名 git_branch 满足官方 ^[a-z][a-z0-9_]*$ 约束;namespace 入口无 export default(postmortem 0001)。

License

MIT