D
dsh-tool-code-review
v0.1.0 · 3 天前发布
DSH plugin: structured code review tool — Agent reads git diff, reviews for bugs/security/style, outputs actionable findings.
README
dsh-tool-code-review
DSH 插件:结构化代码审查 — Agent 读取 git diff,按 checklist 逐项审查,输出可操作的发现。
工具
| 工具 | 功能 |
|------|------|
|
review_diff | 获取并解析 git diff,返回结构化文件变更摘要 |
|
review_file | 读取文件指定行范围(带行号,方便定位问题) |
|
review_checklist | 生成审查 checklist(bugs/security/style/performance/tests/docs) |
使用示例
User: 帮我 review 一下当前的改动
Agent:
→ review_diff({ target: "main" })
// 获取与 main 分支的 diff,了解改了什么
→ review_checklist({ checks: ["bugs", "security"] })
// 生成要检查的点
→ review_file({ path: "src/auth.ts", startLine: 45, endLine: 80 })
// 深入看可疑的代码段
审查结果:
1. [Security] src/auth.ts:52 — 用户输入直接拼接到 SQL,存在注入风险
2. [Bug] src/handler.ts:28 — async 函数缺少 try/catch,错误会被吞掉
3. [Style] src/utils.ts:15 — 未使用的 import
配置
```yaml
- id: code-review
版本兼容矩阵
| DSH 版本 | 状态 | 说明 |
|---|---|---|
dsh@0.1.0-rc.6 | ❓ 未知 | metadata 缺失 |
dsh@0.1.0 | ❓ 未知 | — |
dsh@0.2.0 | ⚠️ 待验证 | 待实测(API 可能在变) |
dsh@0.3.0+ | ❓ 未知 | 尚未发布 |
💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正
元数据
- License
- MIT
- npm
- dsh-tool-code-review
- Repo
- —
- Engines
{}- Weekly DL
- 0
- Monthly DL
- 0
- dsh.bundle
{}