DeepSeek Harness Plugin Creator
Build the smallest plugin that works through the real DeepSeek Harness loading
and deployment path. Use the deterministic fast path for a simple Tool and the
risk-specific workflow for everything more capable.
Discover the current contract first
DeepSeek Harness is preview software. Never choose APIs, commands, or versions
from memory, this Skill, an API snapshot, or another plugin alone.
- Read the target repository's
AGENTS.md, instructions, manifest, lockfile,
and existing patches.
- Read references/contract-discovery.md.
- Pin the official Harness tag or commit, target CLI/Profile, Node and package-
manager versions, and every relevant package version.
- State the observed contract before creating files. Treat external plugins
as version-qualified design evidence, not authority.
Prefer a current, identifiable official checkout. Otherwise inspect the
official deepseek-ai/deepseek-harness repository. Only official source and
documentation establish API behavior.
Choose a lane
Simple Tool fast path
Use the bundled scaffold when all of these hold:
- this is a new external package rather than a structural edit to an existing
plugin;
- one named-namespace host entry and a bounded model-facing Tool satisfy the
request;
- no durable state, scheduler, Worker/subprocess, credentials, provider call,
Web client, custom Agent/session loop, or external mutation is required.
After contract discovery, inspect the script's current interface and run it:
node <skill-dir>/scripts/scaffold_plugin.mjs --help
node <skill-dir>/scripts/scaffold_plugin.mjs dsh-example \
--dir <parent-dir> --profile <target-profile> \
--dsh-repo <pinned-official-checkout> --tool example_echo
It reads runtime versions from the installed Profile and the Node engine from
the pinned official checkout. A published DSH manifest may omit the root engine
contract. If either evidence source is unavailable, pass the corresponding
exact runtime overrides and evidence-derived --node-engine; never derive the
target engine from whichever Node happens to run the script. The target must be
absent or an empty real directory; there is no overwrite mode. Then read
references/api-quick-reference.md, inspect
every generated file, implement the bounded behavior, and follow the same real
Loader and fresh-Profile gates as a hand-built plugin. The scaffold is a
starting artifact, not contract discovery or release proof.
The fast path only runs for a DSH version whose complete scaffold contract is
audited in the script (currently 0.1.1-rc.2, including Schemastery ownership
and toolchain pins). For any other target, use the capability-specific path
until that version receives a new audited snapshot. Generated host-runtime
peers default to the exact observed versions; widen them only after explicit
compatibility evidence.
Read references/tool-authority.md if the Tool is
not intentionally available to every eligible Agent, or if later requirements
add mutation, cost, or durable effects. Leave the fast path as soon as its
assumptions stop holding.
Capability-specific path
Choose the smallest shape that satisfies the request:
| Need |
Primary shape |
| Compose existing plugins/defaults |
Bundle patch only |
| Add a host capability or registry |
Cordis host plugin/Service |
| Expose a model-callable operation |
DSH Tool plugin |
| Integrate Agent, Session, Goal, Job, or preset behavior |
Agent/session plugin |
| Schedule or recover durable work |
Durable host runtime |
| Invoke another process or model runtime |
Isolated Worker/provider adapter |
| Extend the Web client |
Host plugin plus declared client bundle |
Do not add a Worker, store, UI, custom Agent loop, or separate Service merely
because Harness supports one.
Load only the references triggered by the task:
- Any Tool, scoped registration, permission gate, or external mutation:
tool-authority.md.
- Subprocess, workspace snapshot, credential, provider, MCP, or isolation:
sandboxed-workers.md.
- Cron, heartbeat, queue, background pump, persistence, or recovery:
durable-runtime.md.
- Web UI or browser bundle:
client-extensions.md.
- Installation/load failure or silent behavior:
troubleshooting.md.
- Packaging, Profile installation, repository, or publication:
release-gates.md.
When several apply, combine their invariants.
Implement the Harness-native boundary
- Declare
dsh.bundle.patch only when the package contributes a patch, and
point it to a shipped file.
- Cordis accepts function, object, and constructor/class plugins. An external
Loader root should be either:
- named namespace
apply with optional name, inject, and Config, and no
default export; or
- one default-exported function,
{ apply } object, or Service class.
Auxiliary named exports may accompany a default plugin. Never add a competing
named apply; named inject or Config bindings are not metadata for the
unwrapped default, so attach required metadata to the default itself.
- Make
inject match required services accessed through ctx.<service>. Use
the pinned official lookup pattern for genuinely optional services.
- Export a real Standard Schema for configurable plugins. Normalize and
revalidate security-sensitive or cross-field values in the implementation.
- For each host-supplied Cordis/DSH runtime imported by shipped code, use an
exact development version and committed lockfile. The peer range must include
that version and may be exact or evidence-backed compatible. Put plugin-owned
runtime libraries, including Schemastery under the rc.2 contract, in exact
dependencies. Never release *, file:, link:, or workspace: specs,
and externalize host-owned runtimes.
- Treat registrations as Fiber-owned effects. Give timers, watchers,
connections, subprocesses, and stores explicit admission, cancellation,
drain, and disposal ownership.
- Assume a patch overriding an existing row replaces its complete
config
unless the pinned contract proves otherwise.
- Treat
!!js, source-install scripts, shell commands, MCP servers, and host
Workers as executable host code outside the model's ordinary Tool sandbox.
- For a Web extension, require both
dsh.client.platform: web and
exports["./client"], then reproduce the pinned client-bundle contract.
Test the delivered shape
Unit-test pure parsing, bounds, cancellation, state transitions, and failure
paths.
Mount through a real Cordis Context for lifecycle and disposal behavior.
Exercise the actual Loader/package export and cordis.patch.yml; a stub
{ name, inject, apply } object cannot prove package loading.
Test negative authority, unavailable services, shutdown during work,
partial confinement, and bounded diagnostics when those risks exist.
Run the repository's exact typecheck, tests, build, and aggregate check.
Run the bundled static validator:
node <skill-dir>/scripts/validate_plugin.mjs <plugin-dir> --built
It verifies observable package and export structure, but cannot prove that a
visible Config binding implements Standard Schema without executing
candidate code; the real Loader gate remains authoritative. It uses
/usr/bin/python3 for descriptor-bound tree inspection and fails
closed when that POSIX runtime is unavailable. On another platform, perform
an equivalent frozen-tree/package inspection.
Use the acceptance helper in static-only mode before trusting candidate
code, then opt into execution only after reviewing the source:
node <skill-dir>/scripts/accept_plugin.mjs <plugin-dir>
node <skill-dir>/scripts/accept_plugin.mjs <plugin-dir> --trusted-execute
Default mode only delegates to static validation. --trusted-execute is not
a sandbox: for an exact declared npm or pnpm version, it verifies that local
CLI, runs candidate package scripts, packs the result, installs the
exact archive in a temporary DSH_HOME, revalidates the post-pack source
and installed archive surface, binds descriptor-walk path/stat metadata for
that installed tree across validation, composition, boot, and shutdown gates,
and automatically boots only a Web Profile. This metadata guard includes
dist but does not hash installed content bytes; a same-UID mutation fully
restored between checks remains outside the proof boundary.
Automatic composition acceptance applies only when the Bundle mounts its
own package root or an exported package subpath, and checks those mounted row
IDs. Patch-only Bundles, non-own row/config changes, and unmatched-patch
diagnostics require --pack-only plus a manual composition gate.
It forwards a small operating environment rather than ambient provider/API
credential variables, but it is still unsandboxed host code with filesystem
and network authority. Use it only for reviewed source. Its automatic success
proves the top-level DSH process, HTTP readiness endpoint, normal exit, and
reported port release—not descendant-process quiescence, database/file cleanup,
or other capability-specific resources. Use --pack-only plus manual
app-specific gates for unsupported Profiles. For an unsupported package
manager, keep to static validation and run every packaging and fresh-Profile
gate manually. Always add capability-specific cleanup checks when the plugin
can create external resources. The helper has no built-in provider
functional turn, but it cannot enforce offline behavior: trusted candidate
scripts or startup code retain host filesystem and network authority and may
initiate their own provider call or read credentials from disk.
For delivery, follow the clean-package and fresh-Profile gates in
references/release-gates.md. --dump-config proves composition only.
Make real-provider tests explicit opt-in. Disclose the fixture/diff leaving
the machine, provider/model, credential source, and possible cost.
For a high-risk plugin—durable external effects, secrets, host command
execution, security-sensitive snapshots, or public release—obtain an
independent read-only audit and repeat affected artifact gates after fixes.
Preserve authorization boundaries
Implementation does not authorize npm publication, GitHub repository creation
or visibility changes, deployment, Profile mutation, credential changes, or
third-party messages. Perform only externally mutating steps the user actually
authorized, against the frozen tested artifact.
Completion report
Lead with the delivered capability. Include the artifact path and pinned
baseline; registered Services/Tools and authority; writes, network,
subprocesses, credentials, and provider disclosure; exact test, package,
fresh-install, startup, shutdown, and audit evidence; unsupported shapes or
unsafe opt-outs; and a remote URL/commit only when a requested push was read
back and verified.
1---2name: deepseek-harness-plugin-creator3description: Scaffold, create, materially revise, validate, or debug external DeepSeek Harness/Cordis plugins and bundle layers, including Tools, Services, schedulers, Workers, providers, and Web client extensions. Use when the target explicitly concerns DeepSeek Harness, dsh, or @deepseek-ai/dsh-* development. Do not use for Codex plugins, generic Node packages, installation-only requests, or read-only reviews.4---56# DeepSeek Harness Plugin Creator78Build the smallest plugin that works through the real DeepSeek Harness loading9and deployment path. Use the deterministic fast path for a simple Tool and the10risk-specific workflow for everything more capable.1112## Discover the current contract first1314DeepSeek Harness is preview software. Never choose APIs, commands, or versions15from memory, this Skill, an API snapshot, or another plugin alone.16171. Read the target repository's `AGENTS.md`, instructions, manifest, lockfile,18 and existing patches.192. Read [references/contract-discovery.md](references/contract-discovery.md).203. Pin the official Harness tag or commit, target CLI/Profile, Node and package-21 manager versions, and every relevant package version.224. State the observed contract before creating files. Treat external plugins23 as version-qualified design evidence, not authority.2425Prefer a current, identifiable official checkout. Otherwise inspect the26official `deepseek-ai/deepseek-harness` repository. Only official source and27documentation establish API behavior.2829## Choose a lane3031### Simple Tool fast path3233Use the bundled scaffold when all of these hold:3435- this is a new external package rather than a structural edit to an existing36 plugin;37- one named-namespace host entry and a bounded model-facing Tool satisfy the38 request;39- no durable state, scheduler, Worker/subprocess, credentials, provider call,40 Web client, custom Agent/session loop, or external mutation is required.4142After contract discovery, inspect the script's current interface and run it:4344```bash45node <skill-dir>/scripts/scaffold_plugin.mjs --help46node <skill-dir>/scripts/scaffold_plugin.mjs dsh-example \47 --dir <parent-dir> --profile <target-profile> \48 --dsh-repo <pinned-official-checkout> --tool example_echo49```5051It reads runtime versions from the installed Profile and the Node engine from52the pinned official checkout. A published DSH manifest may omit the root engine53contract. If either evidence source is unavailable, pass the corresponding54exact runtime overrides and evidence-derived `--node-engine`; never derive the55target engine from whichever Node happens to run the script. The target must be56absent or an empty real directory; there is no overwrite mode. Then read57[references/api-quick-reference.md](references/api-quick-reference.md), inspect58every generated file, implement the bounded behavior, and follow the same real59Loader and fresh-Profile gates as a hand-built plugin. The scaffold is a60starting artifact, not contract discovery or release proof.6162The fast path only runs for a DSH version whose complete scaffold contract is63audited in the script (currently `0.1.1-rc.2`, including Schemastery ownership64and toolchain pins). For any other target, use the capability-specific path65until that version receives a new audited snapshot. Generated host-runtime66peers default to the exact observed versions; widen them only after explicit67compatibility evidence.6869Read [references/tool-authority.md](references/tool-authority.md) if the Tool is70not intentionally available to every eligible Agent, or if later requirements71add mutation, cost, or durable effects. Leave the fast path as soon as its72assumptions stop holding.7374### Capability-specific path7576Choose the smallest shape that satisfies the request:7778| Need | Primary shape |79| --- | --- |80| Compose existing plugins/defaults | Bundle patch only |81| Add a host capability or registry | Cordis host plugin/Service |82| Expose a model-callable operation | DSH Tool plugin |83| Integrate Agent, Session, Goal, Job, or preset behavior | Agent/session plugin |84| Schedule or recover durable work | Durable host runtime |85| Invoke another process or model runtime | Isolated Worker/provider adapter |86| Extend the Web client | Host plugin plus declared client bundle |8788Do not add a Worker, store, UI, custom Agent loop, or separate Service merely89because Harness supports one.9091Load only the references triggered by the task:9293- Any Tool, scoped registration, permission gate, or external mutation:94 [tool-authority.md](references/tool-authority.md).95- Subprocess, workspace snapshot, credential, provider, MCP, or isolation:96 [sandboxed-workers.md](references/sandboxed-workers.md).97- Cron, heartbeat, queue, background pump, persistence, or recovery:98 [durable-runtime.md](references/durable-runtime.md).99- Web UI or browser bundle:100 [client-extensions.md](references/client-extensions.md).101- Installation/load failure or silent behavior:102 [troubleshooting.md](references/troubleshooting.md).103- Packaging, Profile installation, repository, or publication:104 [release-gates.md](references/release-gates.md).105106When several apply, combine their invariants.107108## Implement the Harness-native boundary109110- Declare `dsh.bundle.patch` only when the package contributes a patch, and111 point it to a shipped file.112- Cordis accepts function, object, and constructor/class plugins. An external113 Loader root should be either:114 - named namespace `apply` with optional `name`, `inject`, and `Config`, and no115 default export; or116 - one default-exported function, `{ apply }` object, or Service class.117 Auxiliary named exports may accompany a default plugin. Never add a competing118 named `apply`; named `inject` or `Config` bindings are not metadata for the119 unwrapped default, so attach required metadata to the default itself.120- Make `inject` match required services accessed through `ctx.<service>`. Use121 the pinned official lookup pattern for genuinely optional services.122- Export a real Standard Schema for configurable plugins. Normalize and123 revalidate security-sensitive or cross-field values in the implementation.124- For each host-supplied Cordis/DSH runtime imported by shipped code, use an125 exact development version and committed lockfile. The peer range must include126 that version and may be exact or evidence-backed compatible. Put plugin-owned127 runtime libraries, including Schemastery under the rc.2 contract, in exact128 `dependencies`. Never release `*`, `file:`, `link:`, or `workspace:` specs,129 and externalize host-owned runtimes.130- Treat registrations as Fiber-owned effects. Give timers, watchers,131 connections, subprocesses, and stores explicit admission, cancellation,132 drain, and disposal ownership.133- Assume a patch overriding an existing row replaces its complete `config`134 unless the pinned contract proves otherwise.135- Treat `!!js`, source-install scripts, shell commands, MCP servers, and host136 Workers as executable host code outside the model's ordinary Tool sandbox.137- For a Web extension, require both `dsh.client.platform: web` and138 `exports["./client"]`, then reproduce the pinned client-bundle contract.139140## Test the delivered shape1411421. Unit-test pure parsing, bounds, cancellation, state transitions, and failure143 paths.1442. Mount through a real Cordis Context for lifecycle and disposal behavior.1453. Exercise the actual Loader/package export and `cordis.patch.yml`; a stub146 `{ name, inject, apply }` object cannot prove package loading.1474. Test negative authority, unavailable services, shutdown during work,148 partial confinement, and bounded diagnostics when those risks exist.1495. Run the repository's exact typecheck, tests, build, and aggregate check.1506. Run the bundled static validator:151152 ```bash153 node <skill-dir>/scripts/validate_plugin.mjs <plugin-dir> --built154 ```155156 It verifies observable package and export structure, but cannot prove that a157 visible `Config` binding implements Standard Schema without executing158 candidate code; the real Loader gate remains authoritative. It uses159 `/usr/bin/python3` for descriptor-bound tree inspection and fails160 closed when that POSIX runtime is unavailable. On another platform, perform161 an equivalent frozen-tree/package inspection.1621637. Use the acceptance helper in static-only mode before trusting candidate164 code, then opt into execution only after reviewing the source:165166 ```bash167 node <skill-dir>/scripts/accept_plugin.mjs <plugin-dir>168 node <skill-dir>/scripts/accept_plugin.mjs <plugin-dir> --trusted-execute169 ```170171 Default mode only delegates to static validation. `--trusted-execute` is not172 a sandbox: for an exact declared npm or pnpm version, it verifies that local173 CLI, runs candidate package scripts, packs the result, installs the174 exact archive in a temporary `DSH_HOME`, revalidates the post-pack source175 and installed archive surface, binds descriptor-walk path/stat metadata for176 that installed tree across validation, composition, boot, and shutdown gates,177 and automatically boots only a Web Profile. This metadata guard includes178 `dist` but does not hash installed content bytes; a same-UID mutation fully179 restored between checks remains outside the proof boundary.180 Automatic composition acceptance applies only when the Bundle mounts its181 own package root or an exported package subpath, and checks those mounted row182 IDs. Patch-only Bundles, non-own row/config changes, and unmatched-patch183 diagnostics require `--pack-only` plus a manual composition gate.184 It forwards a small operating environment rather than ambient provider/API185 credential variables, but it is still unsandboxed host code with filesystem186 and network authority. Use it only for reviewed source. Its automatic success187 proves the top-level DSH process, HTTP readiness endpoint, normal exit, and188 reported port release—not descendant-process quiescence, database/file cleanup,189 or other capability-specific resources. Use `--pack-only` plus manual190 app-specific gates for unsupported Profiles. For an unsupported package191 manager, keep to static validation and run every packaging and fresh-Profile192 gate manually. Always add capability-specific cleanup checks when the plugin193 can create external resources. The helper has no built-in provider194 functional turn, but it cannot enforce offline behavior: trusted candidate195 scripts or startup code retain host filesystem and network authority and may196 initiate their own provider call or read credentials from disk.1978. For delivery, follow the clean-package and fresh-Profile gates in198 `references/release-gates.md`. `--dump-config` proves composition only.1999. Make real-provider tests explicit opt-in. Disclose the fixture/diff leaving200 the machine, provider/model, credential source, and possible cost.201202For a high-risk plugin—durable external effects, secrets, host command203execution, security-sensitive snapshots, or public release—obtain an204independent read-only audit and repeat affected artifact gates after fixes.205206## Preserve authorization boundaries207208Implementation does not authorize npm publication, GitHub repository creation209or visibility changes, deployment, Profile mutation, credential changes, or210third-party messages. Perform only externally mutating steps the user actually211authorized, against the frozen tested artifact.212213## Completion report214215Lead with the delivered capability. Include the artifact path and pinned216baseline; registered Services/Tools and authority; writes, network,217subprocesses, credentials, and provider disclosure; exact test, package,218fresh-install, startup, shutdown, and audit evidence; unsupported shapes or219unsafe opt-outs; and a remote URL/commit only when a requested push was read220back and verified.