Registers a /code-review slash command with five parallel review lenses and per-finding confidence scoring, for both pull requests and local code.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-command-code-review
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:JasonFreeLab/dsh-command-code-review
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 中文
A DSH (DeepSeek Harness) slash-command bundle that runs a full code review — configurable review lenses with per-finding confidence and severity scoring, for both pull requests and local code.
/code-reviewslash command for DeepSeek Harness — self-contained plugin bundle, installable into any dsh profile.
Table of Contents
- Features
- Requirements
- Install
- Usage
- How it works
- Configuration
- Troubleshooting
- Layout
- Development
- Contributing
- License
Features
- Two modes, one command —
/code-review <pr number|url>reviews a pull request;/code-review [request](or empty) reviews local code. - Terminal-first results, opt-in PR comments — like the upstream
claude/code-reviewcommand, findings are reported in the chat by default;--commentposts the summary back to the pull request, and--inlineadds one inline review comment per confirmed issue. - Validation before scoring — bug, security, and guidance findings each get a dedicated validation subagent (mirroring the upstream command's step 5); only validated findings are deduplicated and scored.
--no-validateskips the pass. - High-signal only — review agents flag only compile/parse failures, clear logic errors, and quotable AGENTS.md/CLAUDE.md violations; nitpicks and style concerns are explicitly excluded.
- Configurable review lenses — five by default (AGENTS.md/CLAUDE.md compliance, bug & correctness, security & logic, historical context, code-comment compliance), plus optional test-coverage and performance lenses; choose a subset per profile.
- Confidence + severity scoring — findings are deduplicated across lenses, then batch-scored for confidence (real vs false positive) and severity (blocker/major/minor/nit); anything below the threshold is dropped (default 80).
- Configurable — the confidence threshold is set per profile (see Configuration).
- Review report document — local reviews are written as a structured Markdown report (in English) plus a machine-readable JSON sidecar, under
doc/by default; override the directory with--out <dir>per invocation orconfig.outputDirper profile. The filename embeds the current HEAD's short sha (omitted outside a git repo). - Tracks the current dsh runtime — the bundle targets the dsh
0.2.xplugin API:engines.dshcompatibility metadata, an exported schemasteryConfigschema, a producer-owned message source kind, and the asynchronous subagent tool contract.
Requirements
- A dsh
0.2.xruntime —^0.2.2-rc.4, declared asengines.dshand validated by dsh0.2.2-rc.4. The dsh loader checks this range when the plugin is installed and when a profile boots; incompatible bundles are skipped unless the user grants an explicit exact-version exemption. - Node.js
>=24.9.0, the runtime dsh 0.2.2 itself requires. - A dsh profile built on
@deepseek-ai/dsh-base(the shippedweb,headless,sdk, andacpprofiles;sdk-minimalis a standalone tree and lacks thecommandsservice), which provides thecommandsservice and the subagent/bash/todo tools the workflow uses. - The GitHub CLI (
gh) onPATH, authenticated — required only for pull-request review. Local review needs nogh.
Install
From the npm registry:
dsh plugin --profile web add dsh-command-code-review
From a local checkout or tarball:
# directory
dsh plugin --profile web add /path/to/dsh-command-code-review
# packed tarball
dsh plugin --profile web add /path/to/dsh-command-code-review-<version>.tgz
The dsh plugin add command installs the package into the profile and, because its package.json declares dsh.bundle, appends it to dsh.profile.bundles automatically. The install also checks the bundle's dsh requirements (engines.dsh); if it names an incompatible runtime, upgrade either dsh or the plugin. Restart or re-boot the profile to pick it up.
Usage
In the DSH web UI
- Start the web UI and open the printed URL:
dsh web(alias ofdsh --profile web). - Start a new session and type
/code-reviewin the composer. The command is registered automatically — no extra setup. - Findings are reported in the chat. For pull requests, add
--commentto post the summary back to the PR viagh, and--inlinefor one inline comment per confirmed issue.
Examples
/code-review 123 # review a pull request by number, findings in chat
/code-review 123 --comment # also post the summary comment to the PR
/code-review 123 --comment --inline # also leave one inline comment per issue
/code-review https://github.com/owner/repo/pull/123
/code-review review src/auth --no-report # local review, chat only (no report file)
/code-review review the whole project # local review of the entire repository
/code-review # local review of the current uncommitted changes
/code-review review src/auth --out reports # save the report under reports/
/code-review --out docs review src/auth # --out may come first or last
Empty input first probes the current branch's open PR, then falls back to reviewing uncommitted changes.
Flags: --comment (post PR findings), --inline (inline comments, implies --comment), --out <dir> (report directory), --no-validate (skip the validation pass), --no-report (do not write report files).
For local reviews, the report is also written to a Markdown document — under doc/ by default, or wherever --out <dir> (or config.outputDir) points. The filename is code-review-<sha7>-<slug>.md in a git repo (<sha7> is the current HEAD's short sha, <slug> is derived from the review scope), and code-review-<slug>.md outside a git repo.
How it works
The package is a standard dsh bundle:
package.jsondeclares"dsh": { "bundle": { "patch": "./cordis.patch.yml" } }and the supported runtime range inengines.dsh.cordis.patch.ymlinserts one plugin row (id: command-code-review) into the profile layer stack.lib/index.jsis a Cordis plugin that injectscommandsand registers thecode-reviewcommand. It exports a schemasteryConfigschema (so profile configuration is validated at load time) and onehandlerthat routes PR numbers/URLs to the pull-request workflow and everything else (including empty input) to the local-review workflow, then delivers the workflow throughagent.followupas anoticeuser message carrying this plugin's owncommand-code-reviewsource kind. The workflows tell the agent to launch subagents in parallel and await the runtime's completion notices rather than polling; the dsh 0.2.xsubagenttool is always asynchronous, returns the child's name, and has no background flag. Step numbers are rendered per invocation, so enabling or skipping the validation pass, posting, and the report keeps a contiguous sequence.
Users can disable or override the command from their own profile cordis.patch.yml:
- id: command-code-review
disabled: true
Configuration
Configuration is validated by the exported Config schema, so an invalid value fails the plugin load with a clear error instead of being silently ignored.
Confidence threshold: the workflow drops findings scored below a threshold (default 80). Override it in your profile
cordis.patch.yml:- id: command-code-review config: threshold: 90Report output directory: where local-review reports are saved (default
doc). Override per profile:- id: command-code-review config: outputDir: reportsor per invocation with
--out:/code-review --out reports review src/auth.Review lenses: available lens ids are
guidance,bugs,security,history,comments, and the opt-intestsandperf. The default set isguidance,bugs,security,history,comments. Choose a subset per profile:- id: command-code-review config: lenses: [guidance, bugs, security, tests]Adaptive lenses: with
autoLenses: true(the default), the test-coverage lens is auto-enabled when the scope touches test files, the performance lens when it touches hot paths, and the security lens when it touches security-sensitive files — if they are not already enabled. Disable withautoLenses: false.PR comments: findings are printed in chat unless the invocation passes
--comment. SetpostComment: trueto make posting the profile default:- id: command-code-review config: postComment: trueInline comments:
--inlineposts one inline review comment per confirmed issue throughgh api. SetinlineComments: falseto disable inline comments even when--inlineis passed.
Troubleshooting
Plugin dsh-command-code-review@… is incompatible with dsh …: the running dsh runtime is outside this version'sengines.dshrange. Upgrade dsh to0.2.xor install a matching plugin version. Only as a last resort, grant the exact-version exemption (dsh plugin allow-version).- No review comment posted: no
--commentwas passed; or the PR is closed, draft, trivial, or already reviewed; or no finding scored 80 or above. - Inline comments missing:
gh apineeds a token withreposcope; issues whose line cannot be addressed are folded into the summary comment. ghnot found: install and authenticate the GitHub CLI (gh auth login); only pull-request review needs it.- Code links do not render: use the full commit SHA and the
#L[start]-L[end]line range.
Layout
lib/index.js # Cordis plugin that registers the /code-review command
lib/lenses.js # review-lens registry + resolution
lib/parse.js # invocation parsing (--out/--comment/--inline/--no-validate/--no-report)
test/smoke.test.mjs # package/bundle metadata smoke test
test/plugin.test.mjs # command registration + handler delivery test
test/parse.test.mjs # parser unit test
test/lenses.test.mjs # lens resolution unit test
cordis.patch.yml # bundle patch
.github/workflows/ # ci.yml + release.yml + release-please.yml
Development
npm install
npm test # node --test (smoke + plugin handler + parser + lens unit tests)
The plugin handler test imports lib/index.js against the declared peer dependencies and registers the command into a real @deepseek-ai/dsh-commands runtime, so it covers the real createUserMessage/schemastery/command-registry paths.
Contributing
Issues and pull requests are welcome.
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-git-graph★ 10645
Git branch selector and Git graph for the dsh web GUI: switch branches and explore branch-lane and commit history from the conversation header. Retired by the author in favour of the official workspace-changes plugin: the published npm package stays installable but is no longer developed.
Akimiya-z/codex-guard#dsh★ 131
Pre-submit pull-request hygiene checks inside DeepSeek Harness: scans the current diff for TODO leftovers, hardcoded secrets, and non-conventional commit subjects.
xbzbing/dsh-git-panel★ 62
IDE-style Git panel in the DSH Web GUI: a resident tab with a three-column overview (branch/tag list, searchable commit-history graph, commit detail with changed-file tree and message) and a changes page (stats bar, uncommitted list with per-file stage/unstage/discard, commit box with amend); side-by-side diffs carry lazy highlight.js syntax highlighting, on-demand between-hunk context expansion and word-level intra-line emphasis, with image files shown as before/after panes; plus a zsh-style branch marker in the input bar. Every git command runs as an argv array through the host subprocess service, cwd locked to the repo root.
Cerbur/clutch-dsh#clutch-dsh-worktree★ 48
Adds a Worktree view to DSH Web UI that groups Sessions by Git worktree while keeping DSH as the source of truth.
KannaKuron/dsh-ide-git★ 37
JetBrains-style Git tool window for the sidebar: branch tree with ahead/behind badges, commit graph with text/author/date/path filters, per-file line diff, changes list and commit box, plus branch, tag and stash actions, merge, rebase, cherry-pick, reset and fetch/pull/push.
DamonKoy/dsh-web-ui#dsh-git-graph★ 35
Git branch selector and Git graph in the conversation header of the dsh web GUI.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.