win4r

Dsh Pi Review — Code Quality skill for Claude Code

Code Quality community

Read-only Pi Agent code review plugin for DeepSeek Harness.

How to install Dsh Pi Review

This entry records only its repository, not the path inside it, so there is no exact command to give. Open win4r/dsh-pi-review and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Dsh Pi Review does

Read-only Pi Agent code review plugin for DeepSeek Harness.

Alternatives in Code Quality

README

dsh-pi-review

为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 提供隔离、只读的 [Pi Agent](https://github.com/earendil-works/pi) Git 改动审查。它注册一个根 Agent 工具 `pi_review_diff`,冻结确定性的 Git 快照,在 Harness 的只读沙箱中启动独立 Pi SDK Worker,并返回带分类、严重度策略和 Pi 用量统计的可验证结构化 finding。

[!IMPORTANT] 只读沙箱保护的是本地文件不被 Worker 修改,不是数据保密边界。被选中的 diff 与变更文件内容会发送给配置的模型 Provider。不要用未经授权的外部 Provider 审查私有、敏感或受监管代码。

当前版本针对并锁定:

  • DeepSeek Harness 0.1.1-rc.2
  • @earendil-works/pi-coding-agent 0.84.2
  • Node.js >=22.19.0

DeepSeek Harness 仍处于 developer preview。升级 Harness 或 Pi 前,应重新运行本仓库的完整检查、真实沙箱测试和真实模型冒烟测试。

为什么做成专用工具

Root Agent 的 pi_review_diff 调用
  -> 固定 argv 的 Git 快照(HEAD/base/merge-base/commit/diff SHA-256)
  -> Harness read-only sandbox
  -> 独立 Node Worker + Pi SDK in-memory Session
  -> read / grep / find / ls / review_diff / submit_review
  -> 严格 JSON envelope
  -> 宿主复算快照并标记 stale

插件没有开放 Pi 的 `bash`、`write`、`edit`、扩展、Skill、Prompt 模板、上下文文件或持久化 Session。Pi 只能读取快照中的当前变更文件;`staged`、`branch` 和 `commit` 是 frozen-only scope,只能读取固定 diff。删除文件和重命名旧路径也只能通过固定 diff 审查。高危 finding 是成功的业务结果,不会被误报成工具故障。

安装

从本地 checkout 安装

git clone https://github.com/win4r/dsh-pi-review.git
cd dsh-pi-review
pnpm install --frozen-lockfile
pnpm run check

dsh plugin --profile web add -w .
dsh --profile web --dump-config

从 GitHub 安装

建议固定已审计的 commit:

dsh plugin --profile web add -w github:win4r/dsh-pi-review#

rc.2 的 Profile 本身是 pnpm workspace root,因此这里显式传 `-w`;省略时,pnpm 10 可能以 `ERR_PNPM_ADDING_TO_ROOT` 拒绝安装。

Git 安装会从源码执行本包的 `prepare` 构建。pnpm 10 默认禁止依赖构建;首次失败时,把 dsh 输出的准确包名加入该 Profile 的 `pnpm-workspace.yaml`:

allowBuilds:
  "@charlesqin/dsh-pi-review": true

然后重新执行 `plugin add`。这等于授权安装阶段在 Agent 沙箱外运行本仓库的构建脚本;只应对可信源码授权。若不希望授权 Git 构建,可在可信 checkout 中执行 `pnpm pack`,再安装生成的 `.tgz`。

安装、移除或更新 Bundle 后,重启对应 Profile。`--dump-config` 只验证最终组合配置,不会启动插件。

配置 Pi 认证与模型

默认以只读快照方式加载 Pi 的 `~/.pi/agent/auth.json` 和 `~/.pi/agent/models.json`;认证刷新和模型