{"versions":{"0.1.0":{"name":"@hope_phenom/dsh-plugin-code-quality","version":"0.1.0","keywords":["dsh","deepseek-harness","cordis","dsh-plugin","skill","code-review","simplify","refactor","diff"],"author":{"name":"Hope.Phenom"},"license":"MIT","_id":"@hope_phenom/dsh-plugin-code-quality@0.1.0","maintainers":[{"name":"anonymous","email":"hope.phenom@foxmail.com"}],"homepage":"https://github.com/Hope-Phenom/dsh-plugin-code-quality#readme","bugs":{"url":"https://github.com/Hope-Phenom/dsh-plugin-code-quality/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"dist":{"shasum":"0143ef721dc109245ac3c5687ac3e3aa46e74d02","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hope_phenom/dsh-plugin-code-quality/-/dsh-plugin-code-quality-0.1.0.tgz","fileCount":9,"integrity":"sha512-1pKsW+4q8a1BC49mG8WqPL+ET5Mn5Tr0BY6hyRmsn49/Vb46KAbNP/dF74azXO2iZJ+iBsdXu8L2F13Nys+HzA==","signatures":[{"sig":"MEYCIQCs3lBGsxAVjDr7OkGglXNFzWKiPjfuCFbH6lFRIZJJwgIhAPF/ySqig22qscvUUgHkYM3d5/Y0Y/l4cN32hSz5Oex7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDsHegW8jHrKqfTRXFDg1zVpixkRajLFHYX0Vz4iQBpGwIgcx1fb1afJzfD0MpZLE0HIziMn1AYHIj9UoOTjStLVAI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53492,"size":21364},"main":"lib/index.js","type":"module","engines":{"node":">=20"},"exports":{".":"./lib/index.js","./skills":"./lib/skills.js","./package.json":"./package.json","./prompts/simplify":"./lib/prompts/simplify.js","./prompts/code-review":"./lib/prompts/code-review.js"},"gitHead":"caa82e9e90b158c0b40354870b642de37c3eb14f","scripts":{"test":"node --test","verify":"node tools/verify.mjs"},"_npmUser":{"name":"anonymous","email":"hope.phenom@foxmail.com"},"repository":{"url":"git+https://github.com/Hope-Phenom/dsh-plugin-code-quality.git","type":"git"},"_npmVersion":"11.19.1","description":"DeepSeek Harness plugin adding two code-quality commands as user-invocable skills: /simplify (behavior-preserving cleanups over the current diff) and /code-review (multi-angle bug hunt with an independent verifier pass), plus /review as an alias.","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dsh-plugin-code-quality_0.1.0_1791513723960_0.758984373313945","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-10-09T02:42:04.051Z","publish_time":1791513724051,"_source_registry_name":"default","contributors":[]},"0.1.1":{"_id":"@hope_phenom/dsh-plugin-code-quality@0.1.1","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/Hope-Phenom/dsh-plugin-code-quality/issues"},"dist":{"shasum":"3054a43f5a80948062603ab129ab09424bdb57bf","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hope_phenom/dsh-plugin-code-quality/-/dsh-plugin-code-quality-0.1.1.tgz","fileCount":12,"integrity":"sha512-XRXaTzcTy2RJmnHu42Kr/cmKZ26gpMZ7tEB4bKNcPjoDKgt9IZLVEd1oyzykJhxzJsCA+dooU1janab8Xlyn0Q==","signatures":[{"sig":"MEUCIQDTGqKHbW9qeopLVfHJoioUiGzBA7D18u8Bgjfzo+zUoQIgVrE59pzS7taa7QlrZUFQvGE6mKef8YJkWRwSo+YVtEA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDPhJC500rXLGlCIt6UIaJPgmn7fAf11R+FgZjlV5ENwQIgfBKlu0SCcsRfYvXJuUq83xFNbQvwmCOahhOMNdFumWM="}],"unpackedSize":54370,"size":21896},"icon":"./assets/icon.svg","main":"lib/index.js","name":"@hope_phenom/dsh-plugin-code-quality","type":"module","author":{"name":"Hope.Phenom"},"engines":{"node":">=20"},"exports":{".":"./lib/index.js","./skills":"./lib/skills.js","./package.json":"./package.json","./locale/*.json":"./locale/*.json","./prompts/simplify":"./lib/prompts/simplify.js","./prompts/code-review":"./lib/prompts/code-review.js"},"gitHead":"603b1131bcf535dfce757a2ba3c64127d4c05e4e","license":"MIT","scripts":{"test":"node --test","verify":"node tools/verify.mjs"},"version":"0.1.1","_npmUser":{"name":"anonymous","email":"hope.phenom@foxmail.com"},"homepage":"https://github.com/Hope-Phenom/dsh-plugin-code-quality#readme","keywords":["dsh","deepseek-harness","cordis","dsh-plugin","skill","code-review","simplify","refactor","diff"],"repository":{"url":"git+https://github.com/Hope-Phenom/dsh-plugin-code-quality.git","type":"git"},"_npmVersion":"11.19.1","description":"DeepSeek Harness plugin adding two code-quality commands as user-invocable skills: /simplify (behavior-preserving cleanups over the current diff) and /code-review (multi-angle bug hunt with an independent verifier pass), plus /review as an alias.","directories":{},"maintainers":[{"name":"anonymous","email":"hope.phenom@foxmail.com"}],"_nodeVersion":"24.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-plugin-code-quality_0.1.1_1791515464714_0.2282340900968185"},"_cnpmcore_publish_time":"2026-10-09T03:11:04.836Z","publish_time":1791515464836,"_source_registry_name":"default","contributors":[]},"0.0.0-stage":{"name":"@hope_phenom/dsh-plugin-code-quality","version":"0.0.0-stage","_id":"@hope_phenom/dsh-plugin-code-quality@0.0.0-stage","stub":true,"maintainers":[{"name":"anonymous","email":"hope.phenom@foxmail.com"}],"dist":{"shasum":"905eb9cae22011b7f424a6f99c847999d82ca1cc","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hope_phenom/dsh-plugin-code-quality/-/dsh-plugin-code-quality-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-9UGETKg/nxBDJRbszFKeZhn/nsHxxa0vY++9x57IOjC2FU0uDZAOtIhU3WzrG06HpodKnufJAmG6MJ5vFAlyhA==","signatures":[{"sig":"MEYCIQDrLY8Y1hd42jSPyHUWy8U7MxogFPjzNS6yqTJXHDJkdwIhAI+Ymi11KoNPvYCLKpbPA7OyQFM1CDxJ4HZkVyS3Bdqz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":358,"size":381},"_npmUser":{"name":"anonymous","email":"hope.phenom@foxmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{},"_cnpmcore_publish_time":"2026-10-09T02:41:07.584Z","publish_time":1791513667584,"_hasShrinkwrap":false,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.1.1"},"name":"@hope_phenom/dsh-plugin-code-quality","time":{"created":"2026-10-09T03:11:17.765Z","modified":"2026-10-09T03:11:19.443Z","0.1.0":"2026-10-09T02:42:04.051Z","0.1.1":"2026-10-09T03:11:04.836Z","0.0.0-stage":"2026-10-09T02:41:07.584Z"},"readme":"# dsh-plugin-code-quality\n\nA [DeepSeek Harness](https://github.com/deepseek-ai) plugin that adds two code-quality commands to the `/` menu:\n\n| Command | What it does | Who can invoke it |\n|---|---|---|\n| `/simplify [target]` | Applies behavior-preserving cleanups to the code you changed — reuses helpers that already exist, removes needless complexity, cuts wasted work, and re-seats changes made at the wrong layer. Not a bug hunt. | you **and** the model |\n| `/code-review [level] [--fix] [target]` | Hunts for real correctness defects in the current diff with several independent review angles, verifies every candidate before reporting it, and ranks what survives most-severe first. | you only |\n| `/review …` | Alias of `/code-review`. Same behavior, same instructions. | you only |\n\nBoth commands follow the design that mainstream code review tooling has converged on, adapted to DeepSeek Harness's tools, instruction-file layout and subagent model.\n\n---\n\n## Install\n\n```powershell\ndsh plugin --profile <your-profile> add @hope_phenom/dsh-plugin-code-quality\n```\n\nThen restart the profile (or let HMR pick it up) and type `/` in the composer — `simplify`, `code-review` and `review` appear under the skills group.\n\nFor local development against a checkout:\n\n```powershell\ndsh plugin --profile <your-profile> add F:\\path\\to\\dsh-plugin-code-quality\n```\n\n### Requirements\n\n- DSH with `@deepseek-ai/dsh-skill` and `@deepseek-ai/dsh-client-ui-skill` composed. Both are part of the shipped standard preset, so a stock install already has them.\n- Node.js ≥ 20.\n- The plugin has **no dependencies and no peer dependencies** — it imports nothing from DSH and talks to the host only through the `ctx` object it is handed.\n\n---\n\n## Usage\n\n### `/simplify`\n\n```text\n/simplify                       # clean up everything changed since the upstream branch\n/simplify src/parser.ts         # restrict the review to one path\n/simplify 421                   # review a pull request instead of the local diff\n```\n\nScope resolution, in order: a target you named, then `git diff '@{upstream}...HEAD'`, then `main...HEAD` (falling back to `origin/main`, `master`), then `HEAD~1`. Working-tree edits and untracked files are folded in, because the command is most useful *before* you commit. If nothing changed, it says so and stops.\n\nFour independent reviewers look at the diff — **Reuse**, **Simplification**, **Efficiency** and **Altitude**. A finding only counts if it names the concrete replacement: the existing helper to call, the simpler form, the cheaper alternative, or the general mechanism the special case should fold into. Findings that cannot fill that slot are dropped before they reach you.\n\nSurviving findings are deduplicated and applied directly. Anything whose fix would change intended behavior, or that needs work outside the diff, is skipped and reported as skipped rather than argued about.\n\n### `/code-review`\n\n```text\n/code-review                    # balanced review at the default level\n/code-review high               # more angles, higher findings cap, recall-biased verification\n/code-review max --fix          # widest sweep, then apply the findings\n/code-review high src/parser.ts # level plus a target\n```\n\nThe level word is read out of your own message — there is no argument parser, because the command is delivered as instructions.\n\n| Level | Correctness angles | Cleanup angles | Candidates per finder | Report cap | Verification bias |\n|---|---|---|---|---|---|\n| `low` | 3 | 0 | 4 | 5 | drop anything not `CONFIRMED` |\n| `medium` *(default)* | 5 | 2 | 6 | 8 | balanced |\n| `high` | 6 | 4 | 8 | 12 | keep `PLAUSIBLE` |\n| `max` | 6 | 4 + sweep | 8 | 20 | keep `PLAUSIBLE` |\n\nSix correctness angles are defined, and the level decides how many run — three at `low`, five at `medium`, all six at `high` and `max`:\n\n| id | angle | the question it asks |\n|---|---|---|\n| C1 | line-by-line hunk scan | What input, state, timing or platform makes each changed line produce the wrong result — including unchanged lines of a touched function. |\n| C2 | removed-behavior audit | What invariant did each deleted or replaced line enforce, and where does the new code re-establish it? |\n| C3 | cross-file contract tracing | Does the change break a caller through a new precondition, return shape, throwing path or ordering requirement? |\n| C4 | language and framework pitfalls | Which classic trap of the languages actually present in this diff is being stepped in? |\n| C5 | async, concurrency and resource lifetime | Races, missing `await`, abandoned work, error paths that skip cleanup, listeners that outlive their owner. |\n| C6 | error paths and boundaries | Empty collections, zero and negative values, null, multi-byte text, overflow, timeouts, partial writes, oversized payloads. |\n\nEvery candidate then goes to a **separate verifier** that is told to try to *refute* it and must answer `CONFIRMED`, `PLAUSIBLE` or `REFUTED`. At `high` and `max`, a final sweep reviewer sees the verified list and looks only for gaps. When the report cap forces a cut, correctness findings outrank cleanup, altitude and conventions findings.\n\nOutput is one line per finding:\n\n```text\nsrc/parser.ts:118 — the retry loop resets `attempts` inside the loop; a persistent 503 retries forever\n```\n\nIf nothing survives verification it says so in one line instead of padding the report. `--fix` applies the surviving findings after reporting them; without it the command never edits a file.\n\n---\n\n## How it works\n\nThe plugin has no client half, no tools, no services and no HTTP routes. `lib/index.js` does exactly one thing:\n\n```js\nexport const name = 'dsh-plugin-code-quality'\nexport const inject = ['skills']\n\nexport function apply(ctx) {\n  for (const skill of SKILLS) ctx.skills.register(skill)\n}\n```\n\n### Why skills instead of `ctx.commands`\n\nDSH gives a plugin two ways to add a `/` command, and they are not equivalent:\n\n- **`ctx.commands.register()`** publishes a *host command*. Its handler runs against the agent directly and, by default, produces no model message — a command that wants to make the model work has to submit a synthetic user message itself.\n- **`ctx.skills.register()` with `userInvocable: true`** publishes a *skill*. The composer sends your message verbatim, `/simplify` token included, and the host appends the skill body as a `<skill_content>` instruction block at the pre-step boundary.\n\nThe second is exactly the substrate these two commands need: their entire content *is* an instruction document, your typed target text arrives intact, and there is no synthetic message pretending to be you.\n\n### Invocation policy\n\n`simplify` is registered with `{ modelInvocable: true, userInvocable: true }`, so the model also sees it in its skill catalog and can reach for it on its own — a behavior-preserving cleanup pass is a reasonable thing for an agent to decide it needs.\n\n`code-review` and `review` are registered with `{ modelInvocable: false, userInvocable: true }`. They never enter the model's catalog and cannot be self-invoked; the `/` menu is their only entry point, where DSH marks them as user-only.\n\n### `/review` is a second registration, not a pointer\n\n`@deepseek-ai/dsh-skill` keys a runtime registration by `name` alone — there is no alias field (DSH's localized command aliases exist only for host commands, selected by first-party `definitionId`). `/review` is therefore registered as its own skill that shares the `code-review` body *by reference*, so the two cannot drift. The cost is a second row in the `/` menu.\n\n---\n\n## Design notes\n\nThe two commands follow a pattern that code review tooling has broadly converged on: split the review into several independent angles so no single pass has to be good at everything, send every candidate past a separate verifier before it is reported, and cap the report so a flood of marginal findings cannot bury the real ones.\n\nA few choices here go beyond that pattern:\n\n- **Angles.** Alongside the usual line-by-line, removed-behavior and cross-file angles, `C5` (async, concurrency and resource lifetime) and `C6` (error paths and boundaries) are included because they carry a lot of real defect mass that a general scan tends to skim past.\n- **Fan-out tool.** Reviewers run as `subagent` children with `run_in_background: false` pinned. DSH's standard preset configures that tool as `continuable`, so without the flag it returns an id and forces the parent to poll instead of handing back a whole round of findings in one step. All finder calls go out in a single message so they run concurrently.\n- **Effort levels.** A DSH skill body is static and there is no host API to select a level, so the level is parsed by the agent out of your own message, against the table above.\n- **Instruction files.** DSH loads `$DSH_HOME/AGENTS.md` plus a per-directory project chain of `AGENTS.md` and its `AGENTS.local.md` overlay. That chain is normally injected automatically, so the conventions angle reads a file directly only when it was not.\n- **Scope.** The review runs against your local diff and reports in the conversation. Nothing is posted to a pull request and nothing is published elsewhere.\n\nUnofficial community project, MIT licensed, no commercial intent.\n\n---\n\n## Development\n\n```powershell\nnpm test          # node --test: skill contract, plugin wiring, prompt conformance\nnpm run verify    # the same checks as a human-readable PASS/FAIL report\n```\n\n`test/prompts.test.js` is the enforcement point for `docs/PORT-SPEC.md` §7: it fails the build if a body loses the subagent fan-out contract, drops a verdict label, starts emitting prompt framing, slips in a vendor name, or grows past its word budget.\n\n## License\n\n[MIT](LICENSE)","users":{}}