GongYuanCaiJi/dsh-simplify ↗★ 0
dsh-simplify
DeepSeek Harness 插件:审查最近改动的代码,就清晰度、一致性与可维护性提出改进(移植自 pi-simplify)
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:GongYuanCaiJi/dsh-simplify说明文档
阅读完整 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 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 add ../dsh-simplify
🚀 用法
/simplify # 审查所有未提交的改动
/simplify --staged # 只审查已 staged 的改动
/simplify --ref= # 与指定 ref 比较,例如 --ref=main、--ref=HEAD~3
/simplify # 只审查指定文件