DeepSeek Harness plugin

dsh-code-scan

DeepSeek Harness 插件:为 Agent 增加 code_scan 工具,用 semgrep 扫描代码并输出按文件/行号/严重级别分组的中文报告

Jump to install

Source facts

Repository
xiaohuang-zaianlian/dsh-code-scan
Latest update
Aug 17, 2026
Category
Workflow & Automation
GitHub stars
1
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/xiaohuang-zaianlian/dsh-code-scan
Plugin: dsh-code-scan
Author: xiaohuang-zaianlian

Check the source files

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

File explorer3 files
README.mdSource · read only

dsh-code-scan

DeepSeek Harness(DSH)的 Agent 增加 code_scan 工具:对指定目录运行 semgrep 代码安全扫描,输出按文件、行号、严重级别分组的中文 Markdown 报告。

功能

  • 单个工具 code_scan,传入目录路径即可扫描。
  • 报告按文件分组,含行号和严重级别(ERROR / WARNING / INFO)。
  • 结果按严重级别优先排序,默认最多显示 200 条,避免撑爆 Agent 上下文。
  • 未安装 semgrep 时返回友好的中文提示,不会崩溃。

安装前提

本机需安装 semgrep,并保证 semgrep 命令在 PATH 上。Windows 建议用独立虚拟环境安装,避免污染其他 Python 环境:

python -m venv C:\Users\<你>\semgrep-venv
C:\Users\<你>\semgrep-venv\Scripts\pip install semgrep
# 把 C:\Users\<你>\semgrep-venv\Scripts 加入用户 PATH

安装插件

dsh plugin --profile web add dsh-code-scan

安装完成后重启 dsh web 生效。

使用

在 DSH 对话中让 Agent 扫描某个目录,例如:

> 用 code_scan 工具扫描 C:\path\to\your\project

报告示例:

# semgrep 扫描报告

- 扫描目录:`C:\...\demo`
- 发现问题:共 4 处(ERROR 2 / WARNING 2 / INFO 0)

## C:\...\app.py(2 处)

- [ERROR] 第 8 行 · 规则 `...sqlalchemy-execute-raw-query`:Avoiding SQL string concatenation...
- [WARNING] 第 18 行 · 规则 `...eval-detected`:Detected the use of eval()...

工作原理

1. 调用 semgrep scan --json <目录>。 2. 解析 JSON,提取文件、行号、严重级别、规则 id、描述。 3. 按严重级别优先排序,并截断到上限条数。 4. 生成中文 Markdown 报告返回给 Agent。

License

[MIT](./LICENSE)