- Startseite
- Plugins
- Skills
- dsh-pentest-why-trace
dsh-pentest-why-trace
lucifer-angel/dsh-pentest-why-trace
Turns pentest reasoning into an enforceable discipline with three skills, a prompt rule set, and a why_trace tool that rejects WHY cards missing their unknown, assumption, alternatives, or expected signal.
Installation
dsh plugin --profile web add github:lucifer-angel/dsh-pentest-why-traceREADME
dsh-pentest-why-trace
Teach pentest reasoning inside DeepSeek Harness. Every command must first answer: what single unknown does this remove, and what falsifiable assumption stands behind it?
A DSH plugin that ships four things over public Cordis APIs:
| Part | What it does |
|---|---|
| 3 skills | pentest-why-trace (method + 7 rules), pentest-why-cards (12 scenario WHY cards), pentest-why-drills (prediction drills, blind-guess problems, failure ledger) |
| prompt section | a five-line discipline: unknown + assumption before the command, alternatives that were rejected, [known]/[inferred]/[guessed] labels, failures get booked |
why_trace tool | card renders and validates a WHY card (missing fields ⇒ ok:false plus the list of what is missing), log appends a row to .why-trace/decision-log.md, status reports verdict distribution, doctor reports registration state |
Why a tool and not just a prompt
A prompt says "explain your reasoning". A tool with a validation contract makes skipping the explanation fail loudly: the model that writes why: "because the tutorial does it" with no alternatives gets a rejection containing exactly the fields it dodged. That is the difference between advice and enforcement.
Install
Three ways, pick one:
# 1) npm / plugin market
dsh plugin --profile desktop add dsh-pentest-why-trace
# 2) straight from GitHub (before a release is published)
dsh plugin --profile desktop add github:lucifer-angel/dsh-pentest-why-trace
# 3) while developing (edits apply on restart)
dsh plugin --profile desktop add "dsh-pentest-why-trace@link:D:/website/dsh-pentest-why-trace"
dsh plugin add writes the dependency into the profile package.json but does not add it to dsh.profile.bundles — add that line yourself, then restart the app:
"dsh": { "profile": { "bundles": [ /* … other bundles …, */ "dsh-pentest-why-trace" ] } }
dsh plugin ... addexiting1is normal: it is pnpm'sERR_PNPM_IGNORED_BUILDSwarning aboutdsh-purge; the dependency itself is already installed.
Prefer link: while developing: a file: install is a snapshot copy that pnpm will not repack for an unchanged spec, and iconOf() throws when the icon declared in the manifest is missing from that stale copy.
Remove: drop the bundles entry, delete the dependency, restart.
Did it actually load?
Stop guessing once it is installed — let the plugin report on itself. In a fresh session:
用 why_trace action=doctor 报告注册状态
You get a three-row table:
| Part | Expected |
|---|---|
| skills | ✅ 成功, listing pentest-why-trace, pentest-why-cards, pentest-why-drills |
| 提示词段 (prompt section) | ✅ 成功 (section name = pentest-why-trace) |
| 工具 (tool) | ✅ 成功 (name = why_trace) |
Reading it: three ✅ rows means fully live. A ❌ on the tool row means the model cannot call why_trace and the error text sits on that same row — paste it into an issue. "部分失败" on the skills row means only that one skill is missing while the rest still work.
This self-check exists for one specific failure mode: the host swallows logger.warn, so a failed registration used to be indistinguishable from a plugin that was never installed. Now every step is recorded in REGISTRATION and doctor prints it verbatim.
Layout
package.json dsh.bundle.patch + dshTargets + icon (no dsh.client)
cordis.patch.yml inserts the Host row (id: pentest-why-trace)
lib/index.js apply(ctx, config): skills.register / systemPrompt.section / tools.register + REGISTRATION bookkeeping
lib/icon.svg plugin icon
skills/manifest.json which skill files to load, with descriptions
skills/pentest-why-trace/*.md the course material itself
test/smoke.mjs 51 offline assertions against a fake Cordis ctx
Config
- insert:
- id: pentest-why-trace
name: dsh-pentest-why-trace
config:
promptSection: true # false = keep only skills + tool
logPath: .why-trace/decision-log.md # relative to the session cwd, or absolute
promptOrder: 60
No UI (deliberately)
v0.2.x shipped a WHY chip in the composer toolbar and crashed every web boot: a dsh.client bundle registers into conversation.composer.bar, a slot owned by dsh-client-ui-conversation, and Cordis activates plugins concurrently — registering before the owner's apply finishes makes the owner throw, uiConversation is never provided, and 12 dsh-client-ui-* plugins plus dsh-purge go pending: Error: web boot: 13 entries did not activate. Three fixes did not help: adding dsh.client.inject (it only orders preloading), moving the mount into queueMicrotask (a microtask is not an ordering barrier), and wrapping everything in try/catch (it cannot catch the owner's throw).
So v0.3.0 and later ship no browser-side code at all — no lib/client.js, no dsh.client, no ./client export. Only the three host-side pieces: skills, the prompt section, and the why_trace tool. Everything the panel offered (cheat sheet, card template, self-check prompt) is one sentence away in chat; it is not worth a broken web boot.
Test
node test/smoke.mjs
Covers: skill loading and kebab-case names, all three services really registered, a complete card passing, an incomplete card rejected with the missing fields listed, log row numbering, verdict statistics, session cwd taking precedence over process cwd, unknown actions and bad paths not throwing, doctor reporting honestly in both the healthy and the broken state, the absence of any browser-side bundle, and package fields / files all really existing (51 assertions).
Design notes
- The log follows the session working directory. The plugin Host process runs with the app directory as
process.cwd(), not the user's project.log/statusresolve the session cwd viactx.workingDirectory.ensure(exec.agent)and only fall back to the process cwd when that is unavailable — otherwise the log lands inside the profile directory. - The bundled skills win. DSH ranks runtime skill entries above user-level ones, so the copy inside the plugin overrides an identical install under
~/.agents/skills/instead of being silently shadowed by it. - In-memory skills cannot resolve relative links. Cross-references in the main skill are rewritten as
[skill pentest-why-cards]call hints, with filenames given as plain text. - Registration is bookkept.
apply()only degrades, never throws — but every step lands inREGISTRATION, whichdoctorexposes. Degrading keeps the plugin usable; staying silent does not. - No browser-side code. See above: the three host-side pieces cover the whole feature set, and a UI is not worth gambling a web boot on.
Icon and display
lib/icon.svg is referenced from package.json ("icon": "./lib/icon.svg") and must stay inside the manifest directory. The plugin registry accepts raster icons only (png/jpg/webp) for listings, so the listing uses the GitHub-hosted PNG rather than this SVG.
Relationship to the standalone skill
~/.agents/skills/pentest-why-trace/ still works on its own (any Agent Skills host can read it). The plugin adds: higher runtime precedence, distribution with the profile across machines, and a tool that rejects half-finished WHY cards.
License
MIT