Preface¶
In DeepSeek Harness (DSH), code modification requests generally fall into two distinct categories: one is to consolidate the diff before committing without altering semantics; the other is to specifically identify correctness issues related to current changes, ensuring that every item in the report has been independently verified, rather than just a list generated by a one-time “glance” by the model. The generic “help me review” requests in chat often conflate these two goals with unfixed scopes.
Below is an introduction to the community plugin dsh-plugin-code-quality (maintainer Hope-Phenom, npm package name @hope_phenom/dsh-plugin-code-quality). It registers /simplify, /code-review, and /review (which behaves identically to /code-review) under the skills group of the DSH / menu. The implementation registers the complete instruction document as a user-invocable skill, rather than a host command, so that your target parameters are passed verbatim into the model’s context.
What is this¶
dsh-plugin-code-quality is a DSH plugin: it has no client-side half, no tools, and no HTTP services; the entry point lib/index.js only registers several skills into ctx.skills. The design philosophy is to align with converged practices in mainstream code review toolchains while adapting to DSH’s tools, instruction file layout, and subagent models.
| Command | Summary | Who can invoke |
|---|---|---|
/simplify [target] |
Behavior-preserving cleanup of changes: reuse existing helpers, reduce complexity, eliminate dead work, relocate misplaced changes; not for finding bugs | You and the model |
/code-review [level] [--fix] [target] |
Multi-perspective search for real correctness defects in the diff, with independent verifiers for each candidate, sorted output by severity | Only you |
/review … |
Alias for /code-review |
Only you |
The plugin’s current version is 0.1.1, licensed under MIT. It has empty dependencies and peer dependencies, interacting only via the ctx passed in by the host.
Core Features¶
/simplify: Behavior-preserving diff cleanup¶
The scope is resolved in the following order: your specified target → git diff '@{upstream}...HEAD' → main...HEAD (falling back to origin/main, master) → HEAD~1. Uncommitted changes and untracked files in the working area are included, facilitating pre-commit usage; if there are no changes, it simply explains and exits.
The four independent reviewer dimensions are Reuse, Simplification, Efficiency, and Altitude. Only findings with concrete replacement plans are kept (e.g., existing helpers that should be called, simpler syntax, resource-saving alternatives, general mechanisms that should be merged into). Retained items are deduplicated and applied directly; if a fix would change expected behavior or require changes outside the diff, it is skipped and marked as such in the results.
/code-review: Multi-perspective audit + Independent verification¶
The level is read from the words in your message; there is no separate argument parser. The default is medium.
| Level | Correctness Angles | Cleanup Angles | Candidate Limit per Finder | Report Limit | Verification Tendency |
|---|---|---|---|---|---|
low |
3 | 0 | 4 | 5 | Keep only CONFIRMED |
medium (default) |
5 | 2 | 6 | 8 | Balanced |
high |
6 | 4 | 8 | 12 | Keep PLAUSIBLE |
max |
6 | 4 + sweep | 8 | 20 | Keep PLAUSIBLE |
The six correctness angles (C1–C6) cover line-by-line hunks, deleted behavior audits, cross-file contracts, language/framework pitfalls, async/resource lifecycles, error paths, and boundaries; the level determines how many angles actually run. Each candidate is subjected to independent verifiers attempting to refute it, resulting in CONFIRMED, PLAUSIBLE, or REFUTED. high and max include a sweep reviewer to check for omissions. When truncating reports, correctness issues take priority over cleanup, altitude, and style findings.
Output is one item per line, for example:
src/parser.ts:118 — the retry loop resets `attempts` inside the loop; a persistent 503 retries forever
If no items pass verification, a single explanatory line is output without padding. With --fix, passing items are applied after the report; otherwise, files remain unchanged.
Why use Skills instead of ctx.commands¶
ctx.commands.register() registers a host command, which does not deliver messages to the model by default, requiring manual synthesis of user messages. When using ctx.skills.register() with userInvocable: true, the composer sends your input (including tokens like /simplify) verbatim and appends an <skill_content> instruction block at the pre-step boundary—consistent with this plugin’s requirement of “entire document as instructions.”
simplify is registered as modelInvocable: true, userInvocable: true; code-review and review are modelInvocable: false, userInvocable: true, appearing only in your / menu and not self-invocable by the model.
Installation & Activation¶
Environment Requirements:
- DSH has composed
@deepseek-ai/dsh-skilland@deepseek-ai/dsh-client-ui-skill(standard presets usually include these). - Node.js ≥ 20.
Install via PowerShell (replace <your-profile> with your profile name):
dsh plugin --profile <your-profile> add @hope_phenom/dsh-plugin-code-quality
After restarting the profile (or waiting for HMR), type / in the composer; simplify, code-review, and review should appear under the skills group.
For local development, you can point to the checkout path:
dsh plugin --profile <your-profile> add F:\path\to\dsh-plugin-code-quality
Upgrade: Re-running add with the bare package name will not automatically upgrade to the new version (due to caret ranges and lock behavior). You need to specify the version explicitly or remove and then add it, for example:
dsh plugin --profile <your-profile> add @hope_phenom/dsh-plugin-code-quality@0.1.1
Then fully restart the profile (replacing loaded packages requires a new module generation; HMR does not overwrite loaded bundles). If the mirror is lagging, you can specify the upstream registry:
dsh plugin --profile <your-profile> add @hope_phenom/dsh-plugin-code-quality@0.1.1 --registry=https://registry.npmjs.org
Typical Usage¶
/simplify¶
/simplify # Clean up all changes since the upstream branch
/simplify src/parser.ts # Scope to a single path
/simplify 421 # Review a specific PR, not the local diff
/code-review¶
/code-review # Default medium level
/code-review high # More angles, higher limits, verification biased towards recall
/code-review max --fix # Broadest scan, auto-apply after reporting
/code-review high src/parser.ts # Level + path
/review is equivalent to /code-review and accepts the same arguments.
Scenarios & Notes¶
Suitable for: Developers who write code daily on the DSH standard skill stack and wish to distinguish between “pre-commit simplify” and “strict code-review triggered only by humans” within the same / menu.
Notes:
- The plugin runs with the permissions of the current DSH process; please review the source code and MIT license on the GitHub repository before installing.
/code-reviewand/reviewdo not enter the model’s skill directory to prevent the agent from initiating full-scale reviews autonomously; for behavior-preserving cleanup initiated by the model, use/simplifyor rely on itsmodelInvocableregistration strategy.- The community directory SkillHub Plugin Page has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem follows “everything is a plugin,” and the package is published under the npm
@hope_phenomscope.
Conclusion¶
dsh-plugin-code-quality connects /simplify (shared by humans and machines, behavior-preserving cleanup) and /code-review / /review (user-only, multi-perspective + verifier) to the DSH skills mechanism, with clear rules for diff scope and levels defined in the README. To browse categorized information or jump to the source code, use the directory page and GitHub:
- Directory Page: https://www.skillhub.cn/plugins/Hope-Phenom/dsh-plugin-code-quality
- GitHub: https://github.com/Hope-Phenom/dsh-plugin-code-quality