/dsh-plugin-upgrade-skill:plugin-testfrom dsh-plugin-upgrade-skill
Guides testing of DeepSeek Harness plugins with minimal sufficient test levels: unit, coverage, E2E, snapshots, Web tests, compositions, and smoke tests. Includes a seven-touchpoint workflow for version migrations.
Ships in dsh-plugin-upgrade-skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Select the smallest set of test levels that proves the change is correct. Do not run the full suite by default or repeat checks that have already passed.
When adapting an existing plugin to a new DSH host version:
references/version-migration-testing.md, build a migration ledger for the exact from/to versions, and scan all seven touchpoint classes.breaking or behavior change. A change-level test proves only that migration mapping; it does not prove the whole plugin is valid.The commands and repository paths below use test-level names from the official Harness monorepo. For external plugins, use equivalent scripts and paths from their own repositories. Do not add nonexistent Harness root commands or impose the monorepo layout on them.
For a pre-release external plugin check, read references/docker-release-smoke.md and use the included runner on the packaged artifact. Pin one exact DSH version and a non-latest Node image, install the artifact into an isolated Profile, cold-start the real DSH entry, and add one argv-based functional probe when startup alone does not exercise the changed behavior.
Treat the generated JSON and Markdown as narrow evidence for that artifact and target. Report skipped providers, browsers, operating systems, security checks, and additional versions as unverified; a passing Docker smoke test does not expand its own coverage. Keep generated reports, raw logs, temporary Profiles, and Docker cache outside the Skill directory.
| Level | Command | What it proves |
|---|---|---|
| Unit tests | pnpm run test | Runs vitest cases under each package's tests/** and script tests under repository scripts/**/*.spec.ts. Cover edge cases, error paths, event ordering, concurrency races, and contract regressions. Every registry needs an HMR-safety test: dispose the fiber that contributed the registration and assert that the resource is removed. |
| Coverage gate | pnpm run test:coverage | In the Harness monorepo, every file under packages/*/*/src must reach 100% coverage. In an external plugin, follow the coverage threshold declared by its repository. Coverage proves only that lines executed, not that the published feature actually works. |
| Real-API end-to-end tests | pnpm run test:e2e | Validates behavior against real provider APIs, including DeepSeek models and provider smoke tests gated by their own credentials such as EXA_API_KEY and PERPLEXITY_API_KEY. Each suite skips itself when its credential is absent so credential-free CI remains green. |
| Snapshot tests | pnpm run test:snapshot | Validates expected credential-free output, pinning transport contracts and presentation while using persisted logs to fix the assembled backend behavior. |
| Web browser snapshots | pnpm run test:web | Compares Chromium replay output with apps/web/tests/snapshots/. This is a required Linux PR gate. CI forces read-only DSH_SNAPSHOT=replay and never writes expected output. Record or refresh snapshots only locally and review every difference. |
When provider credentials are available and real-API execution is authorized, run the corresponding end-to-end tests. Do not skip them merely to save inference spend. Credential-free tests prove only that the pipeline is connected; only credentialed runs prove that the Agent can work with a real model. Based on the change, cover file-writing prompts, multi-turn sessions, tool use, and cancellation during streaming output. The highest-value smoke test starts a real example, sends one prompt, and verifies the outcome from outside the Agent. Automatic skipping keeps credential-free CI unblocked. Record every skipped provider boundary, and never request, expose, or persist credentials merely to make tests pass.
apps/cli/tests/snapshots/ or apps/web/tests/snapshots/; in an external plugin, use the product-entry test suite owned by that repository.ctx.plugin(...).Every nontrivial model-visible, protocol-visible, or user-visible change must add or update a credential-free scenario through a runnable composition owned by the repository. Package tests, end-to-end assertions, test-only mock compositions, and PR descriptions cannot replace the complete assembled record. In the Harness monorepo, ACP snapshots live under examples/<name>/tests/snapshots/, headless JSONL snapshots live under examples/headless-agent, terminal flows live under apps/cli/tests/snapshots/, and browser flows live under apps/web/tests/snapshots/. Use the record or refresh command provided by the exact target checkout and review every generated difference. External plugins should use their own snapshot framework. If they have none, add a minimal composition that runs through the real Loader.
cordis.yml through the Loader and application or process entry point. Mock only external services or nondeterministic inputs. Assert the model-visible request or log, persisted state, or user-visible output. Do not add test options to published defaults.inject to use named exports, add explicit expect('default' in mod).toBe(false) and unwrapExports round-trip assertions. Prove that the test turns red when the regression is introduced and green after the fix. Do not apply this guard to default plugin objects or Service classes supported by the target version. Validate those forms through their actual Loader contract.bin must run its built entry under native Node to expose issues that tsx may hide, including shutdown races, module resolution, and swallowed load failures. Apply the same rule to runtime entries outside the default index and singleton modules shared across bundle compositions. In the Harness monorepo, keep its built-artifact smoke tests green, such as packages/examples/*/tests/built-bin.e2e.ts and packages/code-runtime/code-runtime-worker/tests/built-lib.e2e.ts when they exist in the target version. In an external plugin, smoke-test its packaged entry. Assert that the process exits nonzero when required configuration is truly missing.lib/. Never hand-write --import tsx for those subprocesses. Protocol and operating-system fixtures that do not load Cordis follow the current Node/TypeScript convention of the target repository. External plugins follow their own launcher but must cover the packaged artifact. Choose src only when source-path resolution itself is the test subject, and document that contract in the test.afterEach, including after failure, retry, or timeout. Put shared fixtures in a normal tests/harness.ts, never another *.e2e.ts; importing a test file registers its describe again and duplicates real-API calls.In the Harness monorepo, use commands that actually exist in the target checkout, such as pnpm run test, test:coverage, test:e2e, test:snapshot, and test:web. Confirm each script exists instead of assuming a historical command list is still valid. In an external plugin, use its own scripts, package the artifact, install it into an isolated Profile running the exact target version, and execute a cold-start plus core-path smoke test through the product entry. Run the smallest set that covers the changed surface only once. CI proves only the gates it actually defines.
See references/README.md for the reference index.
references/README.md (opens in a new tab)references/docker-release-smoke.md (opens in a new tab)references/version-migration-testing.md (opens in a new tab)scripts/container-runner.mjs (opens in a new tab)scripts/container-runner.test.mjs (opens in a new tab)scripts/docker-release-smoke.mjs (opens in a new tab)scripts/docker-release-smoke.test.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub oh-my-dsh/dsh-plugin-upgrade-skill --plugin dsh-plugin-upgrade-skill12 skills in this plugin
/dsh-benchmark-caseUse when the user hands over a dsh plugin repository (or a real migration commit / version corridor) and wants its upgrade experience extracted into one auto-graded Harbor benchmark exam task — produce tasks/<id>/ (fixture + instruction.md + task.toml + judge.mjs + solution) that harbor run can grade 0–1 and that folds into the dsh-plugin-upgrade-skill benchmark suite; also applies to turning existing version cards (references/v*.md) into executable exam tasks. Not for writing upgrade cards; not for running the benchmark./dsh-upgrade-auditAudit external compatibility between two DSH (DeepSeek Harness) versions and detect reverts, producing an upgrade-report directory; compares git tags with a source checkout, or published npm packages without one. Use whenever the user asks to check/compare/audit two DSH versions or whether upgrading is safe — e.g. "more changes or reverts in dsh-vX -> dsh-vY", "compare the breaking changes" — even with only two version numbers and no source location. Read-only outside the report directory; npm mode installs in isolation with --ignore-scripts./generic-migrationFramework-agnostic methodology for migrating a plugin, extension, or integration across a breaking upstream release — inventory coupling points, classify changes, stage the migration, and verify in layers. Use when upgrading any plugin from one host-framework version to another without access to framework-specific migration notes. Not a substitute for vendor release notes; contains no framework-specific facts./plugin-fast-adaptDSH 插件适配与破坏性变更核查,兼造插件脚手架与性能架构审计。run.mjs 一键编排全流程并把每次运行写进本地日志(list 回看、doctor 交叉核对宿主日志、sanitize 脱敏后才能外发);查 DeepSeek 官方最新版本,取该版本的官方升级指南,扫描本机插件代码(package 命中自动到目标宿主 node_modules 实测核查),报出哪些地方踩了破坏性变更并给出官方修法;seams 接缝查询一个包名/API 符号在指南与本机宿主里的双源结论(还在不在、哪个版本移除的);scaffold 一条命令生成五形态可冒烟的插件骨架(package.json 不变量+形态入口+挂载层+命名投影,生成即验证);同时巡检本机 DSH 环境(profiles 覆盖层旧包残留、共享 node_modules 农场悬空软链、两层 patch(各 profile 层+全局 ~/.dsh/cordis.patch.yml)、已装插件、运行中宿主、宿主半与客户端半双面启用就绪度——dsh.client 声明/产物/注入名册死链,web 端与桌面端一视同仁)。修完可秒级冒烟验证,--real-smoke 再补干净 profile 真装真启档(桥接原仓库 verify-runtime),升级时可顺带做插件性能与架构审计。老版本插件(官方指南覆盖不到 v0.1.7-rc.2 之前的走廊)转迁移 SOP,对照原仓库 plugin-upgrade 的人工卡片走廊走七阶段流程。当需要把 DSH 插件适配到新版本或老版本、从零创建 DSH 插件、给新插件生成起步骨架、排查升级后插件报错、核查插件是否用了已移除的包或 API、查某个包/API 在目标宿主还在不在、检查 ~/.dsh 覆盖层有无旧包残留、给插件做性能与架构体检、诊断宿主启动失败日志(端口占用/未声明 inject/客户端入口死链)、把独立仓的技能面同步到下游技能目录时使用。触发词:适配 DSH 插件、升级插件、插件不兼容、dsh 升级后报错、插件用了废弃 API、接缝查询、这个 API 还在不在、检查覆盖层旧包、客户端卡 loading、entry did not activate、web boot 失败、注入死链、老版本 DSH 适配、历史走廊迁移、创建 DSH 插件、写 DSH 插件、插件脚手架、插件冒烟测试、插件性能审计、插件装了没生效、宿主启动失败、StartupError、EADDRINUSE、日志诊断、下游同步、技能漂移。/plugin-fleet-sweepUse when the DSH host itself has been upgraded (or is about to be) and the whole installed fleet of Web/client plugins must be checked against the new host - one or more surfaces broke, vanished, or need their compatibility re-verified and re-released. Also use after a host upgrade to sweep for silent breaks before the user reports them, and to run the per-plugin fix/release loop (branch, bump, changelog, tag, mirrors)./plugin-heavy-depUse when adding a heavyweight browser dependency (diagram/chart renderers like mermaid, code editors, big wasm-adjacent libs) to a lightweight DSH Web plugin that must stay small, when wiring a lazy-loaded chunk through a host route, when the lazy import intermittently fails or falls back, or when rendering untrusted markup (SVG/HTML) produced by such a dependency.Other plugins' skills for the same job