DeepSeek Harness Plugin Development
August 17, 2026 · View on GitHub
Use this skill to ship a small, correct DeepSeek Harness plugin change quickly while staying aligned with the repository's Cordis architecture, package conventions, documentation requirements, and verification policy.
Required Orientation
Before changing code under packages/, read the active repository sources, not this skill alone:
AGENTS.mddocs/architecture.mdpackages/AGENTS.mddocs/cookbook/extension-cookbook.md- For new packages:
docs/cookbook/adding-a-package.md - For model-facing tools:
docs/cookbook/adding-a-tool.md - For lifecycle, subprocess, concurrency, or teardown work:
docs/defensive-patterns.md - For docs/prose changes: use
dsh-prose-standard - Before push or ready-for-review: use
dsh-pre-push-checks
Read references/playbooks.md when the user wants a plugin implemented or scaffolded quickly.
Read references/templates.md when writing new package, plugin, README, invariant, or test skeletons.
Read references/plugin-standards.md when you need the compact rules checklist or when reviewing a plugin change.
Fast Build Loop
- Classify the request into one plugin type: model tool, hook/policy, context injector, Service Definition, Service Provider, Consumer, LLM adapter, UI/protocol driver, settings card, or bundle/profile wiring.
- Load only the matching playbook and template references.
- Inspect the closest existing package in the same role.
- Produce the smallest working slice: package skeleton, registration, core behavior, README/JSDoc, invariant companion, and focused test plan.
- Run the smallest checks that prove the slice.
For a new simple function plugin package, optionally use:
~/.codex/skills/deepseek-harness-plugin-dev/scripts/create-function-plugin.sh \
/path/to/deepseek-harness <group> <pkg> [inject_csv]
The script creates starter files only. The agent must still inspect the live repository, add aggregate tsconfig references, add dependencies for injected services, and write behavior-specific tests.
Workflow
- State the target behavior, scope, completion criteria, and verification plan before editing.
- Identify the plugin kind: tool, hook/policy, Service Definition, Service Provider, Consumer, LLM adapter, UI/protocol driver, settings card, or bundle/profile wiring.
- Pick the documented extension point. Do not patch
agent-loopfor behavior that can attach throughctx.tools,ctx.llm,ctx.agents,ctx.systemPrompt,session/event, or a capability event. - Inspect the nearest existing package in the same role and follow its file layout, imports, README style, tests, and invariant companion pattern.
- Keep the implementation scoped and simple. Add abstractions only for a current owner and current consumer.
- Make registrations reversible with
ctx.effect(),ctx.on(), or registry methods whose disposer is tied to the plugin fiber. - For any model-visible input or durable state, verify that it is reconstructable from the session log.
- Add or update focused tests. Product-visible plugins require a real Loader/app/process composition test, not only hand-built
ctx.plugin(...)tests. - Update README/JSDoc and add an Agent Note for non-trivial changes.
- Run only the smallest checks that cover the changed surface, then report exactly what passed and what was not verified.
Common Decisions
- Add a model-facing capability: register a typed tool on
ctx.tools; if the capability is swappable, design the Service Definition, Provider, and Consumer roles together. - Add request/tool policy: use
tools/pre-execute,ctx.tools.guard(),tools/execute,tools/post-execute, ortools/resultaccording to whether the plugin denies, wraps dispatch, transforms results, or observes final outcomes. - Add model context: prefer
agent.inject()oragent/pre-stepwith a durableuser/messagesource. New model-visible facts usually need aSessionEventMapmember and invariant. - Add a provider: implement the Service Definition without importing consumers or provider-specific assumptions into the interface.
- Add a UI or protocol bridge: drive agents through
ctx.agentsand render fromsession/event.
Guardrails
- Address the user as
老板when replying in this project. - Preserve UTF-8 Chinese text.
- Do not overwrite unrelated dirty worktree changes.
- Do not add compatibility shims for unreleased on-disk formats unless the user explicitly asks; this repo is pre-release.
- Do not hardcode deployment-varying tunables in plugin code; expose validated
Configfields. - Do not put UI, transport, or implementation vocabulary in model-facing prompts, tool schemas, results, or diagnostics.