插件目录 / Developer / dsh-simplify
dsh-simplify
已验证 · 实测可装 GongYuanCaiJi
功能简介
DeepSeek Harness插件:审查最近代码改动,提出清晰度、一致性、可维护性改进(移植自pi-simplify)
可用 — 实测通过,早期项目
DeepSeek Harness插件:审查最近代码改动,提出清晰度、一致性、可维护性改进(移植自pi-simplify) 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-simplify
简体中文 | English
一句话:改完代码打一句
/simplify,让 agent 只审查你刚改动的那几行,不碰其他地方。
移植自 pi-simplify(MIT),
上游的提示词与 git diff 解析逻辑逐字保留,只适配 DeepSeek Harness 的 API 差异。
✨ 功能
- 🎯 只审查改动行 —— 通过
git diff定位改动的文件与行号范围,agent 可以读周围代码当背景,但编辑严格限制在改动行内 - 🔍 四种范围 —— 未提交改动 / 已 staged / 与任意 ref 比较 / 指定文件
- 🧪 改完自己跑测试 —— 审查结束前会运行既有测试,确认没有改坏
- 📐 遵守项目规范 —— 自动遵循项目里的
CLAUDE.md/AGENTS.md约定 - 🈶 空白与引号文件名安全 —— 参数逐个 POSIX 单引号转义
📸 效果
在一个有未提交改动的仓库里:
> /simplify
read src/alpha.ts ← 只读被改过的文件
read src/beta.ts
edit src/alpha.ts ← 只改 4-5 行(本次改动范围内)
edit src/beta.ts ← 只改 3-4 行
bash npm test → 1 pass, 0 fail
agent 的总结会明确说明范围外的行为什么不动(示意):
Removed the intermediate variable `d`… Both edits stayed strictly within the
listed changed line ranges… the test suite passes (1 pass, 0 fail).
没有任何改动时:
> /simplify
No changed files found. Specify file paths or make some changes first.
📦 安装
dsh plugin --profile <你的 profile> add github:GongYuanCaiJi/dsh-simplify
安装时会通过 prepare 脚本自动构建 dist/。若 pnpm 拦下构建步骤,在 profile 的pnpm-workspace.yaml 里把本包加进 allowBuilds。
从本地目录安装(需要先自行构建):
git clone https://github.com/GongYuanCaiJi/dsh-simplify.git
cd dsh-simplify && npm install # 触发 prepare,产出 dist/
dsh plugin --profile <你的 profile> add ../dsh-simplify
🚀 用法
/simplify # 审查所有未提交的改动
/simplify --staged # 只审查已 staged 的改动
/simplify --ref=<ref> # 与指定 ref 比较,例如 --ref=main、--ref=HEAD~3
/simplify <file...> # 只审查指定文件
移植说明(对上游 [email protected])
逐字保留,cmp 验证一致:src/types.ts、src/prompt-builder.ts(含提示词全文)、
以及 src/git-diff.ts 的 STATUS_MAP / parseDiffOutput / parseChangedLines / diffArgs。
这一点你可以自己验,不必信我们 —— THIRD_PARTY_NOTICES.md
钉住了上游 tarball 的 integrity / shasum / gitHead 与逐字文件的 SHA-256,附可直接复制的比对命令。
六处适配(dsh 与 Pi 的 API 不同):入口改为 Cordis namespace 形状;命令改注册到 commands 服务;
工作目录取自 agent.session.header.cwd;「无改动」提示改为命令回传值;pi.exec 改走 ctx.shell(薄转接层,调用端零改动);提示词改用 agent.followup 送出。
已知限制: agent 收到的提示词是英文的 —— 那是上游原文,逐字保留未做翻译。
🛠 开发
npm install # 触发 prepare,产出 dist/
npm test # 构建后跑单元测试
tools/verify-driver/ 是仓库内的验收工具(不随包发布):它把一条 slash 命令通过真正的commands.execute 接缝跑完一整轮,用来做端到端验证。
它需要先装进目标 profile 才能用 --patch 挂载:
cd tools/verify-driver && npm install && cd ../..
dsh plugin --profile <你的 profile> add ./tools/verify-driver
dsh --profile <你的 profile> --patch tools/verify-driver/patch.yml "/simplify"
📄 License
MIT。上游 pi-simplifyCopyright (c) 2026 Matt Devy,本移植 Copyright (c) 2026 GongYuanCaiJi。见 LICENSE。
感谢 MattDevy/pi-extensions 的原作者 ——
如果这个插件对你有用,也请去给上游仓库点个 star。
English
One line: after editing, type
/simplifyand the agent reviews only the lines you just changed — nothing else.
A port of pi-simplify (MIT) to
DeepSeek Harness. The upstream prompt and
git-diff parsing are kept byte-identical; only the dsh API seams are adapted.
✨ Features
- 🎯 Changed lines only — locates changed files and line ranges via
git diff; the agent may read surrounding code for context but edits stay inside the changed ranges - 🔍 Four scopes — uncommitted / staged / against any ref / specific files
- 🧪 Runs your tests — verifies nothing broke before finishing
- 📐 Follows project standards — honours
CLAUDE.md/AGENTS.md - 🈶 Safe with spaces and quotes in paths — every argument is POSIX single-quote escaped
📦 Install
dsh plugin --profile <your-profile> add github:GongYuanCaiJi/dsh-simplify
The prepare script builds dist/ during installation. If pnpm blocks the build step,
add this package to allowBuilds in the profile's pnpm-workspace.yaml.
From a local checkout (build it first):
git clone https://github.com/GongYuanCaiJi/dsh-simplify.git
cd dsh-simplify && npm install # runs prepare, produces dist/
dsh plugin --profile <your-profile> add ../dsh-simplify
🚀 Usage
/simplify # review all uncommitted changes
/simplify --staged # review only staged changes
/simplify --ref=<ref> # diff against a ref, e.g. --ref=main, --ref=HEAD~3
/simplify <file...> # review only the given files
📄 License
MIT. Upstream pi-simplifyCopyright (c) 2026 Matt Devy; this port Copyright (c) 2026 GongYuanCaiJi. See LICENSE.
Thanks to the authors of MattDevy/pi-extensions —
if this plugin is useful to you, please also star the
upstream repository.
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-simplify」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:GongYuanCaiJi/dsh-simplify Headless(CLI)profile:
dsh plugin --profile headless add github:GongYuanCaiJi/dsh-simplify 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。
使用场景
扩展 agent 的编码能力面——给它一个新工具、工作流或集成,让它接手以前做不了的开发任务。
适合谁
想让 dsh 在真实代码库上像队友一样干活的开发者——能改、能跑、能验证,而不只是回答问题。
二次开发建议
工具/命令面就是缝:暴露更多 SDK 能力、加更聪明的上下文接线,或收紧改代码与验证之间的循环。