/dsh-plugin-upgrade-skill:plugin-writefrom dsh-plugin-upgrade-skill
Guides creating DeepSeek Harness plugins: repository mode selection, naming validation, manifest creation, and version adaptation across DSH releases.
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.
Create a plugin package. First classify the repository mode and plugin form, then read the matching reference files, and finally validate the published entry with the smallest set of gates that covers the change.
| Target | Rules to apply |
|---|---|
A package inside the official deepseek-harness monorepo | Use the in-repository package, tsconfig, documentation, and root-gate rules below. |
| An externally installable DSH plugin | Preserve that repository's package layout and scripts. Use only packages and exports published by the exact target DSH version. Do not copy private, workspace versions, root tsconfig registration, or monorepo-only README gates. |
| An existing plugin being adapted to a new DSH host | Read references/version-adaptation.md, build the complete version corridor, and run the seven-class touchpoint preflight. If a change is breaking and the user has not yet authorized implementation, present the migration plan and wait for confirmation. After authorization, complete the version adaptation before using this Skill's form references. Form examples must never override target source, type declarations, or release notes. |
Derive Cordis, Schemastery, and DSH package names and version ranges from the manifest of the exact target version. Current examples use scoped @deepseek-ai/* identifiers. Older targets may differ and must follow their own published contracts.
For every new external plugin, read references/naming-conventions.md before choosing public identifiers. Create dsh-plugin.naming.json at the plugin repository root and run the bundled read-only validator before final package validation. Treat compatibility errors as target-contract failures and prefix warnings as community recommendations; use --strict only when the plugin adopts the collision-resistant profile. This is not an official Harness manifest or a global reservation. For an existing external plugin, report naming deviations but preserve published names unless the user explicitly authorizes a compatibility-breaking rename. Packages inside the official monorepo follow the exact target checkout instead of this external naming profile.
After the offline declaration passes, read references/registry-check.md and run the separate central lookup when public network access is available. Supply the exact target Harness version and preserve the reported index SHA-256 with the source URL as evidence. Treat a completed no-match result only as “no reviewed match”; treat timeout, malformed data, unsupported contract, oversized input, or network failure as “unknown/not checked.” Never let the online lookup modify the local manifest, automatically rename a published surface, or turn an automated discovery candidate into a reservation. When central registration is explicitly selected, prepare the full v2 entry and run the central repository's check and verify-source commands before copying it into registry/entries. Validation does not authorize submitting a PR; a formal reservation exists only after a source-backed entry is reviewed and merged in the central registry.
| Required capability | Form | Reference |
|---|---|---|
| Model-callable tools for reading files, running commands, or searching the Web | Tool plugin | references/tool-plugin.md |
| A new model provider | LLM adapter plugin | references/llm-adapter-plugin.md |
| Request, tool, or turn interception for permissions, policy, metrics, or telemetry | Hook plugin | references/hook-plugin.md |
A capability consumed by other plugins through ctx | Service plugin | references/service-plugin.md |
User-configurable behavior supplied through cordis.yml | Config plugin | references/config-plugin.md |
A plugin may combine forms freely, such as a configurable tool plugin or a service that also registers tools. Every included form still has to satisfy its own contract. When a requirement does not match one of the five forms above, map it to an existing extension point and write a plugin that registers there. Never modify the Agent loop directly.
| Goal | Mechanism |
|---|---|
| Add a model-callable capability | Register it on ctx.tools |
| Add a model provider | Register an adapter on ctx.llm |
| Provide a different capability set for one session | Assemble it in an Agent preset |
| Add Shell execution | Implement and register a ctx.bash backend |
| Add persistent terminal execution | Register a ctx.pty backend and load dsh-tool-pty |
| Add human commands | Register them on ctx.commands |
| Add background tasks | Register them on ctx.tasks |
| Add filesystem access or policy | Implement a ctx.fs provider or listen for fs/* policy events |
| Constrain launched processes | Use a ctx.sandbox backend |
| Intercept requests, tools, or turns | Use agent/* or tools/* events; agent/turn-stopping is the turn-stopping event |
| Add model-visible context | Call agent.inject() |
| Add UI or editor integration | Drive ctx.agents and render from session/event |
| Add Web-client conversation nodes | Register a ConversationNodeDefinition and keyed renderers |
| Add persistent session state | Extend SessionEventMap, then render and replay from the log |
| Fork a live session | Call ctx.sessions.fork(source, boundary?, childSessionId?) |
| Scope registrations to one Agent | Use that Agent's agent.ctx |
Create an in-repository package — Only in the official monorepo, create packages/<group>/<pkg>/ with package.json, tsconfig.json, src/index.ts, and README.md. Copy packages/core/tools/package.json from the target checkout, then adjust its name, description, and dependencies. Preserve target-version invariants: private: true; the root package version; type: module; main: "lib/index.js"; types: "lib/types/index.d.ts"; both types and default in exports["."] pointing to lib; the same target Cordis range in peer and development dependencies; every DSH peer dependency mirrored in development dependencies; the target Schemastery package declared in dependencies; and the target files layout plus package-specific runtime artifacts. CLI application packages must include the built bin. Do not publish undeclared source or stale artifacts. Follow relative-import conventions from the target checkout. Prefer an existing group with the matching role. A new group is only a container, and the package must sit exactly one level below it.
Register an in-repository package — Only in the official monorepo, add the package to the Host or Client aggregate exactly as required by the development guide in the target checkout. A normal package belongs to one aggregate only. Do not copy historical exceptions or file lists without checking the target version. External plugins must never modify Harness root configuration.
Create an external package — Preserve the existing package manager and build system. For a new plugin, apply the external naming policy and include a validated dsh-plugin.naming.json; for an existing plugin, do not silently rename public surfaces. Keep main, types, exports, files, optional bin, packaged-composition or Profile metadata, and the packed tarball consistent. Declare every runtime dependency explicitly and mirror the DSH peer dependencies needed for compilation in development dependencies. Do not make a publishable external plugin private or give it workspace version ranges merely because an in-repository template does so.
Choose the package topology — For a replaceable capability, split service definition, provider, and consumer into separate packages only when they will evolve independently. Keep a single-purpose plugin in one package.
Write the in-repository package README — Only when required by the target monorepo, put package-specific service APIs, configuration, events, extension points, and design notes first. End the README with the canonical "Model Experience" ordering and "Known Limitations" section from the target checkout. Describe each direct, conditional, capped, lifecycle, or auxiliary-model surface in its own H3 with the following three H4 sections, each containing a prose paragraph. Quote stable text owned by the package. For a tool Schema surface, describe only differences not already present in the generated tool catalog. Under "KV Cache Impact," distinguish append-only growth, stable repeated prefixes, replacement of earlier request tokens, and independent model requests. Then list the package changes that invalidate reuse.
## Model Experience
### Request Surface and Activation Conditions
#### What the Model Sees
Name the exact data-dependent field, link to the generated catalog with an anchor, or introduce the verbatim text below.
##### Place the Verbatim Field Text Here When Needed
```markdown
Copy any stable system-prompt body or other long nongenerated literal exactly from source.
```
#### Token Impact
State whether the impact is fixed, conditional, retained, replaced, capped, or has zero direct token impact.
#### KV Cache Impact
Describe append-only, prefix-stable, replacement, or independent behavior, including exact conditions that may invalidate reuse.
## Known Limitations and Deferred Work
- **Consumer-visible gap** — State the exact missing operation or condition, its consequence, and any maintainer constraint.
Validate — For a new external plugin, first run node <plugin-write-skill>/scripts/validate-names.mjs --manifest ./dsh-plugin.naming.json; add --strict only for the collision-resistant community profile. After it passes, run node <plugin-write-skill>/scripts/query-registry.mjs --manifest ./dsh-plugin.naming.json --harness-version <exact-semver> when network access is available, and report an unavailable query as unknown rather than available. If proxy variables are present and Node's built-in fetch cannot reach the index, follow references/registry-check.md; do not imply that Node 20-23 automatically honor those variables. Then run the applicable validation block below, focused checks, and coverage gate required by the changed behavior.
ctx helpers or ctx.effect() with a disposer, and make plugin unload clean up every event listener, tool, timer, and other resource.agent-loop.@param and @returns. Define typed events through declaration merging on the target Cordis Events interface, and document the dispatch mode with @mode.Config field changeable through cordis.yml.For packages inside the official Harness monorepo, use current root commands from the target checkout. The names below are examples only; confirm they exist before running them:
pnpm install # Register the workspace
pnpm run doc-sync
pnpm run constraints && pnpm run typecheck && pnpm run lint
pnpm run build && pnpm run hygiene
For an external plugin, use its own install, typecheck, test, static-check, and build commands. Pack the publishable artifact, inspect its contents, and load it into an isolated Profile running the exact target DSH. For an upgrade, cold-start it and complete one message → tool → reply flow or an equivalent core flow. Report every provider, operating-system, UI, or credential boundary that remains uncovered.
Select tests from the changed surface: unit-test logic; run the repository's coverage gate; run real-API end-to-end tests when provider credentials are available and execution is authorized; use credential-free snapshots for model-, protocol-, or user-visible behavior; and use a real-composition test for user-visible plugins. A package bin entry also needs a built-artifact smoke test under native Node. Complete the minimum sufficient test set under these rules without loading another Skill.
See references/README.md for the reference index.
references/README.md (opens in a new tab)references/config-plugin.md (opens in a new tab)references/hook-plugin.md (opens in a new tab)references/llm-adapter-plugin.md (opens in a new tab)references/naming-conventions.md (opens in a new tab)references/naming-policy.v1.json (opens in a new tab)references/plugin-naming.schema.json (opens in a new tab)references/registry-check.md (opens in a new tab)references/service-plugin.md (opens in a new tab)references/tool-plugin.md (opens in a new tab)references/version-adaptation.md (opens in a new tab)scripts/query-registry.check.mjs (opens in a new tab)scripts/query-registry.mjs (opens in a new tab)scripts/validate-names.check.mjs (opens in a new tab)scripts/validate-names.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