Preface¶
The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” By mounting different bundles in a DSH profile, developers can extend the functionality of the CLI or Web UI. dsh-command-code-review is a code review plugin based on DSH slash commands. It aims to provide automated review capabilities for Pull Requests and local code.
Plugin Overview¶
This plugin is maintained by JasonFreeLab and released under the MIT License. It is a standalone plugin package. After installation, it registers the /code-review command in a DSH profile. Its core value is to encapsulate complex code review workflows into configurable lenses and provide confidence and severity scoring, helping developers quickly locate code issues.
Core Features¶
-
Dual-mode operation
- PR mode: Review using
/code-review 123or a PR URL. Results are automatically posted back to the Pull Request via GitHub CLI. - Local mode: Review using
/code-review review src/author with no arguments to review the current codebase.
- PR mode: Review using
-
Configurable review lenses
- Includes five default lenses:
guidance(AGENTS.md/CLAUDE.md compliance),bugs(errors and correctness),history(historical context),security(security), andcomments(comment compliance). - Supports enabling the optional
perf(performance) lens.
- Includes five default lenses:
-
Scoring mechanism
- Deduplicates findings and scores them by confidence (to distinguish false positives) and severity (Blocker/Major/Minor/Nit).
- Supports setting a confidence threshold (default 80). Findings below this score are filtered out.
-
Report output
- Local reviews generate a structured Markdown report.
- It also generates a machine-readable JSON sidecar file.
- Supports custom report output directories.
Installation and Prerequisites¶
Before installation, ensure that your DSH profile is based on @deepseek-ai/dsh-base and that GitHub CLI (gh) is installed and authenticated (required only for PR mode).
The installation command is:
dsh plugin --profile web add dsh-command-code-review
After installation, restart or reload the profile for the command to take effect.
Usage¶
In the DSH Web UI composer, type /code-review to use the plugin. The following are typical invocation examples:
# 通过 PR 编号审查
/code-review 123
# 通过 PR URL 审查
/code-review https://github.com/owner/repo/pull/123
# 审查本地指定路径
/code-review review src/auth
# 审查整个项目
/code-review review the whole project
# 审查当前未提交的更改
/code-review
# 指定输出目录
/code-review review src/auth --out reports
/code-review --out docs review src/auth
Empty input first probes for an open Pull Request on the current branch. If none is found, it falls back to reviewing uncommitted changes.
Configuration¶
The plugin can be configured in the profile’s cordis.patch.yml file.
- Confidence threshold
Findings below this score are discarded.
- id: command-code-review
config:
threshold: 90
- Report output directory
Set the default location for local review reports (defaultdoc).
- id: command-code-review
config:
outputDir: reports
- Review lens selection
Select the set of enabled lenses.
- id: command-code-review
config:
lenses: [guidance, bugs, security]
- Adaptive lenses
Enabled by default (autoLenses: true). Thesecuritylens is automatically enabled when the review scope includes security-sensitive files, and theperflens is automatically enabled when hot paths are involved.
Notes¶
- Code links: Rendering code links on GitHub requires a full Commit SHA and a line number range (format:
#L[start]-L[end]). - GitHub CLI: If
ghis not installed or not authenticated, PR mode cannot automatically reply with comments. - File naming: Local report file names in a Git repository include the short SHA of the current HEAD (
code-review-<sha7>-<slug>.md).
Conclusion¶
dsh-command-code-review provides a standardized entry point for code review in the DSH ecosystem. By configuring lenses and thresholds, it can translate LLM analysis capabilities into concrete development workflows, making it suitable for teams that require strict control over code quality. For more details, refer to the plugin directory: https://www.skillhub.cn/plugins/JasonFreeLab/dsh-command-code-review or the source code: https://github.com/JasonFreeLab/dsh-command-code-review.